Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Side by Side Diff: LayoutTests/webmidi/send-messages.html

Issue 1314763003: Flakyness: fix webmidi/send-messages.html (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../resources/js-test.js"></script> 4 <script src="../resources/js-test.js"></script>
5 <script src="../resources/permissions-helper.js"></script>
5 </head> 6 </head>
6 <body> 7 <body>
7 <script> 8 <script>
8 9
9 description("Test if various kinds of MIDI messages can be validated."); 10 description("Test if various kinds of MIDI messages can be validated.");
10 11
11 shouldBeDefined("testRunner.setPermission"); 12 shouldBeDefined("testRunner.setPermission");
12 shouldBeDefined("navigator.requestMIDIAccess"); 13 shouldBeDefined("navigator.requestMIDIAccess");
13 14
14 window.jsTestIsAsync = true; 15 window.jsTestIsAsync = true;
15 16
16 testRunner.setPermission('midi-sysex', 'granted', location.origin, location.orig in); 17 PermissionsHelper.setPermission('midi-sysex', 'granted').then(function() {
17 18 return navigator.requestMIDIAccess({sysex: true});
18 navigator.requestMIDIAccess({sysex: true}).then(function (a) { 19 }).then(function(a) {
19 output = a.outputs.values().next().value; 20 output = a.outputs.values().next().value;
20 21
21 // Note on(off). 22 // Note on(off).
22 output.send([0xff, 0x90, 0x00, 0x00, 0x90, 0x07, 0x00]); 23 output.send([0xff, 0x90, 0x00, 0x00, 0x90, 0x07, 0x00]);
23 24
24 // Running status is not allowed in Web MIDI API. 25 // Running status is not allowed in Web MIDI API.
25 shouldThrow('output.send([0x00, 0x01])'); 26 shouldThrow('output.send([0x00, 0x01])');
26 27
27 // Unexpected End of Sysex. 28 // Unexpected End of Sysex.
28 shouldThrow('output.send([0xf7])'); 29 shouldThrow('output.send([0xf7])');
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 shouldThrow('output.send([0x80, 0x00, 0x00, 0xf4])'); 92 shouldThrow('output.send([0x80, 0x00, 0x00, 0xf4])');
92 shouldThrow('output.send([0xf0, 0xff, 0xf4, 0xf7])'); 93 shouldThrow('output.send([0xf0, 0xff, 0xf4, 0xf7])');
93 94
94 // Invalid timestamps. 95 // Invalid timestamps.
95 shouldThrow('output.send([], NaN)'); 96 shouldThrow('output.send([], NaN)');
96 shouldThrow('output.send([], Infinity)'); 97 shouldThrow('output.send([], Infinity)');
97 shouldThrow('output.send(new Uint8Array(), NaN)'); 98 shouldThrow('output.send(new Uint8Array(), NaN)');
98 shouldThrow('output.send(new Uint8Array(), Infinity)'); 99 shouldThrow('output.send(new Uint8Array(), Infinity)');
99 100
100 finishJSTest(); 101 finishJSTest();
101 }, function () { 102 }).catch(function () {
102 testFailed("requestMIDIAccess() return an error."); 103 testFailed("requestMIDIAccess() return an error.");
103 }); 104 });
104 105
105 </script> 106 </script>
106 </body> 107 </body>
107 </html> 108 </html>
OLDNEW
« no previous file with comments | « LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698