Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/external/wpt/webusb/usb-disabled-by-feature-policy.https.sub.html |
| diff --git a/third_party/WebKit/LayoutTests/external/wpt/webusb/usb-disabled-by-feature-policy.https.sub.html b/third_party/WebKit/LayoutTests/external/wpt/webusb/usb-disabled-by-feature-policy.https.sub.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8192d6fcd20fbd53c3a2c549535355ec1b53f2f3 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/external/wpt/webusb/usb-disabled-by-feature-policy.https.sub.html |
| @@ -0,0 +1,25 @@ |
| +<!DOCTYPE html> |
| +<body> |
| +<script src=/resources/testharness.js></script> |
| +<script src=/resources/testharnessreport.js></script> |
| +<script src=resources/featurepolicytest.js></script> |
| +<script> |
| +'use strict'; |
| + |
| +promise_test(() => { |
| + return navigator.usb.getDevices().then(() => { |
| + assert_unreached('expected promise to reject with SecurityError'); |
| + }, error => { |
| + assert_equals(error.name, 'SecurityError'); |
| + }); |
| +}, 'Feature-Policy header {"usb": []} disallows the top-level document.'); |
| + |
| +async_test(t => { |
| + assert_usb_available_in_iframe(t, '', '#SecurityError'); |
| +}, 'Feature-Policy header {"usb": []} disallows same-origin iframes.'); |
| + |
| +async_test(t => { |
| + assert_usb_available_in_iframe(t, 'https://{{domains[www]}}:{{ports[https][0]}}', '#SecurityError'); |
| +}, 'Fea-Policy header {"usb": []} disallows cross-origin iframes.'); |
|
iclelland
2017/05/04 15:24:08
nit: typo
Reilly Grant (use Gerrit)
2017/05/04 20:34:46
Done.
|
| +</script> |
| +</body> |