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

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

Issue 11359105: Don't install external extensions in tests (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: comment fixed Created 8 years, 1 month 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
« no previous file with comments | « chrome/browser/extensions/default_apps.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/external_provider_impl.cc
diff --git a/chrome/browser/extensions/external_provider_impl.cc b/chrome/browser/extensions/external_provider_impl.cc
index 55318ec28a75534abe86a0afabd33cc8c47ebfb7..fac59a1dab80898eae080f0614e40b4d6f2d2231 100644
--- a/chrome/browser/extensions/external_provider_impl.cc
+++ b/chrome/browser/extensions/external_provider_impl.cc
@@ -314,6 +314,21 @@ void ExternalProviderImpl::CreateExternalProviders(
VisitorInterface* service,
Profile* profile,
ProviderCollection* provider_list) {
+ // Policies are mandatory so they can't be skipped with command line flag.
+ provider_list->push_back(
+ linked_ptr<ExternalProviderInterface>(
+ new ExternalProviderImpl(
+ service,
+ new ExternalPolicyLoader(profile),
+ Extension::INVALID,
+ Extension::EXTERNAL_POLICY_DOWNLOAD,
+ Extension::NO_FLAGS)));
+
+ // In tests don't install extensions from default external sources.
+ // It would only slowdown tests and make them flaky.
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableDefaultApps))
+ return;
// On Mac OS, items in /Library/... should be written by the superuser.
// Check that all components of the path are writable by root only.
@@ -385,15 +400,6 @@ void ExternalProviderImpl::CreateExternalProviders(
bundled_extension_creation_flags)));
#endif
- provider_list->push_back(
- linked_ptr<ExternalProviderInterface>(
- new ExternalProviderImpl(
- service,
- new ExternalPolicyLoader(profile),
- Extension::INVALID,
- Extension::EXTERNAL_POLICY_DOWNLOAD,
- Extension::NO_FLAGS)));
-
#if !defined(OS_CHROMEOS)
// The default apps are installed as INTERNAL but use the external
// extension installer codeflow.
« no previous file with comments | « chrome/browser/extensions/default_apps.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698