4 <script src=
"../../../resources/js-test.js"></script>
7 <p id=
"description"></p>
8 <div id=
"console"></div>
11 description("This tests the constructor for the WebGLContextEvent DOM class.");
13 // No initializer is passed.
14 shouldBe("new WebGLContextEvent('eventType').bubbles", "false");
15 shouldBe("new WebGLContextEvent('eventType').cancelable", "false");
16 shouldBeEqualToString("new WebGLContextEvent('eventType').statusMessage", "");
19 shouldBe("new WebGLContextEvent('eventType', { bubbles: false }).bubbles", "false");
20 shouldBe("new WebGLContextEvent('eventType', { bubbles: true }).bubbles", "true");
22 // cancelable is passed.
23 shouldBe("new WebGLContextEvent('eventType', { cancelable: false }).cancelable", "false");
24 shouldBe("new WebGLContextEvent('eventType', { cancelable: true }).cancelable", "true");
26 // statusMessage is passed.
28 shouldBeEqualToString("new WebGLContextEvent('eventType', { statusMessage: 'abcde' }).statusMessage", "abcde");
29 shouldBeEqualToString("new WebGLContextEvent('eventType', { statusMessage: '' }).statusMessage", "");
32 shouldBeEqualToString("new WebGLContextEvent('eventType', { statusMessage: undefined }).statusMessage", "");
33 shouldBeEqualToString("new WebGLContextEvent('eventType', { statusMessage: null }).statusMessage", "null");
34 shouldBeEqualToString("new WebGLContextEvent('eventType', { statusMessage: false }).statusMessage", "false");
35 shouldBeEqualToString("new WebGLContextEvent('eventType', { statusMessage: true }).statusMessage", "true");
36 shouldBeEqualToString("new WebGLContextEvent('eventType', { statusMessage: 12345 }).statusMessage", "12345");
37 shouldBeEqualToString("new WebGLContextEvent('eventType', { statusMessage: 18446744073709551615 }).statusMessage", "18446744073709552000");
38 shouldBeEqualToString("new WebGLContextEvent('eventType', { statusMessage: NaN }).statusMessage", "NaN");
39 shouldBeEqualToString("new WebGLContextEvent('eventType', { statusMessage: [] }).statusMessage", "");
40 shouldBeEqualToString("new WebGLContextEvent('eventType', { statusMessage: [1, 2, 3] }).statusMessage", "1,2,3");
41 shouldBeEqualToString("new WebGLContextEvent('eventType', { statusMessage: {abcde: 12345} }).statusMessage", "[object Object]");
42 shouldBeEqualToString("new WebGLContextEvent('eventType', { statusMessage: {valueOf: function () { return 'abcde'; } } }).statusMessage", "[object Object]");
44 // All initializers are passed.
45 shouldBe("new WebGLContextEvent('eventType', { bubbles: true, cancelable: true, statusMessage: 'abcde' }).bubbles", "true");
46 shouldBe("new WebGLContextEvent('eventType', { bubbles: true, cancelable: true, statusMessage: 'abcde' }).cancelable", "true");
47 shouldBe("new WebGLContextEvent('eventType', { bubbles: true, cancelable: true, statusMessage: 'abcde' }).statusMessage", "'abcde'");