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

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

Issue 674133004: [ServiceWorker] Introduce the directory restriction of ServiceWorker scope [1/3 blink] (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: remove LayoutTests/http/tests/serviceworker/ServiceWorkerGlobalScope/scope-default.html Created 6 years, 2 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 34821c8a84628d4742ec39a124303085b7931630..1430812d3a5a4bde0fd85d2b8eb02af1bfa1c773 100644
--- a/LayoutTests/http/tests/serviceworker/registration.html
+++ b/LayoutTests/http/tests/serviceworker/registration.html
@@ -8,7 +8,7 @@
promise_test(function(t) {
var script = 'resources/registration-worker.js';
- var scope = '/registration/';
+ var scope = 'resources/registration/';
return navigator.serviceWorker.register(script, {scope: scope})
.then(function(registration) {
assert_true(registration instanceof ServiceWorkerRegistration,
@@ -28,40 +28,45 @@ promise_test(function(t) {
promise_test(function(t) {
var script = 'http://example.com/worker.js';
+ var scope = 'http://example.com/scope/';
return assert_promise_rejects(
- navigator.serviceWorker.register(script),
+ navigator.serviceWorker.register(script, {scope: scope}),
'SecurityError',
'Registration script outside domain should fail with SecurityError.');
}, 'Registering script outside domain');
promise_test(function(t) {
- var script = 'no-such-worker.js';
+ var script = 'resources/no-such-worker.js';
+ var scope = 'resources/scope/no-such-worker';
return assert_promise_rejects(
- navigator.serviceWorker.register(script),
+ navigator.serviceWorker.register(script, {scope: scope}),
'NetworkError',
'Registration of non-existent script should fail.');
}, 'Registering 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(
- navigator.serviceWorker.register(script),
+ navigator.serviceWorker.register(script, {scope: scope}),
'NetworkError',
'Registration of invalid chunked encoding script should fail.');
}, 'Registering invalid chunked encoding script');
promise_test(function(t) {
var script = 'resources/invalid-chunked-encoding-with-flush.php';
+ var scope = 'resources/scope/invalid-chunked-encoding-with-flush/';
return assert_promise_rejects(
- navigator.serviceWorker.register(script),
+ navigator.serviceWorker.register(script, {scope: scope}),
'NetworkError',
'Registration of invalid chunked encoding script should fail.');
}, '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/';
return assert_promise_rejects(
- navigator.serviceWorker.register(script),
+ navigator.serviceWorker.register(script, {scope: scope}),
'SecurityError',
'Registration of plain text script should fail.');
}, 'Registering script without correct MIME type');
@@ -69,8 +74,9 @@ promise_test(function(t) {
promise_test(function(t) {
var script = 'resources/redirect.php?Redirect=' +
encodeURIComponent('/resources/registration-worker.js');
+ var scope = 'resources/sope/redirect/';
return assert_promise_rejects(
- navigator.serviceWorker.register(script),
+ navigator.serviceWorker.register(script, {scope: scope}),
'SecurityError',
'Registration of redirected script should fail.');
}, 'Registering redirected script');

Powered by Google App Engine
This is Rietveld 408576698