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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/webusb/usb-default-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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/external/wpt/webusb/usb-default-feature-policy.https.sub.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/webusb/usb-default-feature-policy.https.sub.html b/third_party/WebKit/LayoutTests/external/wpt/webusb/usb-default-feature-policy.https.sub.html
new file mode 100644
index 0000000000000000000000000000000000000000..157981591c4b727f406bc3e75ce50dc1c959bfa5
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/webusb/usb-default-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(),
+ 'Default "usb" feature policy ["self"] allows the top-level document.');
+
+async_test(t => {
+ assert_usb_available_in_iframe(t, '', '#OK');
+}, 'Default "usb" feature policy ["self"] allows same-origin iframes.');
+
+async_test(t => {
+ assert_usb_available_in_iframe(t, 'https://{{domains[www]}}:{{ports[https][0]}}', '#SecurityError');
+}, 'Default "usb" feature policy ["self"] disallows cross-origin iframes.');
+</script>
+</body>

Powered by Google App Engine
This is Rietveld 408576698