Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / constructors / webgl-context-event-constructor.html
blob71e2be5e0d1b771801a56f9f71d9c461dd60b186
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <p id="description"></p>
8 <div id="console"></div>
9 <script>
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", "");
18 // bubbles is passed.
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.
27 // Strings.
28 shouldBeEqualToString("new WebGLContextEvent('eventType', { statusMessage: 'abcde' }).statusMessage", "abcde");
29 shouldBeEqualToString("new WebGLContextEvent('eventType', { statusMessage: '' }).statusMessage", "");
31 // Non-strings.
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'");
48 </script>
49 </body>
50 </html>