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

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

Issue 1387303002: Yaho 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/windowclient-navigate-worker.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/windowclient-navigate-worker.js b/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/windowclient-navigate-worker.js
new file mode 100644
index 0000000000000000000000000000000000000000..32c019abf74c0e965e188b1aae56f71c7ccc3bf7
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/windowclient-navigate-worker.js
@@ -0,0 +1,25 @@
+self.onmessage = function(e) {
+ var url = e.data;
+ var host;
+ var client;
+
+ self.clients.matchAll({ includeUncontrolled : true }).then(function(cs) {
+ cs.forEach(function(c) {
+ if (c.url.search('#message') != -1)
+ host = c;
+ else if (c.url.search('#client') != -1)
+ client= c;
+ });
+ client.navigate(url).then(function(c) {
+ if (!c)
+ host.postMessage(c);
+ else
+ host.postMessage(c.url);
+ })
+ .catch(function(e) {
+ console.log(e);
+ console.log(e.name);
+ host.postMessage(e.name);
+ });
+ });
+};
« 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