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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/windowclient-navigate-worker.js

Issue 1390993002: ServiceWorker: Add layout test for WindowClient.navigate(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 var port = null;
2
3 self.onmessage = function(e) {
4 if (!port && e.data.port) {
5 port = e.data.port;
6 return;
7 }
nhiroki 2015/10/08 09:19:06 You could remove this hack if the document sends u
zino 2015/10/08 13:35:36 Done.
8
9 var url = e.data;
10 var client;
11
12 self.clients.matchAll({ includeUncontrolled : true }).then(function(cs) {
13 cs.forEach(function(c) {
14 if (c.frameType == 'nested')
15 client= c;
nhiroki 2015/10/08 09:19:06 nit: space before '='
zino 2015/10/08 13:35:36 Done.
16 });
17 client.navigate(url).then(function(c) {
nhiroki 2015/10/08 09:19:06 nit: To unindent, you might want to return a promi
zino 2015/10/08 13:35:36 Done.
18 if (!c)
19 port.postMessage(c);
20 else
21 port.postMessage(c.url);
22 })
23 .catch(function(e) {
24 port.postMessage(e.name);
25 });
26 });
27 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698