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

Unified Diff: chrome/test/base/testing_profile.cc

Issue 8060017: Ensure that --disable-extensions disables extension prefs from being enacted (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Split ExtensionPrefs constructor into constructor and Init function Created 9 years, 3 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
« no previous file with comments | « chrome/browser/ui/cocoa/extensions/extension_popup_controller_unittest.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/base/testing_profile.cc
diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc
index 8c1334596d86e7e32f61dde750e3e5bb4b45651a..d32dcf3f5cd3ba4b04709186dae891cf9c74a1b3 100644
--- a/chrome/test/base/testing_profile.cc
+++ b/chrome/test/base/testing_profile.cc
@@ -41,6 +41,7 @@
#include "chrome/browser/ui/webui/chrome_url_data_manager.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_notification_types.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/url_constants.h"
#include "chrome/test/base/bookmark_load_observer.h"
#include "chrome/test/base/test_url_request_context_getter.h"
@@ -342,6 +343,10 @@ ExtensionService* TestingProfile::CreateExtensionService(
// Extension pref store, created for use by |extension_prefs_|.
extension_pref_value_map_.reset(new ExtensionPrefValueMap);
+
+ bool extensions_disabled =
+ command_line && command_line->HasSwitch(switches::kDisableExtensions);
+
// Note that the GetPrefs() creates a TestingPrefService, therefore
// the extension controlled pref values set in extension_prefs_
// are not reflected in the pref service. One would need to
@@ -350,6 +355,7 @@ ExtensionService* TestingProfile::CreateExtensionService(
new ExtensionPrefs(GetPrefs(),
install_directory,
extension_pref_value_map_.get()));
+ extension_prefs_->Init(extensions_disabled);
extension_service_.reset(new ExtensionService(this,
command_line,
install_directory,
« no previous file with comments | « chrome/browser/ui/cocoa/extensions/extension_popup_controller_unittest.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698