1
0
Fork 0
firefox/testing/web-platform/tests/webhid/resources/hid-disabled-by-permissions-policy-worker.js
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

17 lines
465 B
JavaScript

'use strict';
importScripts('/resources/testharness.js');
const header = 'Permissions-Policy header hid=()';
let workerType;
if (typeof postMessage === 'function') {
workerType = 'dedicated';
}
promise_test(() => navigator.hid.getDevices().then(
() => assert_unreached('expected promise to reject with SecurityError'),
error => assert_equals(error.name, 'SecurityError')),
`Inherited ${header} disallows ${workerType} workers.`);
done();