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

Side by Side Diff: LayoutTests/http/tests/serviceworker/chromium/force-refresh-ready.html

Issue 1184923005: ServiceWorker: Add layout test for ready promise resolve after shift-reload. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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 | « no previous file | 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 <!-- This test should not be upstreamed due to shift-reload behavior
3 is not defined by spec. -->
4 <title>Service Worker: force-refresh ready test</title>
5 <script src="../../resources/testharness.js"></script>
6 <script src="../../resources/testharness-helpers.js"></script>
7 <script src="../../resources/testharnessreport.js"></script>
8 <script src="../resources/test-helpers.js"></script>
9 <body>
10 <script>
11
12 promise_test(function(t) {
13 var scope = '../resources/blank.html';
14 var script_url = '../resources/empty-worker.js';
15 var frame;
16 return service_worker_unregister_and_register(t, script_url, scope)
17 .then(function(registration) {
18 return wait_for_state(t, registration.installing, 'activated');
19 })
20 .then(function() {
21 return with_iframe(scope);
22 })
23 .then(function(f) {
24 frame = f;
25 return new Promise(function(resolve) {
26 frame.onload = t.step_func(function() {
27 frame.contentWindow.navigator.serviceWorker.ready
28 .then(function() {
29 resolve();
30 });
31 });
32 frame.contentWindow.internals.forceReload(true);
33 });
34 })
35 .then(function() {
36 frame.remove();
37 return service_worker_unregister_and_done(t, scope);
38 });
39 }, 'Test ready promise for force-refreshed frame');
40
41 </script>
42 </body>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698