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

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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/serviceworker/windowclient-navigate.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 var port = null;
2
3 self.onmessage = function(e) {
4 port = e.data.port;
5 port.onmessage = on_message;
6 port.postMessage('ready');
7 };
8
9 function on_message(e) {
10 var url = e.data;
11 var client;
12
13 self.clients.matchAll({ includeUncontrolled : true }).then(function(cs) {
14 cs.forEach(function(c) { c.frameType == 'nested' && (client = c); });
15 return client.navigate(url);
16 })
17 .then(function(c) {
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 }
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/serviceworker/windowclient-navigate.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698