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

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

Issue 1260003003: Move Service Worker %2f validation logic from browser into Blink (2) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: More validation back into Blink. Created 5 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: LayoutTests/http/tests/serviceworker/registration.html
diff --git a/LayoutTests/http/tests/serviceworker/registration.html b/LayoutTests/http/tests/serviceworker/registration.html
index c5ceace35b0b774d0325178d088a73cd5d29c32c..7c03bba4201014dd8bef779fc4abf8cf602e3459 100644
--- a/LayoutTests/http/tests/serviceworker/registration.html
+++ b/LayoutTests/http/tests/serviceworker/registration.html
@@ -228,16 +228,25 @@ promise_test(function(t) {
var scope = 'resources/scope/encoded-slash-in-script-url';
return assert_promise_rejects(
navigator.serviceWorker.register(script, {scope: scope}),
- 'SecurityError',
+ new TypeError,
nhiroki 2015/07/31 07:43:30 Just passing a string 'TypeError' doesn't work?
'URL-encoded slash in the script URL should be rejected.');
}, 'Script URL including URL-encoded slash');
promise_test(function(t) {
+ var script = 'resources%2Fempty-worker.js';
+ var scope = 'resources/scope/encoded-slash-in-script-url';
+ return assert_promise_rejects(
+ navigator.serviceWorker.register(script, {scope: scope}),
+ new TypeError,
+ 'URL-encoded slash in the script URL should be rejected.');
+ }, 'Script URL including uppercase URL-encoded slash');
+
+promise_test(function(t) {
var script = 'resources/empty-worker.js';
var scope = 'resources/scope%2fencoded-slash-in-scope';
return assert_promise_rejects(
navigator.serviceWorker.register(script, {scope: scope}),
- 'SecurityError',
+ new TypeError,
'URL-encoded slash in the scope should be rejected.');
}, 'Scope including URL-encoded slash');
@@ -246,16 +255,25 @@ promise_test(function(t) {
var scope = 'resources/scope/encoded-slash-in-script-url';
return assert_promise_rejects(
navigator.serviceWorker.register(script, {scope: scope}),
- 'SecurityError',
+ new TypeError,
'URL-encoded backslash in the script URL should be rejected.');
}, 'Script URL including URL-encoded backslash');
promise_test(function(t) {
+ var script = 'resources%5Cempty-worker.js';
+ var scope = 'resources/scope/encoded-slash-in-script-url';
+ return assert_promise_rejects(
+ navigator.serviceWorker.register(script, {scope: scope}),
+ new TypeError,
+ 'URL-encoded backslash in the script URL should be rejected.');
+ }, 'Script URL including uppercase URL-encoded backslash');
+
+promise_test(function(t) {
var script = 'resources/empty-worker.js';
var scope = 'resources/scope%5cencoded-slash-in-scope';
return assert_promise_rejects(
navigator.serviceWorker.register(script, {scope: scope}),
- 'SecurityError',
+ new TypeError,
'URL-encoded backslash in the scope should be rejected.');
}, 'Scope including URL-encoded backslash');

Powered by Google App Engine
This is Rietveld 408576698