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

Side by Side Diff: LayoutTests/http/tests/serviceworker/clients-getall.html

Issue 778703004: Implement ServiceWorkerClient attributes [3/3] (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@properties-step1
Patch Set: Protect by a runtime flag Created 6 years 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 | LayoutTests/http/tests/serviceworker/resources/clients-getall-worker.js » ('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: ServiceWorkerClient.getAll</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>
7 var scope = 'resources/blank.html?clients-getAll';
8 var t = async_test('Test ServiceWorkerClient.getAll()');
9 t.step(function() {
10 service_worker_unregister_and_register(
11 t, 'resources/clients-getall-worker.js', scope)
12 .then(function(registration) {
13 return wait_for_state(t, registration.installing, 'activated');
14 })
15 .then(function() { return with_iframe(scope + '#1'); })
16 .then(function(frame1) {
17 frame1.focus();
18 return with_iframe(scope + '#2');
19 })
20 .then(function(frame2) {
21 var channel = new MessageChannel();
22 channel.port1.onmessage = t.step_func(onMessage);
23 frame2.contentWindow.navigator.serviceWorker.controller.postMessage(
24 {port:channel.port2}, [channel.port2]);
25 })
26 .catch(unreached_rejection(t));
27 });
28
29 var expected = [
30 /* visibilityState, focused, url, frameType */
31 ['visible', true, new URL(scope + '#1', location).toString(), 'nested'],
32 ['visible', false, new URL(scope + '#2', location).toString(), 'nested']
33 ];
34
35 function onMessage(e) {
36 assert_equals(e.data.length, 2);
37 assert_array_equals(e.data[0], expected[0]);
38 assert_array_equals(e.data[1], expected[1]);
39 service_worker_unregister_and_done(t, scope);
40 }
41 </script>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/http/tests/serviceworker/resources/clients-getall-worker.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698