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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/clients-matchall-worker.js

Issue 2778903002: Upstream service worker `client` tests to WPT (Closed)
Patch Set: Remove unnecessary branch Created 3 years, 9 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: third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/clients-matchall-worker.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/clients-matchall-worker.js b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/clients-matchall-worker.js
index 8849b2ce2b9d3b33b33d53d620d0f4c34f80a886..d6634f4d40ef6ada3440b443faff176e54082a71 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/clients-matchall-worker.js
+++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/clients-matchall-worker.js
@@ -2,29 +2,30 @@ self.onmessage = function(e) {
var port = e.data.port;
var options = e.data.options;
- self.clients.matchAll(options).then(function(clients) {
- var message = [];
- clients.forEach(function(client) {
- var frame_type = client.frameType;
- if (client.url.indexOf('clients-matchall-include-uncontrolled.https.html') > -1 &&
- client.frameType == 'auxiliary') {
- // The test tab might be opened using window.open() by the test framework.
- // In that case, just pretend it's top-level!
- frame_type = 'top-level';
- }
- message.push([client.visibilityState,
- client.focused,
- client.url,
- client.type,
- frame_type]);
- });
- // Sort by url
- if (!e.data.disableSort) {
- message.sort(function(a, b) { return a[2] > b[2] ? 1 : -1; });
- }
- port.postMessage(message);
- })
- .catch(e => {
- port.postMessage('clients.matchAll() rejected: ' + e);
- })
+ e.waitUntil(self.clients.matchAll(options)
+ .then(function(clients) {
+ var message = [];
+ clients.forEach(function(client) {
+ var frame_type = client.frameType;
+ if (client.url.indexOf('clients-matchall-include-uncontrolled.https.html') > -1 &&
+ client.frameType == 'auxiliary') {
+ // The test tab might be opened using window.open() by the test framework.
+ // In that case, just pretend it's top-level!
+ frame_type = 'top-level';
+ }
+ message.push([client.visibilityState,
+ client.focused,
+ client.url,
+ client.type,
+ frame_type]);
+ });
+ // Sort by url
+ if (!e.data.disableSort) {
+ message.sort(function(a, b) { return a[2] > b[2] ? 1 : -1; });
+ }
+ port.postMessage(message);
+ })
+ .catch(e => {
+ port.postMessage('clients.matchAll() rejected: ' + e);
+ }));
};

Powered by Google App Engine
This is Rietveld 408576698