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

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

Issue 1058323004: Service Worker: Add a test for error messages from register() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: line wrap Created 5 years, 8 months 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
Index: LayoutTests/http/tests/serviceworker/registration.html
diff --git a/LayoutTests/http/tests/serviceworker/registration.html b/LayoutTests/http/tests/serviceworker/registration.html
index 054bf01c2aa558949fb4ee077a5ba00889491e1f..c5ceace35b0b774d0325178d088a73cd5d29c32c 100644
--- a/LayoutTests/http/tests/serviceworker/registration.html
+++ b/LayoutTests/http/tests/serviceworker/registration.html
@@ -110,13 +110,22 @@ promise_test(function(t) {
}, 'Registering invalid chunked encoding script with flush');
promise_test(function(t) {
- var script = 'resources/plain-text-worker.php';
- var scope = 'resources/scope/plain-text-worker/';
+ var script = 'resources/mime-type-worker.php';
+ var scope = 'resources/scope/no-mime-type-worker/';
+ return assert_promise_rejects(
+ navigator.serviceWorker.register(script, {scope: scope}),
+ 'SecurityError',
+ 'Registration of no MIME type script should fail.');
+ }, 'Registering script with no MIME type');
+
+promise_test(function(t) {
+ var script = 'resources/mime-type-worker.php?mime=text/plain';
+ var scope = 'resources/scope/bad-mime-type-worker/';
return assert_promise_rejects(
navigator.serviceWorker.register(script, {scope: scope}),
'SecurityError',
'Registration of plain text script should fail.');
- }, 'Registering script without correct MIME type');
+ }, 'Registering script with bad MIME type');
promise_test(function(t) {
var script = 'resources/redirect.php?Redirect=' +

Powered by Google App Engine
This is Rietveld 408576698