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

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: add 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 calls are using a mock implementation of the backend.
Takashi Toyoshima 2015/06/02 02:40:37 Can you do s/the Permission API/the Permission API
15 // However, the test can be used in different context.
16 if (window.location.origin != get_host_info().UNAUTHENTICATED_ORIGIN) {
17 window.location = get_host_info().UNAUTHENTICATED_ORIGIN + window.location.p athname;
18 } else {
19 async_test(function() {
20 navigator.requestMIDIAccess({sysex:true}).then(this.step_func(function() {
21 assert_unreached('requesting midi access should fail');
22 this.done();
23 })).catch(this.step_func(function(e) {
24 assert_equals(e.name, 'SecurityError')
25 return navigator.permissions.query({name:'midi', sysex:true});
26 })).then(this.step_func(function(p) {
27 assert_equals(p.status, "denied");
28 this.done();
29 }));
30 }, 'requesting midi access and querying them should both return deny.');
31 }
32 </script>
33 </body>
34 </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