Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /uievents/legacy/Event-subclasses-init.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
'use strict';
for (let eventTypeName of ['UIEvent', 'MouseEvent', 'KeyboardEvent', 'CompositionEvent']) {
test(function() {
let eventType = self[eventTypeName];
assert_equals(eventType.length, 1);
let event = new eventType('test');
let initFunction = "init" + eventTypeName;
assert_throws_js(TypeError, function() { eventType.prototype[initFunction].call(event) });
}, `Call init${eventTypeName} without parameters`);
}
</script>