Index: chrome/test/data/extensions/api_test/messaging/externally_connectable/web_connectable/background.js |
diff --git a/chrome/test/data/extensions/api_test/messaging/externally_connectable/web_connectable/background.js b/chrome/test/data/extensions/api_test/messaging/externally_connectable/web_connectable/background.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..174d6393305b51a6a5e7d58ec0c6750d231dbc37 |
--- /dev/null |
+++ b/chrome/test/data/extensions/api_test/messaging/externally_connectable/web_connectable/background.js |
@@ -0,0 +1,16 @@ |
+// Copyright 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+// The test extension for externally_connectable just echos all messages it |
+// gets. The test runners are in the sites/ directory. |
+ |
+chrome.runtime.onMessageExternal.addListener(function(message, sender, reply) { |
+ reply(message); |
+}); |
+ |
+chrome.runtime.onConnectExternal.addListener(function(port) { |
Jeffrey Yasskin
2013/06/08 00:28:09
Both of these tests should include some mention of
not at google - send to devlin
2013/06/08 02:02:33
Ah. Very good point. WDYT now.
|
+ port.onMessage.addListener(function(message) { |
+ port.postMessage(message); |
+ }); |
+}); |