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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/service-workers/service-worker/resources/clients-matchall-worker.js

Issue 2415873002: Import w3c tests for the service workers (Closed)
Patch Set: Rebase Created 4 years, 2 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 unified diff | Download patch
OLDNEW
(Empty)
1 self.onmessage = function(e) {
2 var port = e.data.port;
3 var options = e.data.options;
4
5 self.clients.matchAll(options).then(function(clients) {
6 var message = [];
7 clients.forEach(function(client) {
8 var frame_type = client.frameType;
9 if (client.url.indexOf('clients-matchall-include-uncontrolled.https.ht ml') > -1 &&
10 client.frameType == 'auxiliary') {
11 // The test tab might be opened using window.open() by the test fram ework.
12 // In that case, just pretend it's top-level!
13 frame_type = 'top-level';
14 }
15 message.push([client.visibilityState,
16 client.focused,
17 client.url,
18 frame_type]);
19 });
20 // Sort by url
21 message.sort(function(a, b) { return a[2] > b[2] ? 1 : -1; });
22 port.postMessage(message);
23 });
24 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698