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..6a0e893af05f6063aaadda4b6ddf7052f2300ea7 |
--- /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: message, sender: sender }); |
+}); |
+ |
+chrome.runtime.onConnectExternal.addListener(function(port) { |
+ port.onMessage.addListener(function(message) { |
+ port.postMessage({ message: message, sender: port.sender }); |
+ }); |
+}); |