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

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

Issue 1211253007: ServiceWorker: Add LayoutTest for WindowClient.navigate(). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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 url = e.data;
3 var host;
4 var client;
5
6 self.clients.matchAll({ includeUncontrolled : true }).then(function(cs) {
7 cs.forEach(function(c) {
8 if (c.url.search('#message') != -1)
9 host = c;
10 else if (c.url.search('#client') != -1)
11 client= c;
12 });
13 client.navigate(url).then(function(c) {
14 if (!c)
15 host.postMessage(c);
16 else
17 host.postMessage(c.url);
18 }).catch(function(e) {
19 host.postMessage(e.name);
20 });
nhiroki 2015/09/28 08:59:21 promise-chain indent (see my other comment) clien
zino 2015/10/07 02:30:41 Done.
21 });
22 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698