Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Unified Diff: LayoutTests/http/tests/serviceworker/registration.html

Issue 697833004: ServiceWorker: Registering a malformed script should fail [3/3] (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@install_malformed_script
Patch Set: s/importScript/importScripts/ Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/http/tests/serviceworker/resources/import-malformed-script.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..aa2566020433db1b26883157b3578e1943e51308 100644
--- a/LayoutTests/http/tests/serviceworker/registration.html
+++ b/LayoutTests/http/tests/serviceworker/registration.html
@@ -92,6 +92,15 @@ promise_test(function(t) {
}, 'Registering non-existent script');
promise_test(function(t) {
+ var script = 'resources/import-no-such-script.js';
falken 2014/11/04 05:47:55 We've been naming service worker scripts as "*-wor
nhiroki 2014/11/04 08:56:21 Done.
+ 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');
+
+promise_test(function(t) {
var script = 'resources/invalid-chunked-encoding.php';
var scope = 'resources/scope/invalid-chunked-encoding/';
return assert_promise_rejects(
@@ -121,11 +130,29 @@ 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-script.js';
+ var scope = 'resources/registration/malformed-worker';
falken 2014/11/04 05:47:55 Be consistent with the other scopes in this file:
nhiroki 2014/11/04 08:56:21 Done.
+ return assert_promise_rejects(
+ navigator.serviceWorker.register(script, {scope: scope}),
+ 'AbortError',
+ 'Registration of malformed script should fail.');
+ }, 'Registering malformed script');
+
+promise_test(function(t) {
+ var script = 'resources/import-malformed-script.js';
+ var scope = 'resources/registration/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');
+
</script>
« no previous file with comments | « no previous file | LayoutTests/http/tests/serviceworker/resources/import-malformed-script.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698