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

Side by Side Diff: LayoutTests/http/tests/serviceworker/registration-on-insecure-origin.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, 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 unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <title>Register a ServiceWorker On An Insecure Origin</title> 2 <title>Register a ServiceWorker On An Insecure Origin</title>
3 <script src="../resources/testharness.js"></script> 3 <script src="../resources/testharness.js"></script>
4 <script src="../resources/testharnessreport.js"></script> 4 <script src="../resources/testharnessreport.js"></script>
5 <script src="resources/test-helpers.js"></script> 5 <script src="resources/test-helpers.js"></script>
6 <script> 6 <script>
7 if (window.location.origin != get_host_info().UNAUTHENTICATED_ORIGIN) { 7 if (window.location.origin != get_host_info().UNAUTHENTICATED_ORIGIN) {
8 window.location = get_host_info().UNAUTHENTICATED_ORIGIN + window.location.p athname; 8 window.location = get_host_info().UNAUTHENTICATED_ORIGIN + window.location.p athname;
9 } else { 9 } else {
10 async_test(function() { 10 async_test(function() {
11 var scope = '/registration/'; 11 var scope = 'resources/registration/';
12 navigator.serviceWorker.register( 12 navigator.serviceWorker.register(
13 'resources/registration-worker.js', 13 'resources/registration-worker.js',
14 {scope: scope} 14 {scope: scope}
15 ).then( 15 ).then(
16 this.step_func(function() { 16 this.step_func(function() {
17 assert_unreached('Registration should fail, but succeeded.'); 17 assert_unreached('Registration should fail, but succeeded.');
18 service_worker_unregister_and_done(this, scope); 18 service_worker_unregister_and_done(this, scope);
19 }), 19 }),
20 this.step_func(function(reason) { 20 this.step_func(function(reason) {
21 assert_equals(reason.name, "NotSupportedError"); 21 assert_equals(reason.name, "NotSupportedError");
22 this.done(); 22 this.done();
23 }) 23 })
24 ); 24 );
25 }, "Registering on an unauthenticated origin"); 25 }, "Registering on an unauthenticated origin");
26 } 26 }
27 </script> 27 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698