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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/clients-matchall.https.html

Issue 2881743002: [ServiceWorker] Revise wpt tests for Client.type (Closed)
Patch Set: Created 3 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <title>Service Worker: Clients.matchAll</title> 2 <title>Service Worker: Clients.matchAll</title>
3 <script src="/resources/testharness.js"></script> 3 <script src="/resources/testharness.js"></script>
4 <script src="/resources/testharnessreport.js"></script> 4 <script src="/resources/testharnessreport.js"></script>
5 <script src="resources/test-helpers.sub.js"></script> 5 <script src="resources/test-helpers.sub.js"></script>
6 <script> 6 <script>
7 var scope = 'resources/blank.html?clients-matchAll'; 7 var scope = 'resources/blank.html?clients-matchAll';
8 var t = async_test('Test Clients.matchAll()'); 8 var t = async_test('Test Clients.matchAll()');
9 var frames = []; 9 var frames = [];
10 t.step(function() { 10 t.step(function() {
(...skipping 12 matching lines...) Expand all
23 frames.push(frame2); 23 frames.push(frame2);
24 var channel = new MessageChannel(); 24 var channel = new MessageChannel();
25 channel.port1.onmessage = t.step_func(onMessage); 25 channel.port1.onmessage = t.step_func(onMessage);
26 frame2.contentWindow.navigator.serviceWorker.controller.postMessage( 26 frame2.contentWindow.navigator.serviceWorker.controller.postMessage(
27 {port:channel.port2}, [channel.port2]); 27 {port:channel.port2}, [channel.port2]);
28 }) 28 })
29 .catch(unreached_rejection(t)); 29 .catch(unreached_rejection(t));
30 }); 30 });
31 31
32 var expected = [ 32 var expected = [
33 /* visibilityState, focused, url, frameType */ 33 /* visibilityState, focused, url, type, frameType */
falken 2017/05/15 06:39:28 comment style
leonhsl(Using Gerrit) 2017/05/16 02:54:29 Done.
34 ['visible', true, new URL(scope + '#1', location).toString(), 'window', 'nes ted'], 34 ['visible', true, new URL(scope + '#1', location).toString(), 'window', 'nes ted'],
35 ['visible', false, new URL(scope + '#2', location).toString(), 'window', 'ne sted'] 35 ['visible', false, new URL(scope + '#2', location).toString(), 'window', 'ne sted']
36 ]; 36 ];
37 37
38 function onMessage(e) { 38 function onMessage(e) {
39 assert_equals(e.data.length, 2); 39 assert_equals(e.data.length, 2);
40 assert_array_equals(e.data[0], expected[0]); 40 assert_array_equals(e.data[0], expected[0]);
41 assert_array_equals(e.data[1], expected[1]); 41 assert_array_equals(e.data[1], expected[1]);
42 frames.forEach(function(f) { f.remove(); }); 42 frames.forEach(function(f) { f.remove(); });
43 service_worker_unregister_and_done(t, scope); 43 service_worker_unregister_and_done(t, scope);
44 } 44 }
45 </script> 45 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698