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

Side by Side Diff: LayoutTests/http/tests/permissions/test-midi-sysex-insecure-origin.html

Issue 1155823002: Tests that Permissions API and requestMidiAccess() are consistent. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: review comments Created 5 years, 6 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 | « no previous file | 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
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>Permissions API: test midi sysex on insecure origins.</title>
5 <script src='../resources/testharness.js'></script>
6 <script src='../resources/testharnessreport.js'></script>
7 <script src='../resources/get-host-info.js'></script>
8 </head>
9 <body>
10 <script>
11 // Midi SysEx is not available on insecure origins. This is testing that the
12 // Permissions API matches navigator.requestMIDIAccess() behaviour.
13 // In the context of Chromium's LayoutTests, this test is a dummy test because
14 // the Permissions API and requestMIDIAccess calls are using a mock
15 // implementation of the backend. However, the test can be used in different
16 // context.
17 if (window.location.origin != get_host_info().UNAUTHENTICATED_ORIGIN) {
18 window.location = get_host_info().UNAUTHENTICATED_ORIGIN + window.location.p athname;
19 } else {
20 async_test(function() {
21 navigator.requestMIDIAccess({sysex:true}).then(this.step_func(function() {
22 assert_unreached('requesting midi access should fail');
23 this.done();
24 })).catch(this.step_func(function(e) {
25 assert_equals(e.name, 'SecurityError')
26 return navigator.permissions.query({name:'midi', sysex:true});
27 })).then(this.step_func(function(p) {
28 assert_equals(p.status, "denied");
29 this.done();
30 }));
31 }, 'requesting midi access and querying them should both return deny.');
32 }
33 </script>
34 </body>
35 </html>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698