mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Update web-platform-tests to revision 0ed072539aa45d3a5a67c9164b243d27873f257c
This commit is contained in:
parent
0954871992
commit
e613cfd108
76 changed files with 1109 additions and 703 deletions
|
@ -0,0 +1,29 @@
|
|||
<!doctype html>
|
||||
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
|
||||
<script>
|
||||
promise_test(async (test) => {
|
||||
const reg = await navigator.serviceWorker.register('./serviceworker.js', { type: 'module' });
|
||||
test.add_cleanup(() => reg.unregister());
|
||||
assert_not_equals(reg.installing, undefined);
|
||||
}, "Javascript importing JSON Module should load within the context of a service worker");
|
||||
|
||||
promise_test(async (test) => {
|
||||
const reg = await navigator.serviceWorker.register('./module.json', { type: 'module' });
|
||||
test.add_cleanup(() => reg.unregister());
|
||||
assert_not_equals(reg.installing, undefined);
|
||||
}, "JSON Modules should load within the context of a service worker");
|
||||
|
||||
promise_test(async (test) => {
|
||||
const reg = await navigator.serviceWorker.register('./serviceworker-dynamic-import.js', { type: 'module' });
|
||||
test.add_cleanup(() => reg.unregister());
|
||||
assert_not_equals(reg.installing, undefined);
|
||||
reg.installing.postMessage("PING");
|
||||
const msgEvent = await new Promise(resolve => {
|
||||
navigator.serviceWorker.onmessage = resolve;
|
||||
});
|
||||
assert_equals(msgEvent.data, "FAILED");
|
||||
}, "JSON Module dynamic import should not load within the context of a service worker");
|
||||
</script>
|
|
@ -0,0 +1,5 @@
|
|||
onmessage = e => {
|
||||
e.waitUntil(import("./module.json")
|
||||
.then(module => e.source.postMessage("LOADED"))
|
||||
.catch(error => e.source.postMessage("FAILED")));
|
||||
};
|
|
@ -0,0 +1 @@
|
|||
import './module.json';
|
Loading…
Add table
Add a link
Reference in a new issue