mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-12-15 15:58:57 +00:00
feat: test for event target
This commit is contained in:
@@ -113,4 +113,13 @@
|
|||||||
// doesn't crash on null receiver
|
// doesn't crash on null receiver
|
||||||
content.addEventListener('he2', null);
|
content.addEventListener('he2', null);
|
||||||
content.dispatchEvent(new Event('he2'));
|
content.dispatchEvent(new Event('he2'));
|
||||||
|
|
||||||
|
// Test that EventTarget constructor properly initializes vtable
|
||||||
|
const et = new EventTarget();
|
||||||
|
testing.expectEqual('[object EventTarget]', et.toString());
|
||||||
|
|
||||||
|
let constructorTestCalled = false;
|
||||||
|
et.addEventListener('test', () => { constructorTestCalled = true; });
|
||||||
|
et.dispatchEvent(new Event('test'));
|
||||||
|
testing.expectEqual(true, constructorTestCalled);
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user