| Index: chrome/test/testing_profile.cc
|
| diff --git a/chrome/test/testing_profile.cc b/chrome/test/testing_profile.cc
|
| index 3839847742f1fe3273f031d7875ef8b6cefd0643..f70aa162a15029d3d8878d24e20c1bc67dab40a6 100644
|
| --- a/chrome/test/testing_profile.cc
|
| +++ b/chrome/test/testing_profile.cc
|
| @@ -494,10 +494,14 @@ void TestingProfile::SetPrefService(PrefService* prefs) {
|
|
|
| void TestingProfile::CreateTestingPrefService() {
|
| DCHECK(!prefs_.get());
|
| - testing_prefs_ = new TestingPrefService();
|
| - prefs_.reset(testing_prefs_);
|
| + if (!prefs_.get()) {
|
| + testing_prefs_ = new TestingPrefService();
|
| + prefs_.reset(testing_prefs_);
|
| + }
|
| Profile::RegisterUserPrefs(prefs_.get());
|
| - browser::RegisterAllPrefs(prefs_.get(), prefs_.get());
|
| + if (!local_state_.get())
|
| + local_state_.reset(new TestingPrefService());
|
| + browser::RegisterAllPrefs(prefs_.get(), local_state_.get());
|
| }
|
|
|
| PrefService* TestingProfile::GetPrefs() {
|
| @@ -507,6 +511,18 @@ PrefService* TestingProfile::GetPrefs() {
|
| return prefs_.get();
|
| }
|
|
|
| +PrefService* TestingProfile::GetLocalState() {
|
| + if (!local_state_.get()) {
|
| + CreateTestingPrefService();
|
| + }
|
| + return local_state_.get();
|
| +}
|
| +
|
| +void TestingProfile::SetLocalState(PrefService* local_state) {
|
| + DCHECK(!local_state_.get());
|
| + local_state_.reset(local_state);
|
| +}
|
| +
|
| TemplateURLModel* TestingProfile::GetTemplateURLModel() {
|
| return template_url_model_.get();
|
| }
|
|
|