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

Side by Side Diff: LayoutTests/fast/serviceworker/access-container-on-local-file.html

Issue 722583002: ServiceWorker: Abort register() and getRegistration() on non-http(s) page (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@fix_get_registration
Patch Set: fix wrong comment 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
« no previous file with comments | « no previous file | Source/modules/serviceworkers/ServiceWorkerContainer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script>
4 <script>
5
6 async_test(function(t) {
7 var script = 'no-such-worker';
8 navigator.serviceWorker.register(script, { scope: script })
9 .then(function() {
10 assert_unreached('register() should fail');
11 }, function(e) {
12 assert_throws(
13 'SecurityError', function() { throw e; },
14 'register() on local file should fail');
15 assert_equals(
16 e.message,
17 'The URL protocol of the current origin is not supported: file',
18 'register() should fail due to unsupported URL protocol');
19 t.done();
20 })
21 .catch(t.step_func(function(e) {
22 assert_unreached(e);
23 t.done();
24 }));
25 }, 'Calling register() on local file');
26
27 async_test(function(t) {
28 navigator.serviceWorker.getRegistration()
29 .then(function() {
30 assert_unreached('getRegistration() should fail')
31 }, function(e) {
32 assert_throws(
33 'SecurityError', function() { throw e; },
34 'getRegistration() on local file should fail');
35 assert_equals(
36 e.message,
37 'The URL protocol of the current origin is not supported: file',
38 'getRegistration() should fail due to unsupported URL protocol');
39 t.done();
40 })
41 .catch(t.step_func(function(e) {
42 assert_unreached(e);
43 t.done();
44 }));
45 }, 'Calling getRegistration() on local file');
46
47 </script>
OLDNEW
« no previous file with comments | « no previous file | Source/modules/serviceworkers/ServiceWorkerContainer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698