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

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

Issue 1286123004: Ensure that Service Worker clients are always returned in MRU order (2) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Ensure that tests actually test MRU ordering. Created 5 years, 4 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 2a8e7122565b9f9b7ed39d424b7d3f284bc56c5f..9c74737a70e92a4fc26007029e3212140c621eb7 100644
--- a/LayoutTests/http/tests/serviceworker/resources/test-helpers.js
+++ b/LayoutTests/http/tests/serviceworker/resources/test-helpers.js
@@ -65,6 +65,23 @@ function with_sandboxed_iframe(url, sandbox) {
});
}
+// Creates a new popup window, returning a Promise that resolves to its global
+// scope.
+var with_popup = function(url) {
nhiroki 2015/08/19 08:01:13 This looks no longer necessary.
jeremyarcher 2015/08/19 08:36:52 Done.
+ return new Promise(function(resolve, reject) {
+ var win = window.open(url);
+ var interval = setInterval(function() {
+ if (win.location.href.startsWith("http")) {
+ clearInterval(interval);
+ setTimeout(function() {
+ resolve(win);
+ }, 10);
+ }
+ }, 20);
+ });
+}
+
+
function normalizeURL(url) {
return new URL(url, self.location).toString().replace(/#.*$/, '');
}

Powered by Google App Engine
This is Rietveld 408576698