Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / constructors / midi-message-event-constructor.html
blobd87d5a40931e0d947a08fd519683fd71a66c4696
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <script>
9 description("This tests the constructor for the MIDIMessageEvent DOM class.");
11 // No initializer is passed.
12 shouldBe("new MIDIMessageEvent('eventType').bubbles", "false");
13 shouldBe("new MIDIMessageEvent('eventType').cancelable", "false");
14 shouldBe("new MIDIMessageEvent('eventType').receivedTime", "0.0");
15 shouldBe("new MIDIMessageEvent('eventType').data", "null");
17 // bubbles is passed.
18 shouldBe("new MIDIMessageEvent('eventType', { bubbles: false }).bubbles", "false");
19 shouldBe("new MIDIMessageEvent('eventType', { bubbles: true }).bubbles", "true");
21 // cancelable is passed.
22 shouldBe("new MIDIMessageEvent('eventType', { cancelable: false }).cancelable", "false");
23 shouldBe("new MIDIMessageEvent('eventType', { cancelable: true }).cancelable", "true");
25 // receivedTime is passed.
26 shouldBe("new MIDIMessageEvent('eventType', { receivedTime: 3.14 }).receivedTime", "3.14");
28 // data is passed.
29 var data = new Uint8Array(16);
30 shouldEvaluateTo("new MIDIMessageEvent('eventType', { data: data }).data", data);
32 // All initializers are passed.
33 data = new Uint8Array(3);
34 shouldBe("new MIDIMessageEvent('eventType', { bubbles: true, cancelable: true, receivedTime: 1976.0501, data: data }).bubbles", "true");
35 shouldBe("new MIDIMessageEvent('eventType', { bubbles: true, cancelable: true, receivedTime: 1976.0501, data: data }).cancelable", "true");
36 shouldBe("new MIDIMessageEvent('eventType', { bubbles: true, cancelable: true, receivedTime: 1976.0501, data: data }).receivedTime", "1976.0501");
37 shouldEvaluateTo("new MIDIMessageEvent('eventType', { bubbles: true, cancelable: true, receivedTime: 1976.0501, data: data }).data", data);
39 </script>
40 </body>
41 </html>