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

Side by Side Diff: LayoutTests/http/tests/serviceworker/claim-not-using-registration.html

Issue 1168393002: Service Worker: Add ServiceWorkerContainer.getRegistrations() method. (Blink layout tests) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove iframe at the end of the test. 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 | LayoutTests/http/tests/serviceworker/fetch-event-after-navigation-within-page.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <title>Service Worker: claim client not using registration</title> 2 <title>Service Worker: claim client not using registration</title>
3 <script src="../resources/testharness.js"></script> 3 <script src="../resources/testharness.js"></script>
4 <script src="../resources/testharness-helpers.js"></script> 4 <script src="../resources/testharness-helpers.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.js"></script>
7 <body> 7 <body>
8 <script> 8 <script>
9 9
10 promise_test(function(t) { 10 promise_test(function(t) {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 }) 71 })
72 .then(function() { 72 .then(function() {
73 return service_worker_unregister_and_done(t, init_scope); 73 return service_worker_unregister_and_done(t, init_scope);
74 }); 74 });
75 }, 'Test claim client which is not using registration'); 75 }, 'Test claim client which is not using registration');
76 76
77 promise_test(function(t) { 77 promise_test(function(t) {
78 var scope = 'resources/blank.html?longer-matched'; 78 var scope = 'resources/blank.html?longer-matched';
79 var claim_scope = 'resources/blank.html?longer'; 79 var claim_scope = 'resources/blank.html?longer';
80 var claim_worker_url = 'resources/claim-worker.js'; 80 var claim_worker_url = 'resources/claim-worker.js';
81 var installing_worker_url = 'resources/wait-forever-in-install-worker.js'; 81 var installing_worker_url = 'resources/empty-worker.js';
82 var frame, claim_worker; 82 var frame, claim_worker;
83 return with_iframe(scope) 83 return with_iframe(scope)
84 .then(function(f) { 84 .then(function(f) {
85 frame = f; 85 frame = f;
86 return navigator.serviceWorker.register( 86 return navigator.serviceWorker.register(
87 claim_worker_url, {scope: claim_scope}); 87 claim_worker_url, {scope: claim_scope});
88 }) 88 })
89 .then(function(registration) { 89 .then(function(registration) {
90 claim_worker = registration.installing; 90 claim_worker = registration.installing;
91 return wait_for_state(t, registration.installing, 'activated'); 91 return wait_for_state(t, registration.installing, 'activated');
(...skipping 13 matching lines...) Expand all
105 }); 105 });
106 claim_worker.postMessage({port: channel.port2}, [channel.port2]); 106 claim_worker.postMessage({port: channel.port2}, [channel.port2]);
107 return saw_message; 107 return saw_message;
108 }) 108 })
109 .then(function() { 109 .then(function() {
110 assert_equals( 110 assert_equals(
111 frame.contentWindow.navigator.serviceWorker.controller, null, 111 frame.contentWindow.navigator.serviceWorker.controller, null,
112 'Frame should not be claimed when a longer-matched ' + 112 'Frame should not be claimed when a longer-matched ' +
113 'registration exists'); 113 'registration exists');
114 frame.remove(); 114 frame.remove();
115 return service_worker_unregister_and_done(t, claim_scope); 115 return service_worker_unregister(t, claim_scope);
116 })
117 .then(function() {
118 return service_worker_unregister_and_done(t, scope);
116 }); 119 });
117 }, 'Test claim client when there\'s a longer-matched registration not ' + 120 }, 'Test claim client when there\'s a longer-matched registration not ' +
118 'already used by the page'); 121 'already used by the page');
119 122
120 </script> 123 </script>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/http/tests/serviceworker/fetch-event-after-navigation-within-page.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698