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

Unified Diff: chrome/test/data/extensions/api_test/native_bindings/content_script.js

Issue 2641863003: [Extensions Bindings] Add a messaging test (Closed)
Patch Set: . Created 3 years, 11 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: chrome/test/data/extensions/api_test/native_bindings/content_script.js
diff --git a/chrome/test/data/extensions/api_test/native_bindings/content_script.js b/chrome/test/data/extensions/api_test/native_bindings/content_script.js
new file mode 100644
index 0000000000000000000000000000000000000000..b837db3abb141fd75d01caf83b2993ec8f099526
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/native_bindings/content_script.js
@@ -0,0 +1,14 @@
+// Copyright 2017 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.
+
+chrome.runtime.onConnect.addListener((port) => {
+ port.onMessage.addListener((message) => {
+ chrome.test.assertEq('background page', message);
+ port.postMessage('content script');
+ });
+});
+
+chrome.runtime.sendMessage('startFlow', function(response) {
+ chrome.test.assertEq('started', response);
+});

Powered by Google App Engine
This is Rietveld 408576698