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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/navigation-preload/get-state.https.html

Issue 2735443002: Refactor ServiceWorker tests for inclusion in WPT (Closed)
Patch Set: Upstream service worker nav. preload tests to WPT Created 3 years, 9 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <meta charset="utf-8"> 2 <meta charset="utf-8">
3 <title>NavigationPreloadManager.getState</title> 3 <title>NavigationPreloadManager.getState</title>
4 <script src="../../resources/testharness.js"></script> 4 <script src="/resources/testharness.js"></script>
5 <script src="../../resources/testharnessreport.js"></script> 5 <script src="/resources/testharnessreport.js"></script>
6 <script src="../resources/test-helpers.js"></script> 6 <script src="../resources/test-helpers.sub.js"></script>
7 <script src="resources/helpers.js"></script> 7 <script src="resources/helpers.js"></script>
8 <body> 8 <body>
9 <script> 9 <script>
10 function post_and_wait_for_reply(worker, message) { 10 function post_and_wait_for_reply(worker, message) {
11 return new Promise(resolve => { 11 return new Promise(resolve => {
12 navigator.serviceWorker.onmessage = e => { resolve(e.data); }; 12 navigator.serviceWorker.onmessage = e => { resolve(e.data); };
13 worker.postMessage(message); 13 worker.postMessage(message);
14 }); 14 });
15 } 15 }
16 16
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 .then(() => np.getState()) 208 .then(() => np.getState())
209 .then(state => { 209 .then(state => {
210 expect_navigation_preload_state(state, false, 'true', 210 expect_navigation_preload_state(state, false, 'true',
211 'state before activation'); 211 'state before activation');
212 return post_and_wait_for_reply(registration.installing, 'ping'); 212 return post_and_wait_for_reply(registration.installing, 'ping');
213 }) 213 })
214 .then(result => assert_equals(result, 'PASS')); 214 .then(result => assert_equals(result, 'PASS'));
215 }, 'no active worker'); 215 }, 'no active worker');
216 </script> 216 </script>
217 </body> 217 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698