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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/webusb/resources/featurepolicytest.js

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/resources/featurepolicytest.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/webusb/resources/featurepolicytest.js b/third_party/WebKit/LayoutTests/external/wpt/webusb/resources/featurepolicytest.js
new file mode 100644
index 0000000000000000000000000000000000000000..243242eefbbd0cb759eb7030e9668336ea20aa5a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/webusb/resources/featurepolicytest.js
@@ -0,0 +1,14 @@
+function assert_usb_available_in_iframe(test, origin, expected) {
+ let frame = document.createElement('iframe');
+ frame.src = origin + '/webusb/resources/check-availability.html';
+
+ window.addEventListener('message', test.step_func(evt => {
+ if (evt.source == frame.contentWindow) {
+ assert_equals(evt.data, expected);
+ document.body.removeChild(frame);
+ test.done();
+ }
+ }));
+
+ document.body.appendChild(frame);
+}

Powered by Google App Engine
This is Rietveld 408576698