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

Unified Diff: chrome/common/extensions/manifest_handlers/content_scripts_manifest_unittest.cc

Issue 313453002: Resubmit: Block content scripts from executing until user grants permission (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Latest master Created 6 years, 7 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/common/extensions/manifest_handlers/content_scripts_manifest_unittest.cc
diff --git a/chrome/common/extensions/manifest_handlers/content_scripts_manifest_unittest.cc b/chrome/common/extensions/manifest_handlers/content_scripts_manifest_unittest.cc
index fd05f38a86297bab8bebdababfeb7c266853edc7..64e29f933c7f61d9f81fcc1d34481242e4970fbf 100644
--- a/chrome/common/extensions/manifest_handlers/content_scripts_manifest_unittest.cc
+++ b/chrome/common/extensions/manifest_handlers/content_scripts_manifest_unittest.cc
@@ -67,4 +67,20 @@ TEST_F(ContentScriptsManifestTest, ScriptableHosts) {
EXPECT_EQ(expected, scriptable_hosts);
}
+TEST_F(ContentScriptsManifestTest, ContentScriptIds) {
+ scoped_refptr<Extension> extension1 =
+ LoadAndExpectSuccess("content_script_yahoo.json");
+ scoped_refptr<Extension> extension2 =
+ LoadAndExpectSuccess("content_script_yahoo.json");
+ const UserScriptList& user_scripts1 =
+ ContentScriptsInfo::GetContentScripts(extension1);
+ ASSERT_EQ(1u, user_scripts1.size());
+ int64 id = user_scripts1[0].id();
+ const UserScriptList& user_scripts2 =
+ ContentScriptsInfo::GetContentScripts(extension2);
+ ASSERT_EQ(1u, user_scripts2.size());
+ // The id of the content script should be one higher than the previous.
+ EXPECT_EQ(id + 1, user_scripts2[0].id());
+}
+
} // namespace extensions
« no previous file with comments | « chrome/common/extensions/manifest_handlers/content_scripts_handler.cc ('k') | extensions/common/extension_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698