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

Unified Diff: chrome/test/data/extensions/api_test/messaging/connect_nobackground/contentscript.js

Issue 1413853005: Track all extension frames in ProcessManager, inspect extensionoptions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 2 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/messaging/connect_nobackground/contentscript.js
diff --git a/chrome/test/data/extensions/api_test/messaging/connect_nobackground/contentscript.js b/chrome/test/data/extensions/api_test/messaging/connect_nobackground/contentscript.js
new file mode 100644
index 0000000000000000000000000000000000000000..f590996543c8815f7d23a75004a23179630566ca
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/messaging/connect_nobackground/contentscript.js
@@ -0,0 +1,11 @@
+// Copyright (c) 2015 The Chromium Authors. All rights reserved.
Devlin 2015/10/30 01:21:43 nit: no (c)
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+var port = chrome.runtime.connect();
+port.postMessage('Hello from content script');
+port.disconnect();
+
+chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) {
Devlin 2015/10/30 01:21:43 this seems like a subtle race condition - can we r
robwu 2015/10/30 10:15:49 This can't race because the message has to go to a
Devlin 2015/10/30 16:03:51 Generally in testing, though, we don't want to rel
+ sendResponse('Reply here');
Devlin 2015/10/30 01:21:43 Is it worth verifying the message? Probably not n
+});

Powered by Google App Engine
This is Rietveld 408576698