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

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

Issue 812853002: Basic tests for sending messages over a navigator.connect initiated channel. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@navigator-connect_connect-tests
Patch Set: Created 6 years 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
new file mode 100644
index 0000000000000000000000000000000000000000..37d12869b9c57593d716e20ac6a0a7ebe26e89fa
--- /dev/null
+++ b/LayoutTests/http/tests/navigatorconnect/resources/echo-worker.js
@@ -0,0 +1,10 @@
+var client;
miket_OOO 2014/12/20 00:00:18 Does this part of the code need a license header?
Marijn Kruisselbrink 2014/12/20 00:10:32 Layout tests generally don't have license headers.
+self.addEventListener('crossoriginconnect', function(event) {
+ client = event.client;
+ event.acceptConnection(true);
+});
+
+
+self.addEventListener('crossoriginmessage', function(event) {
+ client.postMessage(event.data, event.ports);
+});

Powered by Google App Engine
This is Rietveld 408576698