mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-03-22 04:34:44 +00:00
add failing document.documentElement load event test
make sure that we're in capturing phase `testing.expectEqual(true, result)`
This commit is contained in:
@@ -488,3 +488,23 @@
|
|||||||
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">
|
||||||
|
{
|
||||||
|
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);
|
||||||
|
resolve(true);
|
||||||
|
}, true);
|
||||||
|
});
|
||||||
|
|
||||||
|
testing.expectEqual(true, result);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user