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

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: 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 | no next file » | 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..576ef2eed8bee7dc5ccf976c0097f0f5d91ca3e3 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) {
falken 2015/06/23 02:19:46 nit: you'll have to indent the body of this functi
jungkees 2015/06/23 02:30:07 Oh, the file I referred to for the indentation of
+ 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 | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698