Index: third_party/WebKit/LayoutTests/external/wpt/webusb/usb-allowed-by-feature-policy.https.sub.html |
diff --git a/third_party/WebKit/LayoutTests/external/wpt/webusb/usb-allowed-by-feature-policy.https.sub.html b/third_party/WebKit/LayoutTests/external/wpt/webusb/usb-allowed-by-feature-policy.https.sub.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..288a3acc71dc0824571a24f58b873a44c251e11b |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/external/wpt/webusb/usb-allowed-by-feature-policy.https.sub.html |
@@ -0,0 +1,21 @@ |
+<!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( |
+ () => navigator.usb.getDevices(), |
+ 'Feature-Policy header {"usb": ["*"]} allows the top-level document.'); |
+ |
+async_test(t => { |
+ assert_usb_available_in_iframe(t, '', '#OK'); |
+}, 'Feature-Policy header {"usb": ["*"]} allows same-origin iframes.'); |
+ |
+async_test(t => { |
+ assert_usb_available_in_iframe(t, 'https://{{domains[www]}}:{{ports[https][0]}}', '#OK'); |
+}, 'Feature-Policy header {"usb": ["*"]} allows cross-origin iframes.'); |
+</script> |
+</body> |