Index: chrome/test/data/extensions/api_test/content_scripts/extension_process/background.js |
diff --git a/chrome/test/data/extensions/api_test/content_scripts/extension_process/background.js b/chrome/test/data/extensions/api_test/content_scripts/extension_process/background.js |
index d9c65c20bcbf52beb58cf1469976225d41c0432b..4e7094bcd6e7acedda9ba4c6435e1571041d3624 100644 |
--- a/chrome/test/data/extensions/api_test/content_scripts/extension_process/background.js |
+++ b/chrome/test/data/extensions/api_test/content_scripts/extension_process/background.js |
@@ -3,17 +3,26 @@ |
// found in the LICENSE file. |
var numPings = 0; |
+var base_url; |
+ |
chrome.extension.onRequest.addListener(function(data) { |
if (data != "ping") |
chrome.test.fail("Unexpected request: " + JSON.stringify(data)); |
- if (++numPings == 2) |
+ if (++numPings == 2) { |
+ // Navigate the iframe to another page and check that the content script is |
+ // also injected into that page. |
+ document.querySelector("iframe").src = |
+ base_url + "test_file_with_body.html"; |
+ } else if (numPings == 3) { |
chrome.test.notifyPass(); |
+ } |
}); |
chrome.test.getConfig(function(config) { |
- var test_file_url = "http://localhost:PORT/extensions/test_file.html" |
+ base_url = "http://localhost:PORT/extensions/" |
.replace(/PORT/, config.testServer.port); |
+ var test_file_url = base_url + "test_file.html"; |
// Add a window. |
var w = window.open(test_file_url); |