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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/controller-on-reload.html

Issue 2778223003: Upstream service worker `controller` tests to WPT (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/serviceworker/controller-on-load.html ('k') | no next file » | 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: Controller on reload</title>
3 <script src="../resources/testharness.js"></script>
4 <script src="../resources/testharnessreport.js"></script>
5 <script src="resources/test-helpers.js"></script>
6 <body>
7 <script>
8 promise_test(function(t) {
9 var scope = 'resources/blank.html';
10 var frame;
11 return service_worker_unregister(t, scope)
12 .then(function() {
13 return with_iframe(scope);
14 })
15 .then(function(f) {
16 frame = f;
17 return frame.contentWindow.navigator.serviceWorker.register(
18 'empty-worker.js', {scope: 'blank.html'});
19 })
20 .then(function(registration) {
21 return wait_for_state(t, registration.installing, 'activated');
22 })
23 .then(function() {
24 var w = frame.contentWindow;
25 assert_equals(w.navigator.serviceWorker.controller, null,
26 'controller should be null until the document is ' +
27 'reloaded');
28 return new Promise(function(resolve) {
29 frame.onload = function() { resolve(); }
30 w.location.reload();
31 });
32 })
33 .then(function() {
34 var w = frame.contentWindow;
35 assert_true(
36 w.navigator.serviceWorker.controller instanceof w.ServiceWorker,
37 'controller should be a ServiceWorker object upon reload');
38 frame.remove();
39 service_worker_unregister_and_done(t, scope);
40 });
41 }, 'controller is set upon reload after registration');
42 </script>
43 </body>
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/serviceworker/controller-on-load.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698