mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 07:03:29 +00:00
add createEvent tests
This commit is contained in:
@@ -167,3 +167,23 @@
|
|||||||
acss.push(new CSSStyleSheet());
|
acss.push(new CSSStyleSheet());
|
||||||
testing.expectEqual(1, acss.length);
|
testing.expectEqual(1, acss.length);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<script id=createEvent>
|
||||||
|
const event = document.createEvent("Event");
|
||||||
|
|
||||||
|
testing.expectEqual(true, event instanceof Event);
|
||||||
|
testing.expectEqual("", event.type);
|
||||||
|
|
||||||
|
const customEvent = document.createEvent("CustomEvent");
|
||||||
|
customEvent.initCustomEvent("hey", false, false);
|
||||||
|
|
||||||
|
testing.expectEqual(true, customEvent instanceof CustomEvent);
|
||||||
|
testing.expectEqual(true, customEvent instanceof Event);
|
||||||
|
|
||||||
|
testing.withError(
|
||||||
|
(err) => {
|
||||||
|
// TODO: Check the error type.
|
||||||
|
},
|
||||||
|
() => document.createEvent("InvalidType"),
|
||||||
|
);
|
||||||
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user