| 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) {
|
|
|