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

Unified Diff: chrome/browser/extensions/content_script_apitest.cc

Issue 10863002: Added check to prevent extensions from injecting scrips into other extensions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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/browser/extensions/content_script_apitest.cc
diff --git a/chrome/browser/extensions/content_script_apitest.cc b/chrome/browser/extensions/content_script_apitest.cc
index 9daa75358d05e4b3d92d438ce4ca35b116ae0efa..01d8f7992c6b75253c43905738a18d732a49e063 100644
--- a/chrome/browser/extensions/content_script_apitest.cc
+++ b/chrome/browser/extensions/content_script_apitest.cc
@@ -83,6 +83,19 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContentScriptViewSource) {
ASSERT_TRUE(RunExtensionTest("content_scripts/view_source")) << message_;
}
+// crbug.com/126257 -- content scripts should not get injected into other
+// extensions.
+IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContentScriptOtherExtensions) {
+ host_resolver()->AddRule("a.com", "127.0.0.1");
+ ASSERT_TRUE(StartTestServer());
+ // First, load extension that sets up content script.
+ ASSERT_TRUE(RunExtensionTest("content_scripts/other_extensions/injector"))
+ << message_;
+ // Then load targeted extension to make sure its content isn't changed.
+ ASSERT_TRUE(RunExtensionTest("content_scripts/other_extensions/victim"))
+ << message_;
+}
+
// crbug.com/120762
IN_PROC_BROWSER_TEST_F(
ExtensionApiTest,

Powered by Google App Engine
This is Rietveld 408576698