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

Unified Diff: LayoutTests/http/tests/serviceworker/resources/clients-matchall-worker.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: 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/clients-matchall-worker.js
diff --git a/LayoutTests/http/tests/serviceworker/resources/clients-matchall-worker.js b/LayoutTests/http/tests/serviceworker/resources/clients-matchall-worker.js
index be69c4b23e3eb37716046ea8f58e581d5b0dc981..dfa5c277df80f1c738a8b622ddd398457904a7a5 100644
--- a/LayoutTests/http/tests/serviceworker/resources/clients-matchall-worker.js
+++ b/LayoutTests/http/tests/serviceworker/resources/clients-matchall-worker.js
@@ -1,6 +1,7 @@
self.onmessage = function(e) {
var port = e.data.port;
var options = e.data.options;
+ var retainOriginalOrder = e.data.retainOriginalOrder;
self.clients.matchAll(options).then(function(clients) {
var message = [];
@@ -11,7 +12,8 @@ self.onmessage = function(e) {
client.frameType]);
});
// Sort by url
- message.sort(function(a, b) { return a[2] > b[2] ? 1 : -1; });
+ if (!retainOriginalOrder)
+ message.sort(function(a, b) { return a[2] > b[2] ? 1 : -1; });
falken 2015/08/17 07:10:19 This extra flag is kind of tricky, I'd just remove
port.postMessage(message);
});
};

Powered by Google App Engine
This is Rietveld 408576698