| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <title>Service Worker: getRegistrations()</title> | 2 <title>Service Worker: getRegistrations()</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/testharness-helpers.js"></script> |
| 5 <script src="resources/test-helpers.js"></script> | 6 <script src="resources/test-helpers.js"></script> |
| 6 <script src="../resources/get-host-info.js"></script> | 7 <script src="../resources/get-host-info.js"></script> |
| 7 <script src="../fetch/resources/fetch-test-helpers.js"></script> | |
| 8 <script> | 8 <script> |
| 9 // Purge the existing registrations for the origin. | 9 // Purge the existing registrations for the origin. |
| 10 // getRegistrations() is used in order to avoid adding additional complexity | 10 // getRegistrations() is used in order to avoid adding additional complexity |
| 11 // e.g. adding an internal function. | 11 // e.g. adding an internal function. |
| 12 sequential_promise_test(function(t) { | 12 sequential_promise_test(function(t) { |
| 13 return navigator.serviceWorker.getRegistrations() | 13 return navigator.serviceWorker.getRegistrations() |
| 14 .then(function(registrations) { | 14 .then(function(registrations) { |
| 15 return registrations.reduce(function(sequence, registration) { | 15 return registrations.reduce(function(sequence, registration) { |
| 16 return sequence.then(function() { | 16 return sequence.then(function() { |
| 17 return registration.unregister(); | 17 return registration.unregister(); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 }; | 132 }; |
| 133 frame.contentWindow.postMessage('unregister', '*', [channel.port2]); | 133 frame.contentWindow.postMessage('unregister', '*', [channel.port2]); |
| 134 return p; | 134 return p; |
| 135 }) | 135 }) |
| 136 .then(function() { | 136 .then(function() { |
| 137 frame.remove(); | 137 frame.remove(); |
| 138 return service_worker_unregister(t, scope); | 138 return service_worker_unregister(t, scope); |
| 139 }); | 139 }); |
| 140 }, 'getRegistrations promise resolves only with same origin registrations.'); | 140 }, 'getRegistrations promise resolves only with same origin registrations.'); |
| 141 | 141 |
| 142 sequential_promise_test_done(); | |
| 143 done(); | 142 done(); |
| 144 </script> | 143 </script> |
| OLD | NEW |