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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/webusb/usb-allowed-by-feature-policy-attribute.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-allowed-by-feature-policy-attribute.https.sub.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/webusb/usb-allowed-by-feature-policy-attribute.https.sub.html b/third_party/WebKit/LayoutTests/external/wpt/webusb/usb-allowed-by-feature-policy-attribute.https.sub.html
new file mode 100644
index 0000000000000000000000000000000000000000..302e7f4a565092c477bddef7735bcc9a881b163c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/webusb/usb-allowed-by-feature-policy-attribute.https.sub.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<body>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<script>
+'use strict';
+
+async_test(t => {
+ let frame = document.createElement('iframe');
+ frame.src = 'https://{{domains[www]}}:{{ports[https][0]}}/webusb/resources/check-availability.html';
+ frame.allow = 'usb';
+
+ window.addEventListener('message', t.step_func(evt => {
+ if (evt.source == frame.contentWindow) {
+ assert_equals(evt.data, '#OK');
+ document.body.removeChild(frame);
+ t.done();
+ }
+ }));
+
+ document.body.appendChild(frame);
+}, 'Feature policy "usb" can be enabled in cross-origin iframes using "allowed" attribute.');
+</script>
+</body>

Powered by Google App Engine
This is Rietveld 408576698