mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Update web-platform-tests to revision d04a8fc02b85bd32799691759c8c05ead07cd939
This commit is contained in:
parent
e8fdc677f4
commit
2b35c55ac7
63 changed files with 2068 additions and 340 deletions
|
@ -0,0 +1,47 @@
|
|||
<!DOCTYPE html>
|
||||
<title>DedicatedWorker: WorkerOptions 'type'</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
|
||||
promise_test(() => {
|
||||
const worker = new Worker('resources/post-message-on-load-worker.js');
|
||||
return new Promise(resolve => worker.onmessage = resolve)
|
||||
.then(msg_event => assert_equals(msg_event.data, 'LOADED'));
|
||||
}, 'Test worker construction with the default worker type.');
|
||||
|
||||
promise_test(() => {
|
||||
const worker = new Worker('resources/post-message-on-load-worker.js',
|
||||
{ type: 'classic' });
|
||||
return new Promise(resolve => worker.onmessage = resolve)
|
||||
.then(msg_event => assert_equals(msg_event.data, 'LOADED'));
|
||||
}, 'Test worker construction with the "classic" worker type.');
|
||||
|
||||
promise_test(() => {
|
||||
const worker = new Worker('resources/post-message-on-load-worker.js',
|
||||
{ type: 'module' });
|
||||
return new Promise(resolve => worker.onmessage = resolve)
|
||||
.then(msg_event => assert_equals(msg_event.data, 'LOADED'));
|
||||
}, 'Test worker construction with the "module" worker type.');
|
||||
|
||||
test(() => {
|
||||
try {
|
||||
new Worker('resources/post-message-on-load-worker.js', { type: '' });
|
||||
assert_unreached(
|
||||
'Worker construction with an empty type should throw an exception');
|
||||
} catch (e) {
|
||||
assert_equals(e.name, 'TypeError');
|
||||
}
|
||||
}, 'Test worker construction with an empty worker type.');
|
||||
|
||||
test(() => {
|
||||
try {
|
||||
new Worker('resources/post-message-on-load-worker.js', { type: 'unknown' });
|
||||
assert_unreached(
|
||||
'Worker construction with an unknown type should throw an exception');
|
||||
} catch (e) {
|
||||
assert_equals(e.name, 'TypeError');
|
||||
}
|
||||
}, 'Test worker construction with an unknown worker type.');
|
||||
|
||||
</script>
|
|
@ -0,0 +1,21 @@
|
|||
<!DOCTYPE html>
|
||||
<title>DedicatedWorker: static import</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
|
||||
promise_test(() => {
|
||||
const worker = new Worker('resources/static-import-worker.js',
|
||||
{ type: 'module' });
|
||||
return new Promise(resolve => worker.onmessage = resolve)
|
||||
.then(msg_event => assert_equals(msg_event.data, 'LOADED'));
|
||||
}, 'Test static import on DedicatedWorkerGlobalScope.');
|
||||
|
||||
promise_test(() => {
|
||||
const worker = new Worker('resources/nested-static-import-worker.js',
|
||||
{ type: 'module' });
|
||||
return new Promise(resolve => worker.onmessage = resolve)
|
||||
.then(msg_event => assert_equals(msg_event.data, 'LOADED'));
|
||||
}, 'Test nested static import on DedicatedWorkerGlobalScope.');
|
||||
|
||||
</script>
|
|
@ -0,0 +1 @@
|
|||
import './static-import-worker.js';
|
|
@ -0,0 +1 @@
|
|||
postMessage('LOADED');
|
|
@ -0,0 +1 @@
|
|||
import './post-message-on-load-worker.js';
|
Loading…
Add table
Add a link
Reference in a new issue