Index: chrome/test/testing_profile.cc |
diff --git a/chrome/test/testing_profile.cc b/chrome/test/testing_profile.cc |
index 3c37562e4a1c261afd91672cd38f8df4f88beacc..b73d2018f735f6d2ccfcd7c4ab80a374c1d24c71 100644 |
--- a/chrome/test/testing_profile.cc |
+++ b/chrome/test/testing_profile.cc |
@@ -30,6 +30,7 @@ |
#include "chrome/browser/net/pref_proxy_config_service.h" |
#include "chrome/browser/notifications/desktop_notification_service.h" |
#include "chrome/browser/prefs/browser_prefs.h" |
+#include "chrome/browser/prefs/testing_pref_store.h" |
#include "chrome/browser/search_engines/template_url_fetcher.h" |
#include "chrome/browser/search_engines/template_url_model.h" |
#include "chrome/browser/sessions/session_service.h" |
@@ -48,7 +49,6 @@ |
#include "net/url_request/url_request_unittest.h" |
#include "testing/gmock/include/gmock/gmock.h" |
#include "webkit/database/database_tracker.h" |
- |
#if defined(OS_LINUX) && !defined(TOOLKIT_VIEWS) |
#include "chrome/browser/gtk/gtk_theme_provider.h" |
#endif |
@@ -329,15 +329,27 @@ void TestingProfile::UseThemeProvider(BrowserThemeProvider* theme_provider) { |
scoped_refptr<ExtensionService> TestingProfile::CreateExtensionService( |
const CommandLine* command_line, |
const FilePath& install_directory) { |
- extension_pref_store_.reset(new ExtensionPrefStore); |
- extension_prefs_.reset(new ExtensionPrefs(GetPrefs(), |
- install_directory, |
- extension_pref_store_.get())); |
+ // Extension pref store, created for use by |extension_prefs_|. |
+ scoped_refptr<ExtensionPrefStore> extension_pref_store = NULL; |
+ scoped_refptr<ExtensionPrefStore> incognito_extension_pref_store; |
+ |
+ if (testing_prefs_) { |
Mattias Nissler (ping if slow)
2010/12/20 14:50:02
Why this conditional? GetPrefs() should suffice.
battre
2010/12/21 18:51:59
Some mock classes derived from TestingProfile do n
|
+ extension_pref_store = testing_prefs_->GetExtensionPrefs(); |
+ incognito_extension_pref_store = new ExtensionPrefStore; |
+ incognito_prefs_.reset( |
+ GetPrefs()->CreateIncognitoPrefService(incognito_extension_pref_store)); |
+ } |
+ extension_prefs_.reset( |
+ new ExtensionPrefs(GetPrefs(), |
+ incognito_prefs_.get(), |
+ install_directory, |
+ extension_pref_store, |
+ incognito_extension_pref_store)); |
extensions_service_ = new ExtensionService(this, |
- command_line, |
- install_directory, |
- extension_prefs_.get(), |
- false); |
+ command_line, |
+ install_directory, |
+ extension_prefs_.get(), |
+ false); |
return extensions_service_; |
} |
@@ -388,7 +400,7 @@ void TestingProfile::SetPrefService(PrefService* prefs) { |
void TestingProfile::CreateTestingPrefService() { |
DCHECK(!prefs_.get()); |
- testing_prefs_ = new TestingPrefService(); |
+ testing_prefs_ = TestingPrefService::CreateTestingPrefService(); |
prefs_.reset(testing_prefs_); |
Profile::RegisterUserPrefs(prefs_.get()); |
browser::RegisterAllPrefs(prefs_.get(), prefs_.get()); |