mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Update web-platform-tests to revision 45d92ebc552d67936169a17e86980636b112bf18
This commit is contained in:
parent
97c12bd392
commit
ba1004338e
33 changed files with 1160 additions and 968 deletions
|
@ -0,0 +1,23 @@
|
|||
<!DOCTYPE html>
|
||||
<title>DedicatedWorker: import.meta</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
|
||||
promise_test(() => {
|
||||
const script_url = 'resources/import-meta-url-worker.js';
|
||||
const worker = new Worker(script_url, { type: 'module' });
|
||||
return new Promise(resolve => worker.onmessage = resolve)
|
||||
.then(msg_event => assert_true(msg_event.data.endsWith(script_url)));
|
||||
}, 'Test import.meta.url on the top-level module script.');
|
||||
|
||||
promise_test(() => {
|
||||
const script_url = 'import-meta-url-worker.js';
|
||||
const worker = new Worker('resources/dynamic-import-given-url-worker.js',
|
||||
{ type: 'module' });
|
||||
worker.postMessage('./' + script_url);
|
||||
return new Promise(resolve => worker.onmessage = resolve)
|
||||
.then(msg_event => assert_true(msg_event.data.endsWith(script_url)));
|
||||
}, 'Test import.meta.url on the imported module script.');
|
||||
|
||||
</script>
|
|
@ -0,0 +1,4 @@
|
|||
// Dynamically import the script URL sent by postMessage().
|
||||
self.addEventListener('message', e => {
|
||||
import(e.data);
|
||||
});
|
|
@ -0,0 +1 @@
|
|||
postMessage(import.meta.url);
|
Loading…
Add table
Add a link
Reference in a new issue