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

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: 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';
falken 2014/11/12 09:04:41 Doesn't this need to be a "file:///" URL? But then
falken 2014/11/12 09:07:03 Please disregard.
8 navigator.serviceWorker.register(script, { scope: script })
9 .then(function() {
10 assert_unreached('A returned promise should be rejected');
falken 2014/11/12 09:04:41 More grammatical is "The returned promise should b
nhiroki 2014/11/12 09:42:09 Done.
11 }, function(e) {
falken 2014/11/12 09:04:41 Maybe we should assert on the error message conten
falken 2014/11/12 09:07:03 I still think this may be a good idea, WDYT?
nhiroki 2014/11/12 09:42:09 +1! Added the check.
falken 2014/11/13 08:27:55 Ah, sorry. I just realized this was bad advice sin
12 assert_throws(
13 'SecurityError', function() { throw e; },
14 'Calling register() on local file should fail');
15 t.done();
16 })
17 .catch(t.step_func(function(e) {
18 assert_unreached(e);
19 t.done();
20 }));
21 }, 'Calling register() on local file');
22
23 async_test(function(t) {
24 navigator.serviceWorker.getRegistration()
25 .then(function() {
26 assert_unreached('A returned promise should be rejected')
27 }, function(e) {
28 assert_throws(
29 'SecurityError', function() { throw e; },
30 'Calling getRegistration() on local file should fail');
31 t.done();
32 })
33 .catch(t.step_func(function(e) {
34 assert_unreached(e);
35 t.done();
36 }));
37 }, 'Calling getRegistration() on local file');
38
39 </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