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

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

Issue 2116763002: Reland: Web MIDI: use mojom::blink::PermissionService directly to ask permission (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: for second attempt Created 4 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
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="../http/tests/resources/permissions-helper.js"></script> 5 <script src="../http/tests/resources/permissions-helper.js"></script>
6 </head> 6 </head>
7 <body> 7 <body>
8 <script> 8 <script>
9 9
10 description("Test if various kinds of MIDI messages can be validated."); 10 description("Test if various kinds of MIDI messages can be validated.");
11 11
12 shouldBeDefined("navigator.requestMIDIAccess"); 12 shouldBeDefined("navigator.requestMIDIAccess");
13 13
14 window.jsTestIsAsync = true; 14 window.jsTestIsAsync = true;
15 15
16 PermissionsHelper.setPermission('midi-sysex', 'granted').then(function() { 16 Promise.all([PermissionsHelper.setPermission('midi', 'granted'),
17 PermissionsHelper.setPermission('midi-sysex', 'granted')]).then(fun ction() {
17 return navigator.requestMIDIAccess({sysex: true}); 18 return navigator.requestMIDIAccess({sysex: true});
18 }).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
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 100
100 finishJSTest(); 101 finishJSTest();
101 }).catch(function () { 102 }).catch(function () {
102 testFailed("requestMIDIAccess() return an error."); 103 testFailed("requestMIDIAccess() return an error.");
103 finishJSTest(); 104 finishJSTest();
104 }); 105 });
105 106
106 </script> 107 </script>
107 </body> 108 </body>
108 </html> 109 </html>
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/webmidi/permission.html ('k') | third_party/WebKit/Source/modules/modules.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698