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

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

Issue 674133004: [ServiceWorker] Introduce the directory restriction of ServiceWorker scope [1/3 blink] (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: remove LayoutTests/http/tests/serviceworker/ServiceWorkerGlobalScope/scope-default.html Created 6 years, 1 month 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/simple-intercept-worker.js'; 6 var worker_url = 'resources/simple-intercept-worker.js';
7 7
8 async_test(function(t) { 8 async_test(function(t) {
9 var scope = 9 var scope =
10 'resources/unregister-controller-page.html?load-before-unregister'; 10 'resources/unregister-controller-page.html?load-before-unregister';
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 .then(function(response) { 72 .then(function(response) {
73 assert_equals(response, 'a simple text file\n', 73 assert_equals(response, 'a simple text file\n',
74 'requests should not be intercepted'); 74 'requests should not be intercepted');
75 t.done(); 75 t.done();
76 }) 76 })
77 .catch(unreached_rejection(t)); 77 .catch(unreached_rejection(t));
78 }, 'Unregister prevents control of subsequent navigations'); 78 }, 'Unregister prevents control of subsequent navigations');
79 79
80 async_test(function(t) { 80 async_test(function(t) {
81 var scope = 81 var scope =
82 'scope/no-new-controllee-even-if-registration-is-still-used'; 82 'resources/scope/no-new-controllee-even-if-registration-is-still-used';
83 var registration; 83 var registration;
84 84
85 service_worker_unregister_and_register(t, worker_url, scope) 85 service_worker_unregister_and_register(t, worker_url, scope)
86 .then(function(r) { 86 .then(function(r) {
87 registration = r; 87 registration = r;
88 return wait_for_update(t, registration); 88 return wait_for_update(t, registration);
89 }) 89 })
90 .then(function(worker) { 90 .then(function(worker) {
91 return wait_for_state(t, worker, 'activated'); 91 return wait_for_state(t, worker, 'activated');
92 }) 92 })
93 .then(function() { 93 .then(function() {
94 return with_iframe(scope); 94 return with_iframe(scope);
95 }) 95 })
96 .then(function(frame) { 96 .then(function(frame) {
97 return registration.unregister(); 97 return registration.unregister();
98 }) 98 })
99 .then(function() { 99 .then(function() {
100 return with_iframe(scope); 100 return with_iframe(scope);
101 }) 101 })
102 .then(function(frame) { 102 .then(function(frame) {
103 assert_equals(frame.contentWindow.navigator.serviceWorker.controller, 103 assert_equals(frame.contentWindow.navigator.serviceWorker.controller,
104 null, 104 null,
105 'document should not have a controller'); 105 'document should not have a controller');
106 t.done(); 106 t.done();
107 }) 107 })
108 .catch(unreached_rejection(t)); 108 .catch(unreached_rejection(t));
109 }, 'Unregister prevents new controllee even if registration is still in use'); 109 }, 'Unregister prevents new controllee even if registration is still in use');
110 </script> 110 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698