summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/permissions-policy/resources/permissions-policy-usb.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/permissions-policy/resources/permissions-policy-usb.html')
-rw-r--r--testing/web-platform/tests/permissions-policy/resources/permissions-policy-usb.html9
1 files changed, 9 insertions, 0 deletions
diff --git a/testing/web-platform/tests/permissions-policy/resources/permissions-policy-usb.html b/testing/web-platform/tests/permissions-policy/resources/permissions-policy-usb.html
new file mode 100644
index 0000000000..8812ca7db9
--- /dev/null
+++ b/testing/web-platform/tests/permissions-policy/resources/permissions-policy-usb.html
@@ -0,0 +1,9 @@
+<script>
+'use strict';
+
+Promise.resolve().then(() => navigator.usb.getDevices()).then(devices => {
+ window.parent.postMessage({ type: 'availability-result', enabled: true }, '*');
+}, error => {
+ window.parent.postMessage({ type: 'availability-result', enabled: false }, '*');
+});
+</script>