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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/registration-tests.js

Issue 2059953003: service worker: Fix the type of a register promise reject value (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Use ServiceWorkerErrorForUpdate directly Created 4 years, 5 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: third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/registration-tests.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/registration-tests.js b/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/registration-tests.js
index 18ba45c80bb349c6779b82bc2979c48216a3a82d..60ec9cdfba4d8a375f263e471b49b30fe7aebc70 100644
--- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/registration-tests.js
+++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/registration-tests.js
@@ -96,7 +96,7 @@ function registration_tests(register_method, check_error_types) {
var script = 'resources/no-such-worker.js';
var scope = 'resources/scope/no-such-worker';
return promise_rejects(t,
- check_error_types ? 'NetworkError' : null,
+ check_error_types ? new TypeError : null,
register_method(script, {scope: scope}),
navigator.serviceWorker.register(script, {scope: scope}),
'Registration of non-existent script should fail.');
@@ -106,7 +106,7 @@ function registration_tests(register_method, check_error_types) {
var script = 'resources/invalid-chunked-encoding.php';
var scope = 'resources/scope/invalid-chunked-encoding/';
return promise_rejects(t,
- check_error_types ? 'NetworkError' : null,
+ check_error_types ? new TypeError : null,
register_method(script, {scope: scope}),
'Registration of invalid chunked encoding script should fail.');
}, 'Registering invalid chunked encoding script');
@@ -115,7 +115,7 @@ function registration_tests(register_method, check_error_types) {
var script = 'resources/invalid-chunked-encoding-with-flush.php';
var scope = 'resources/scope/invalid-chunked-encoding-with-flush/';
return promise_rejects(t,
- check_error_types ? 'NetworkError' : null,
+ check_error_types ? new TypeError : null,
register_method(script, {scope: scope}),
'Registration of invalid chunked encoding script should fail.');
}, 'Registering invalid chunked encoding script with flush');
@@ -152,7 +152,7 @@ function registration_tests(register_method, check_error_types) {
var script = 'resources/malformed-worker.php?parse-error';
var scope = 'resources/scope/parse-error';
return promise_rejects(t,
- check_error_types ? 'AbortError' : null,
+ check_error_types ? new TypeError : null,
register_method(script, {scope: scope}),
'Registration of script including parse error should fail.');
}, 'Registering script including parse error');
@@ -161,7 +161,7 @@ function registration_tests(register_method, check_error_types) {
var script = 'resources/malformed-worker.php?undefined-error';
var scope = 'resources/scope/undefined-error';
return promise_rejects(t,
- check_error_types ? 'AbortError' : null,
+ check_error_types ? new TypeError : null,
register_method(script, {scope: scope}),
'Registration of script including undefined error should fail.');
}, 'Registering script including undefined error');
@@ -170,7 +170,7 @@ function registration_tests(register_method, check_error_types) {
var script = 'resources/malformed-worker.php?uncaught-exception';
var scope = 'resources/scope/uncaught-exception';
return promise_rejects(t,
- check_error_types ? 'AbortError' : null,
+ check_error_types ? new TypeError : null,
register_method(script, {scope: scope}),
'Registration of script including uncaught exception should fail.');
}, 'Registering script including uncaught exception');
@@ -191,7 +191,7 @@ function registration_tests(register_method, check_error_types) {
var script = 'resources/malformed-worker.php?import-malformed-script';
var scope = 'resources/scope/import-malformed-script';
return promise_rejects(t,
- check_error_types ? 'AbortError' : null,
+ check_error_types ? new TypeError : null,
register_method(script, {scope: scope}),
'Registration of script importing malformed script should fail.');
}, 'Registering script importing malformed script');
@@ -200,7 +200,7 @@ function registration_tests(register_method, check_error_types) {
var script = 'resources/malformed-worker.php?import-no-such-script';
var scope = 'resources/scope/import-no-such-script';
return promise_rejects(t,
- check_error_types ? 'AbortError' : null,
+ check_error_types ? new TypeError : null,
register_method(script, {scope: scope}),
'Registration of script importing non-existent script should fail.');
}, 'Registering script importing non-existent script');

Powered by Google App Engine
This is Rietveld 408576698