mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-03-22 04:34:44 +00:00
Merge pull request #1482 from lightpanda-io/nikneym/failing-document-element-test
Add failing `document.documentElement` `load` event test
This commit is contained in:
3
.github/workflows/zig-test.yml
vendored
3
.github/workflows/zig-test.yml
vendored
@@ -12,8 +12,7 @@ on:
|
|||||||
- main
|
- main
|
||||||
paths:
|
paths:
|
||||||
- "build.zig"
|
- "build.zig"
|
||||||
- "src/**/*.zig"
|
- "src/**"
|
||||||
- "src/*.zig"
|
|
||||||
- "vendor/zig-js-runtime"
|
- "vendor/zig-js-runtime"
|
||||||
- ".github/**"
|
- ".github/**"
|
||||||
- "vendor/**"
|
- "vendor/**"
|
||||||
|
|||||||
@@ -488,3 +488,27 @@
|
|||||||
testing.expectEqual('function', typeof div.onratechange);
|
testing.expectEqual('function', typeof div.onratechange);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<img src="https://cdn.lightpanda.io/website/assets/images/docs/hn.png" />
|
||||||
|
|
||||||
|
<script id="document-element-load">
|
||||||
|
{
|
||||||
|
let asyncBlockDispatched = false;
|
||||||
|
const docElement = document.documentElement;
|
||||||
|
|
||||||
|
testing.async(async () => {
|
||||||
|
const result = await new Promise(resolve => {
|
||||||
|
// We should get this fired at capturing phase when a resource loaded.
|
||||||
|
docElement.addEventListener("load", e => {
|
||||||
|
testing.expectEqual(e.eventPhase, Event.CAPTURING_PHASE);
|
||||||
|
return resolve(true);
|
||||||
|
}, true);
|
||||||
|
});
|
||||||
|
|
||||||
|
asyncBlockDispatched = true;
|
||||||
|
testing.expectEqual(true, result);
|
||||||
|
});
|
||||||
|
|
||||||
|
testing.eventually(() => testing.expectEqual(true, asyncBlockDispatched));
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user