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

Unified Diff: LayoutTests/http/tests/serviceworker/getregistrations.html

Issue 1205493005: Service Worker: Add initialization step for getRegistrations.html layout test. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix indentation 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/http/tests/serviceworker/multiple-register.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/serviceworker/getregistrations.html
diff --git a/LayoutTests/http/tests/serviceworker/getregistrations.html b/LayoutTests/http/tests/serviceworker/getregistrations.html
index 6d71f7050a461d752fcac12a06ec679ddd827056..ad9a06d208e500f235039e2a5cebea76a6067e3f 100644
--- a/LayoutTests/http/tests/serviceworker/getregistrations.html
+++ b/LayoutTests/http/tests/serviceworker/getregistrations.html
@@ -6,6 +6,20 @@
<script src="../resources/get-host-info.js"></script>
<script src="../fetch/resources/fetch-test-helpers.js"></script>
<script>
+// Purge the existing registrations for the origin.
+// getRegistrations() is used in order to avoid adding additional complexity
+// e.g. adding an internal function.
+sequential_promise_test(function(t) {
+ return navigator.serviceWorker.getRegistrations()
+ .then(function(registrations) {
+ return registrations.reduce(function(sequence, registration) {
+ return sequence.then(function() {
+ return registration.unregister();
+ });
+ }, Promise.resolve());
+ });
+ }, 'Purge the existing registrations.');
+
sequential_promise_test(function(t) {
return navigator.serviceWorker.getRegistrations()
.then(function(value) {
« no previous file with comments | « no previous file | LayoutTests/http/tests/serviceworker/multiple-register.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698