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

Side by Side Diff: LayoutTests/webmidi/requestmidiaccess.html

Issue 207583005: Revert of Make WebMIDI use blink Promise. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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
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 </head> 5 </head>
6 <body> 6 <body>
7 <script> 7 <script>
8 description("Tests navigator.requestMIDIAccess."); 8 description("Tests navigator.requestMIDIAccess.");
9 9
10 var access; 10 var access;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 output.send([0x90, 0x45, 0x7f], performance.now()); 54 output.send([0x90, 0x45, 0x7f], performance.now());
55 testPassed("a note on message is sent with timestamp"); 55 testPassed("a note on message is sent with timestamp");
56 56
57 // Test sending of invalid MIDI data. 57 // Test sending of invalid MIDI data.
58 shouldThrow('output.send([0xfff, 0x45, 0x7f])'); 58 shouldThrow('output.send([0xfff, 0x45, 0x7f])');
59 59
60 // Test sending system exclusive messages. These should throw, since we don' t have sysex access. 60 // Test sending system exclusive messages. These should throw, since we don' t have sysex access.
61 shouldThrow('output.send([0xf0, 0x45, 0xf7])'); 61 shouldThrow('output.send([0xf0, 0x45, 0xf7])');
62 62
63 // Now test System Exclusive access - our test mock should not allow this ty pe of access. 63 // Now test System Exclusive access - our test mock should not allow this ty pe of access.
64 navigator.requestMIDIAccess({sysex: true}).then(successCallback2, errorCallb ack2); 64 shouldNotThrow("navigator.requestMIDIAccess({sysex: true}).then(successCallb ack2, errorCallback2)");
65 } 65 }
66 66
67 function errorCallback1(error) { 67 function errorCallback1(error) {
68 testFailed("requestMIDIAccess() error callback should not be called when req uesting basic access."); 68 testFailed("requestMIDIAccess() error callback should not be called when req uesting basic access.");
69 finishJSTest(); 69 finishJSTest();
70 } 70 }
71 71
72 function successCallback2(access) { 72 function successCallback2(access) {
73 testFailed("requestMIDIAccess() was not correctly blocked for System Exclusi ve access."); 73 testFailed("requestMIDIAccess() was not correctly blocked for System Exclusi ve access.");
74 finishJSTest(); 74 finishJSTest();
75 } 75 }
76 76
77 function errorCallback2(error) { 77 function errorCallback2(error) {
78 testPassed("requestMIDIAccess() was correctly blocked for System Exclusive a ccess with error " + error + "."); 78 testPassed("requestMIDIAccess() was correctly blocked for System Exclusive a ccess with error " + error + ".");
79 finishJSTest(); 79 finishJSTest();
80 } 80 }
81 81
82 window.jsTestIsAsync = true; 82 window.jsTestIsAsync = true;
83 83
84 // Test basic access, with no System Exclusive. 84 // Test basic access, with no System Exclusive.
85 navigator.requestMIDIAccess().then(successCallback1, errorCallback1); 85 shouldNotThrow("navigator.requestMIDIAccess().then(successCallback1, errorCallba ck1)");
86 86
87 </script> 87 </script>
88 </body> 88 </body>
89 </html> 89 </html>
OLDNEW
« no previous file with comments | « LayoutTests/webmidi/permission-expected.txt ('k') | LayoutTests/webmidi/requestmidiaccess-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698