summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/uievents/legacy/Event-subclasses-init.html
blob: a79a9f18adba6e329b6be8c45724417b4e337fde (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<!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>