blob: 59349560ad197538e569c4dca7c46504ff2567bf [file] [log] [blame]
'use strict';
importScripts('/resources/testharness.js');
const header = 'Feature-Policy header {"usb" : []}';
let workerType;
if (typeof postMessage === 'function') {
workerType = 'dedicated';
}
promise_test(() => navigator.usb.getDevices().then(
() => assert_unreached('expected promise to reject with SecurityError'),
error => assert_equals(error.name, 'SecurityError')),
`Inherited ${header} disallows ${workerType} workers.`);
done();