Initial work on job queues for service workers

This commit is contained in:
Rahul Sharma 2016-10-04 23:57:36 +05:30
parent 6cc1976cca
commit 114c491111
11 changed files with 462 additions and 68 deletions

View file

@ -14,6 +14,12 @@ test(function (){
assert_true('serviceWorker' in navigator);
}, "Test: Asserts ServiceWorkerContainer in Navigator");
promise_test(function() {
return register_sw('resources/sw.js').then(function(sw_reg) {
assert_equals(sw_reg.active.scriptURL, location.href.replace("service-worker-registration.html", "resources/sw.js"));
});
}, "Test: Active Service Worker ScriptURL property");
promise_test(function() {
return register_sw('sw.js').then(function(sw_reg) {
assert_class_string(sw_reg, "ServiceWorkerRegistration");
@ -43,10 +49,4 @@ promise_test(function (p) {
return promise_rejects(p, new TypeError(), register_sw('sw.js', './mal%5fformed/sco%5Cpe/'));
}, "Test: Throws Error when Invalid Scope");
promise_test(function() {
return register_sw('resources/sw.js').then(function(sw_reg) {
assert_equals(sw_reg.active.scriptURL, location.href.replace("service-worker-registration.html", "resources/sw.js"));
});
}, "Test: Active Service Worker ScriptURL property");
</script>