Chromium Code Reviews| 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 |