4 <script src=
"../../../resources/js-test.js"></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");
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");
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
);