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

Unified Diff: chrome/common/extensions/extension_unittest.cc

Issue 11724002: Move ContentScripts out of Extension (Closed) Base URL: http://git.chromium.org/chromium/src.git@dc_unref_browser_action
Patch Set: Created 7 years, 9 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/extension_unittest.cc
diff --git a/chrome/common/extensions/extension_unittest.cc b/chrome/common/extensions/extension_unittest.cc
index edc99bcda0b9bab69410216b438e11ad9a546697..03d260e8cb18180590e42e9e6d40f1ba5adcf178 100644
--- a/chrome/common/extensions/extension_unittest.cc
+++ b/chrome/common/extensions/extension_unittest.cc
@@ -14,6 +14,7 @@
#include "base/utf_string_conversions.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/extensions/api/commands/commands_handler.h"
+#include "chrome/common/extensions/api/content_scripts/content_scripts_handler.h"
#include "chrome/common/extensions/api/plugins/plugins_handler.h"
#include "chrome/common/extensions/background_info.h"
#include "chrome/common/extensions/command.h"
@@ -106,6 +107,7 @@ class ExtensionTest : public testing::Test {
testing::Test::SetUp();
(new BackgroundManifestHandler)->Register();
(new CommandsHandler)->Register();
+ (new ContentScriptsHandler)->Register();
(new PluginsHandler)->Register();
}
@@ -502,34 +504,58 @@ TEST_F(ExtensionTest, WantsFileAccess) {
extension = LoadManifest("permissions", "content_script_all_urls.json");
EXPECT_TRUE(extension->wants_file_access());
EXPECT_FALSE(extension->CanExecuteScriptOnPage(
- file_url, file_url, -1, &extension->content_scripts()[0], NULL));
+ file_url,
+ file_url,
+ -1,
+ &ContentScriptsInfo::GetContentScripts(extension)[0],
+ NULL));
extension = LoadManifest("permissions", "content_script_all_urls.json",
Extension::ALLOW_FILE_ACCESS);
EXPECT_TRUE(extension->wants_file_access());
EXPECT_TRUE(extension->CanExecuteScriptOnPage(
- file_url, file_url, -1, &extension->content_scripts()[0], NULL));
+ file_url,
+ file_url,
+ -1,
+ &ContentScriptsInfo::GetContentScripts(extension)[0],
+ NULL));
// file:///* content script match
extension = LoadManifest("permissions", "content_script_file_scheme.json");
EXPECT_TRUE(extension->wants_file_access());
EXPECT_FALSE(extension->CanExecuteScriptOnPage(
- file_url, file_url, -1, &extension->content_scripts()[0], NULL));
+ file_url,
+ file_url,
+ -1,
+ &ContentScriptsInfo::GetContentScripts(extension)[0],
+ NULL));
extension = LoadManifest("permissions", "content_script_file_scheme.json",
Extension::ALLOW_FILE_ACCESS);
EXPECT_TRUE(extension->wants_file_access());
EXPECT_TRUE(extension->CanExecuteScriptOnPage(
- file_url, file_url, -1, &extension->content_scripts()[0], NULL));
+ file_url,
+ file_url,
+ -1,
+ &ContentScriptsInfo::GetContentScripts(extension)[0],
+ NULL));
// http://* content script match
extension = LoadManifest("permissions", "content_script_http_scheme.json");
EXPECT_FALSE(extension->wants_file_access());
EXPECT_FALSE(extension->CanExecuteScriptOnPage(
- file_url, file_url, -1, &extension->content_scripts()[0], NULL));
+ file_url,
+ file_url,
+ -1,
+ &ContentScriptsInfo::GetContentScripts(extension)[0],
+ NULL));
extension = LoadManifest("permissions", "content_script_http_scheme.json",
Extension::ALLOW_FILE_ACCESS);
EXPECT_FALSE(extension->wants_file_access());
EXPECT_FALSE(extension->CanExecuteScriptOnPage(
- file_url, file_url, -1, &extension->content_scripts()[0], NULL));
+ file_url,
+ file_url,
+ -1,
+ &ContentScriptsInfo::GetContentScripts(extension)[0],
+ NULL));
}
TEST_F(ExtensionTest, ExtraFlags) {

Powered by Google App Engine
This is Rietveld 408576698