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

Unified Diff: LayoutTests/http/tests/navigatorconnect/resources/echo-worker.js

Issue 1210633002: Update navigator.services API to use the new services.onconnect event [1/3]. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@serviceport-part3
Patch Set: rebase Created 5 years, 5 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
Index: LayoutTests/http/tests/navigatorconnect/resources/echo-worker.js
diff --git a/LayoutTests/http/tests/navigatorconnect/resources/echo-worker.js b/LayoutTests/http/tests/navigatorconnect/resources/echo-worker.js
index 37d12869b9c57593d716e20ac6a0a7ebe26e89fa..0cab9a36f055829690d0764a6d639203c34a13be 100644
--- a/LayoutTests/http/tests/navigatorconnect/resources/echo-worker.js
+++ b/LayoutTests/http/tests/navigatorconnect/resources/echo-worker.js
@@ -4,7 +4,10 @@ self.addEventListener('crossoriginconnect', function(event) {
event.acceptConnection(true);
});
-
self.addEventListener('crossoriginmessage', function(event) {
client.postMessage(event.data, event.ports);
});
+
+navigator.services.addEventListener('connect', function(event) {
+ event.respondWith({accept: true}).then(function(port) { client = port; });
+});

Powered by Google App Engine
This is Rietveld 408576698