Index: LayoutTests/http/tests/serviceworker/registration.html |
diff --git a/LayoutTests/http/tests/serviceworker/registration.html b/LayoutTests/http/tests/serviceworker/registration.html |
index 7219e79c3af8faa72d0e956fb8d4a2ca11fd2b27..42289fa80e6d74ca844b9c7651c4bbd43baff5ba 100644 |
--- a/LayoutTests/http/tests/serviceworker/registration.html |
+++ b/LayoutTests/http/tests/serviceworker/registration.html |
@@ -121,11 +121,67 @@ promise_test(function(t) { |
promise_test(function(t) { |
var script = 'resources/redirect.php?Redirect=' + |
encodeURIComponent('/resources/registration-worker.js'); |
- var scope = 'resources/sope/redirect/'; |
+ var scope = 'resources/scope/redirect/'; |
return assert_promise_rejects( |
navigator.serviceWorker.register(script, {scope: scope}), |
'SecurityError', |
'Registration of redirected script should fail.'); |
}, 'Registering redirected script'); |
+promise_test(function(t) { |
+ var script = 'resources/malformed-worker.php?parse-error'; |
+ var scope = 'resources/scope/parse-error'; |
+ return assert_promise_rejects( |
+ navigator.serviceWorker.register(script, {scope: scope}), |
+ 'AbortError', |
+ 'Registration of script including parse error should fail.'); |
+ }, 'Registering script including parse error'); |
+ |
+promise_test(function(t) { |
+ var script = 'resources/malformed-worker.php?undefined-error'; |
+ var scope = 'resources/scope/undefined-error'; |
+ return assert_promise_rejects( |
+ navigator.serviceWorker.register(script, {scope: scope}), |
+ 'AbortError', |
+ 'Registration of script including undefined error should fail.'); |
+ }, 'Registering script including undefined error'); |
+ |
+promise_test(function(t) { |
+ var script = 'resources/malformed-worker.php?uncaught-exception'; |
+ var scope = 'resources/scope/uncaught-exception'; |
+ return assert_promise_rejects( |
+ navigator.serviceWorker.register(script, {scope: scope}), |
+ 'AbortError', |
+ 'Registration of script including uncaught exception should fail.'); |
+ }, 'Registering script including uncaught exception'); |
+ |
+promise_test(function(t) { |
+ var script = 'resources/malformed-worker.php?caught-exception'; |
+ var scope = 'resources/scope/caught-exception'; |
+ return navigator.serviceWorker.register(script, {scope: scope}) |
+ .then(function(registration) { |
+ assert_true(registration instanceof ServiceWorkerRegistration, |
+ 'Successfully registered.'); |
+ service_worker_unregister_and_done(t, scope); |
+ }) |
+ }, 'Registering script including caught exception'); |
+ |
+promise_test(function(t) { |
+ var script = 'resources/malformed-worker.php?import-malformed-script'; |
+ var scope = 'resources/scope/import-malformed-script'; |
+ return assert_promise_rejects( |
+ navigator.serviceWorker.register(script, {scope: scope}), |
+ 'AbortError', |
+ 'Registration of script importing malformed script should fail.'); |
+ }, 'Registering script importing malformed script'); |
+ |
+promise_test(function(t) { |
+ var script = 'resources/malformed-worker.php?import-no-such-script'; |
+ var scope = 'resources/scope/import-no-such-script'; |
+ return assert_promise_rejects( |
+ navigator.serviceWorker.register(script, {scope: scope}), |
+ 'AbortError', |
+ 'Registration of script importing non-existent script should fail.'); |
+ }, 'Registering script importing non-existent script'); |
+ |
</script> |