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

Side by Side Diff: LayoutTests/http/tests/serviceworker/current-on-load.html

Issue 263903005: Fork of https://codereview.chromium.org/265943003 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/http/tests/serviceworker/current-on-load-expected.txt » ('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 <title>Service Worker: Current on load</title>
3 <script src="../resources/testharness.js"></script>
4 <script src="../resources/testharnessreport.js"></script>
5 <script src="resources/test-helpers.js"></script>
6 <script src="resources/testutils.js"></script>
7 <body>
8 <script>
9 var t = async_test('current is set for a controlled document');
10 t.step(function() {
11 var scope = 'resources/blank.html'
12 navigator.serviceWorker.unregister(scope).then(
13 doTest,
14 unreached_rejection(t, 'Unregister should not fail')
15 );
16
17 function doTest() {
18 navigator.serviceWorker.register(
19 'resources/worker-no-op.js', {scope: scope}
20 ).then(
21 onRegister,
22 unreached_rejection(t, 'Registration should succeed, but failed')
23 );
24 }
25
26 function onRegister(worker) {
27 worker.addEventListener('statechange', t.step_func(function(event) {
28 if (event.target.state == 'active')
29 onActive();
30 }));
31 }
32
33 function onActive() {
34 withIframe(scope, t.step_func(function(frame) {
35 var w = frame.contentWindow;
36 assert_true(w.navigator.serviceWorker.current instanceof w.ServiceWo rker,
37 'current should be a ServiceWorker object');
38 t.done();
39 }));
40 }
41 });
42 </script>
43 </body>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/http/tests/serviceworker/current-on-load-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698