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

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

Issue 10750010: Add an installType property to the management API (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Added location param to InstallExtension, rewrote test Created 8 years, 5 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/extension_browsertest.cc
diff --git a/chrome/browser/extensions/extension_browsertest.cc b/chrome/browser/extensions/extension_browsertest.cc
index eb319ca625b867085128df3c0d60ed547b98baf1..382156f0f42aa1064983e27f5af9b400a28497c8 100644
--- a/chrome/browser/extensions/extension_browsertest.cc
+++ b/chrome/browser/extensions/extension_browsertest.cc
@@ -75,7 +75,10 @@ void ExtensionBrowserTest::SetUpCommandLine(CommandLine* command_line) {
}
const Extension* ExtensionBrowserTest::LoadExtensionWithOptions(
- const FilePath& path, bool incognito_enabled, bool fileaccess_enabled) {
+ const FilePath& path,
+ Extension::Location location,
+ bool incognito_enabled,
+ bool fileaccess_enabled) {
ExtensionService* service = browser()->profile()->GetExtensionService();
{
content::NotificationRegistrar registrar;
@@ -134,7 +137,6 @@ const Extension* ExtensionBrowserTest::LoadExtensionWithOptions(
chrome::NOTIFICATION_EXTENSION_LOADED,
content::Source<Profile>(browser()->profile()));
CHECK(service->AllowFileAccess(extension));
-
if (!fileaccess_enabled) {
service->SetAllowFileAccess(extension, fileaccess_enabled);
load_signal.Wait();
@@ -265,7 +267,8 @@ const Extension* ExtensionBrowserTest::InstallExtensionFromWebstore(
const FilePath& path,
int expected_change) {
return InstallOrUpdateExtension("", path, INSTALL_UI_TYPE_NONE,
- expected_change, browser(), true);
+ expected_change, Extension::INTERNAL,
+ browser(), true);
}
const Extension* ExtensionBrowserTest::InstallOrUpdateExtension(
@@ -274,7 +277,28 @@ const Extension* ExtensionBrowserTest::InstallOrUpdateExtension(
InstallUIType ui_type,
int expected_change) {
return InstallOrUpdateExtension(id, path, ui_type, expected_change,
- browser(), false);
+ Extension::INTERNAL, browser(), false);
+}
+
+const Extension* ExtensionBrowserTest::InstallOrUpdateExtension(
+ const std::string& id,
+ const FilePath& path,
+ InstallUIType ui_type,
+ int expected_change,
+ Browser* browser,
+ bool from_webstore) {
+ return InstallOrUpdateExtension(id, path, ui_type, expected_change,
+ Extension::INTERNAL, browser, from_webstore);
+}
+
+const Extension* ExtensionBrowserTest::InstallOrUpdateExtension(
+ const std::string& id,
+ const FilePath& path,
+ InstallUIType ui_type,
+ int expected_change,
+ Extension::Location install_source) {
+ return InstallOrUpdateExtension(id, path, ui_type, expected_change,
+ install_source, browser(), false);
}
const Extension* ExtensionBrowserTest::InstallOrUpdateExtension(
@@ -282,6 +306,7 @@ const Extension* ExtensionBrowserTest::InstallOrUpdateExtension(
const FilePath& path,
InstallUIType ui_type,
int expected_change,
+ Extension::Location install_source,
Browser* browser,
bool from_webstore) {
ExtensionService* service = browser->profile()->GetExtensionService();
@@ -316,6 +341,7 @@ const Extension* ExtensionBrowserTest::InstallOrUpdateExtension(
extensions::CrxInstaller::Create(service, install_ui));
installer->set_expected_id(id);
installer->set_is_gallery_install(from_webstore);
+ installer->set_install_source(install_source);
if (!from_webstore) {
installer->set_off_store_install_allow_reason(
extensions::CrxInstaller::OffStoreInstallAllowedInTest);

Powered by Google App Engine
This is Rietveld 408576698