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

Unified Diff: LayoutTests/http/tests/serviceworker/resources/test-helpers.js

Issue 362123003: ServiceWorker: unregister's scope argument should be optional (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rework test Created 6 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
Index: LayoutTests/http/tests/serviceworker/resources/test-helpers.js
diff --git a/LayoutTests/http/tests/serviceworker/resources/test-helpers.js b/LayoutTests/http/tests/serviceworker/resources/test-helpers.js
index 2ded3ec4e0e0c01b29a6b358a4dd32b1acf4ec4b..fc76190b2285b93d4eb2c2876d232344291fc703 100644
--- a/LayoutTests/http/tests/serviceworker/resources/test-helpers.js
+++ b/LayoutTests/http/tests/serviceworker/resources/test-helpers.js
@@ -64,3 +64,12 @@ function with_iframe(url, f) {
function normalizeURL(url) {
return new URL(url, document.location).toString().replace(/#.*$/, '');
}
+
+function wait_for_state(test, worker, state) {
+ return new Promise(test.step_func(function(resolve, reject) {
dominicc (has gone to gerrit) 2014/07/03 04:44:35 Would the test fail more quickly/incisively if you
jsbell 2014/07/03 05:16:13 That would imply encoding the valid state transiti
+ worker.addEventListener('statechange', test.step_func(function() {
+ if (worker.state === state)
+ resolve(state);
+ }));
+ }));
+}

Powered by Google App Engine
This is Rietveld 408576698