mirror of
https://github.com/servo/servo.git
synced 2025-07-11 17:33:47 +01:00
17 lines
471 B
JavaScript
17 lines
471 B
JavaScript
'use strict';
|
|
|
|
importScripts('/resources/testharness.js');
|
|
|
|
const header = 'Feature-Policy header {"serial" : []}';
|
|
let workerType;
|
|
|
|
if (typeof postMessage === 'function') {
|
|
workerType = 'dedicated';
|
|
}
|
|
|
|
promise_test(() => navigator.serial.getPorts().then(
|
|
() => assert_unreached('expected promise to reject with SecurityError'),
|
|
error => assert_equals(error.name, 'SecurityError')),
|
|
`Inherited ${header} disallows ${workerType} workers.`);
|
|
|
|
done();
|