OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>Service Worker: Clients.matchAll with exact controller</title> | 2 <title>Service Worker: Clients.matchAll with exact controller</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 const scope = 'resources/blank.html?clients-matchAll'; | 7 const scope = 'resources/blank.html?clients-matchAll'; |
8 const t = async_test('Test Clients.matchAll() with exact controller'); | 8 const t = async_test('Test Clients.matchAll() with exact controller'); |
9 let frames = []; | 9 let frames = []; |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 } catch (e) { | 21 } catch (e) { |
22 reject(e); | 22 reject(e); |
23 } | 23 } |
24 }; | 24 }; |
25 | 25 |
26 worker.postMessage({port:channel.port2}, [channel.port2]); | 26 worker.postMessage({port:channel.port2}, [channel.port2]); |
27 }); | 27 }); |
28 } | 28 } |
29 | 29 |
30 let expected = [ | 30 let expected = [ |
31 /* visibilityState, focused, url, frameType */ | 31 // visibilityState, focused, url, type, frameType |
32 ['visible', true, new URL(scope + '#1', location).toString(), 'window', 'nes
ted'], | 32 ['visible', true, new URL(scope + '#1', location).toString(), 'window', 'nes
ted'], |
33 ['visible', false, new URL(scope + '#2', location).toString(), 'window', 'ne
sted'] | 33 ['visible', false, new URL(scope + '#2', location).toString(), 'window', 'ne
sted'] |
34 ]; | 34 ]; |
35 | 35 |
36 t.step(_ => { | 36 t.step(_ => { |
37 let script = 'resources/clients-matchall-worker.js'; | 37 let script = 'resources/clients-matchall-worker.js'; |
38 service_worker_unregister_and_register(t, script, scope) | 38 service_worker_unregister_and_register(t, script, scope) |
39 .then(registration => { | 39 .then(registration => { |
40 return wait_for_state(t, registration.installing, 'activated'); | 40 return wait_for_state(t, registration.installing, 'activated'); |
41 }) | 41 }) |
(...skipping 17 matching lines...) Expand all Loading... |
59 checkWorkerClients(registration.active, expected), | 59 checkWorkerClients(registration.active, expected), |
60 ]); | 60 ]); |
61 }) | 61 }) |
62 .then(_ => { | 62 .then(_ => { |
63 frames.forEach(f => f.remove() ); | 63 frames.forEach(f => f.remove() ); |
64 service_worker_unregister_and_done(t, scope); | 64 service_worker_unregister_and_done(t, scope); |
65 }) | 65 }) |
66 .catch(unreached_rejection(t)); | 66 .catch(unreached_rejection(t)); |
67 }); | 67 }); |
68 </script> | 68 </script> |
OLD | NEW |