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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/security/powerfulFeatureRestrictions/serviceworker-on-insecure-origin.html

Issue 1532463003: ServiceWorker: Reject SecurityError instead of NotSupportedError. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/serviceworker/http-to-https-redirect-and-register.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/get-host-info.js"></script> 5 <script src="/resources/get-host-info.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 = 'resources/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, "SecurityError");
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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/serviceworker/http-to-https-redirect-and-register.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698