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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/webusb/usb-disabled-by-feature-policy.https.sub.html

Issue 2815003005: Integrate WebUSB with Feature Policy (Closed)
Patch Set: Rebased Created 3 years, 7 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
(Empty)
1 <!DOCTYPE html>
2 <body>
3 <script src=/resources/testharness.js></script>
4 <script src=/resources/testharnessreport.js></script>
5 <script src=resources/featurepolicytest.js></script>
6 <script>
7 'use strict';
8
9 promise_test(() => {
10 return navigator.usb.getDevices().then(() => {
11 assert_unreached('expected promise to reject with SecurityError');
12 }, error => {
13 assert_equals(error.name, 'SecurityError');
14 });
15 }, 'Feature-Policy header {"usb": []} disallows the top-level document.');
16
17 async_test(t => {
18 assert_usb_available_in_iframe(t, '', '#SecurityError');
19 }, 'Feature-Policy header {"usb": []} disallows same-origin iframes.');
20
21 async_test(t => {
22 assert_usb_available_in_iframe(t, 'https://{{domains[www]}}:{{ports[https][0]} }', '#SecurityError');
23 }, 'Feature-Policy header {"usb": []} disallows cross-origin iframes.');
24 </script>
25 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698