Bug 1918529 - fix some subpixel misalignment issues with gfx.webrender.svg-filter...
[gecko.git] / dom / midi / tests / test_midi_message_event.html
blobf17ce7624c25209d71734f34527634f5ec39ba73
1 <html>
3 <head>
4 <title>WebMIDI MIDIMessageEvent Test</title>
5 <script src="/tests/SimpleTest/SimpleTest.js"></script>
6 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
7 <script type="application/javascript" src="MIDITestUtils.js"></script>
8 </head>
10 <body>
11 <script class="testbody" type="application/javascript">
12 add_task(async () => {
13 await MIDITestUtils.permissionSetup(true);
15 is(new MIDIMessageEvent('eventType').bubbles, false, "bubbles field is false by default");
16 is(new MIDIMessageEvent('eventType').cancelable, false, "cancelable field is false by default");
17 isDeeply(new MIDIMessageEvent('eventType').data, [], "The default message is empty");
19 is(new MIDIMessageEvent('eventType', { bubbles: false }).bubbles, false, "bubbles is passed");
20 is(new MIDIMessageEvent('eventType', { bubbles: true }).bubbles, true, "bubbles is passed");
22 is(new MIDIMessageEvent('eventType', { cancelable: false }).cancelable, false, "cancelable is passed");
23 is(new MIDIMessageEvent('eventType', { cancelable: true }).cancelable, true, "cancelable is passed");
25 var data = new Uint8Array(16);
26 isDeeply(new MIDIMessageEvent('eventType', { data }).data, data, "data is passed");
28 // All initializers are passed.
29 data = new Uint8Array(3);
30 is(new MIDIMessageEvent('eventType', { bubbles: true, cancelable: true, data }).bubbles, true, "all initializers are passed");
31 is(new MIDIMessageEvent('eventType', { bubbles: true, cancelable: true, data }).cancelable, true, "all initializers are passed");
32 isDeeply(new MIDIMessageEvent('eventType', { bubbles: true, cancelable: true, data }).data, data, "all initializers are passed");
34 if (window.SharedArrayBuffer) {
35 data = new Uint8Array(new SharedArrayBuffer(3));
36 SimpleTest.doesThrow(() => { new MIDIMessageEvent('eventType', { data }); }, "shared array buffers are rejected");
37 } else {
38 todo(false, 'SharedArrayBuffer is unavailable.');
40 });
41 </script>
42 </body>
44 </html>