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

Side by Side Diff: LayoutTests/http/tests/serviceworker/unregister-then-register.html

Issue 1311103002: ServiceWorker: Make APIs that return ServiceWorkerRegistration coin a new JS object (3/3) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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 <script src="../resources/testharness.js"></script> 2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script> 3 <script src="../resources/testharnessreport.js"></script>
4 <script src="resources/test-helpers.js"></script> 4 <script src="resources/test-helpers.js"></script>
5 <script> 5 <script>
6 var worker_url = 'resources/empty-worker.js'; 6 var worker_url = 'resources/empty-worker.js';
7 7
8 async_test(function(t) { 8 async_test(function(t) {
9 var scope = 'resources/scope/re-register-resolves-to-new-value'; 9 var scope = 'resources/scope/re-register-resolves-to-new-value';
10 var iframe; 10 var iframe;
(...skipping 30 matching lines...) Expand all
41 .then(function() { 41 .then(function() {
42 return with_iframe(scope); 42 return with_iframe(scope);
43 }) 43 })
44 .then(function(frame) { 44 .then(function(frame) {
45 return registration.unregister(); 45 return registration.unregister();
46 }) 46 })
47 .then(function() { 47 .then(function() {
48 return navigator.serviceWorker.register(worker_url, { scope: scope }); 48 return navigator.serviceWorker.register(worker_url, { scope: scope });
49 }) 49 })
50 .then(function(new_registration) { 50 .then(function(new_registration) {
51 assert_equals(registration, new_registration, 51 assert_registration_equals(
52 'register should resolve to the same value'); 52 registration, new_registration,
53 'register should resolve to the same value');
falken 2015/08/25 03:28:29 "same value" might mean JS ==, maybe same registra
nhiroki 2015/08/25 06:28:07 Done.
53 service_worker_unregister_and_done(t, scope); 54 service_worker_unregister_and_done(t, scope);
54 }) 55 })
55 .catch(unreached_rejection(t)); 56 .catch(unreached_rejection(t));
56 }, 'Unregister then register resolves to the original value if the ' + 57 }, 'Unregister then register resolves to the original value if the ' +
57 'registration is in use.'); 58 'registration is in use.');
58 59
59 async_test(function(t) { 60 async_test(function(t) {
60 var scope = 'resources/scope/re-register-does-not-affect-existing-controllee '; 61 var scope = 'resources/scope/re-register-does-not-affect-existing-controllee ';
61 var iframe; 62 var iframe;
62 var registration; 63 var registration;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 // FIXME: When crbug.com/400602 is fixed, assert that controller 120 // FIXME: When crbug.com/400602 is fixed, assert that controller
120 // equals the original worker. 121 // equals the original worker.
121 assert_not_equals( 122 assert_not_equals(
122 frame.contentWindow.navigator.serviceWorker.controller, null, 123 frame.contentWindow.navigator.serviceWorker.controller, null,
123 'document should have a controller'); 124 'document should have a controller');
124 service_worker_unregister_and_done(t, scope); 125 service_worker_unregister_and_done(t, scope);
125 }) 126 })
126 .catch(unreached_rejection(t)); 127 .catch(unreached_rejection(t));
127 }, 'Unregister then register resurrects the registration'); 128 }, 'Unregister then register resurrects the registration');
128 </script> 129 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698