serviceworker: make job queue unique per origin

This commit is contained in:
Gregory Terzian 2020-04-25 16:01:28 +08:00
parent 7e74f73301
commit 89eb7c2aa2
19 changed files with 839 additions and 592 deletions

View file

@ -1,7 +1,19 @@
[service-worker-registration.https.html]
[Test: Asserts Installing Service Worker and its Registration]
expected: FAIL
[Test: Installing Service Worker ScriptURL property]
expected: FAIL
[Test: Throws Error when Invalid Scope]
expected: FAIL
[Test: Asserts Active Service Worker and its Registration]
expected: FAIL
[Test: Active Service Worker ScriptURL property]
expected: FAIL
[Test: Asserts ServiceWorkerContainer in Navigator]
expected: FAIL

View file

@ -14298,7 +14298,7 @@
],
"service-workers": {
"service-worker-registration.https.html": [
"949992e45de6858c336936b4f1ea4bca76db1d91",
"04d74fb5c582a3fef8dc589868f0b8c3e402eab2",
[
null,
{}

View file

@ -0,0 +1,6 @@
[service-worker-registration.https.html]
type: testharness
[Test: Asserts Active Service Worker and its Registration]
expected: FAIL
[Test: Active Service Worker ScriptURL property]
expected: FAIL

View file

@ -20,6 +20,12 @@ promise_test(function() {
});
}, "Test: Active Service Worker ScriptURL property");
promise_test(function() {
return register_sw('resources/sw.js').then(function(sw_reg) {
assert_equals(sw_reg.installing.scriptURL, location.href.replace("service-worker-registration.https.html", "resources/sw.js"));
});
}, "Test: Installing Service Worker ScriptURL property");
promise_test(function() {
return register_sw('sw.js').then(function(sw_reg) {
assert_class_string(sw_reg, "ServiceWorkerRegistration");
@ -28,6 +34,13 @@ promise_test(function() {
});
}, "Test: Asserts Active Service Worker and its Registration");
promise_test(function() {
return register_sw('sw.js').then(function(sw_reg) {
assert_class_string(sw_reg, "ServiceWorkerRegistration");
assert_class_string(sw_reg.installing, "ServiceWorker");
});
}, "Test: Asserts Installing Service Worker and its Registration");
promise_test(function() {
return register_sw('resources/sw.js', './').then(function(sw_reg) {
assert_equals(sw_reg.scope, location.href.replace("service-worker-registration.https.html", ""));