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

Side by Side Diff: chrome/test/base/testing_profile.cc

Issue 12315053: Fix prefs registration in SyncPrefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/sync/sync_prefs_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/test/base/testing_profile.h" 5 #include "chrome/test/base/testing_profile.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #include "base/base_paths.h" 9 #include "base/base_paths.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 policy_service_.reset(new policy::PolicyServiceStub()); 549 policy_service_.reset(new policy::PolicyServiceStub());
550 #endif 550 #endif
551 } 551 }
552 return policy_service_.get(); 552 return policy_service_.get();
553 } 553 }
554 554
555 void TestingProfile::CreateTestingPrefService() { 555 void TestingProfile::CreateTestingPrefService() {
556 DCHECK(!prefs_.get()); 556 DCHECK(!prefs_.get());
557 testing_prefs_ = new TestingPrefServiceSyncable(); 557 testing_prefs_ = new TestingPrefServiceSyncable();
558 prefs_.reset(testing_prefs_); 558 prefs_.reset(testing_prefs_);
559 Profile::RegisterUserPrefs(testing_prefs_->registry());
560 chrome::RegisterUserPrefs(testing_prefs_, testing_prefs_->registry()); 559 chrome::RegisterUserPrefs(testing_prefs_, testing_prefs_->registry());
561 } 560 }
562 561
563 PrefService* TestingProfile::GetPrefs() { 562 PrefService* TestingProfile::GetPrefs() {
564 if (!prefs_.get()) { 563 if (!prefs_.get()) {
565 CreateTestingPrefService(); 564 CreateTestingPrefService();
566 } 565 }
567 return prefs_.get(); 566 return prefs_.get();
568 } 567 }
569 568
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 809
811 scoped_ptr<TestingProfile> TestingProfile::Builder::Build() { 810 scoped_ptr<TestingProfile> TestingProfile::Builder::Build() {
812 DCHECK(!build_called_); 811 DCHECK(!build_called_);
813 build_called_ = true; 812 build_called_ = true;
814 return scoped_ptr<TestingProfile>(new TestingProfile( 813 return scoped_ptr<TestingProfile>(new TestingProfile(
815 path_, 814 path_,
816 delegate_, 815 delegate_,
817 extension_policy_, 816 extension_policy_,
818 pref_service_.Pass())); 817 pref_service_.Pass()));
819 } 818 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/sync_prefs_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698