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

Unified Diff: chrome/test/data/extensions/api_test/messaging/connect/page.js

Issue 709933002: Add frameId to MessageSender (extension messaging API) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Generate frameId in browser Created 6 years, 1 month 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/page.js
diff --git a/chrome/test/data/extensions/api_test/messaging/connect/page.js b/chrome/test/data/extensions/api_test/messaging/connect/page.js
index 1e3a7e8eb3dcc68b0c9b3f2f7ba8204ef1819a7a..d784f9caf1ac6faf1c3d9ea9edc02249fbeccfa3 100644
--- a/chrome/test/data/extensions/api_test/messaging/connect/page.js
+++ b/chrome/test/data/extensions/api_test/messaging/connect/page.js
@@ -29,6 +29,8 @@ chrome.runtime.onConnect.addListener(function(port) {
testPostMessageFromTab(port);
} else if (msg.testSendMessageFromTab) {
testSendMessageFromTab();
+ } else if (msg.testSendMessageFromFrame) {
+ testSendMessageFromFrame();
} else if (msg.testDisconnect) {
port.disconnect();
} else if (msg.testDisconnectOnClose) {
@@ -65,6 +67,14 @@ function testSendMessageFromTab() {
});
}
+function testSendMessageFromFrame() {
+ var f = document.createElement('iframe');
+ f.src = '?frame_test';
+ document.body.appendChild(f);
not at google - send to devlin 2014/11/11 00:03:04 Ideally you'd test with more than 1 frame.
robwu 2014/11/11 00:34:26 Done.
+ // The test will continue in frame.js (a content script that runs at
+ // ?frame_test, declared in manifest.json).
not at google - send to devlin 2014/11/11 00:03:04 A more useful comment would explain what the frame
robwu 2014/11/11 00:34:26 Done.
+}
+
// Tests sendMessage to an invalid extension.
function testSendMessageFromTabError() {
// try sending a request to a bad extension id

Powered by Google App Engine
This is Rietveld 408576698