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

Side by Side Diff: chrome/browser/sync/profile_sync_service_preference_unittest.cc

Issue 11570009: Split PrefService into PrefService, PrefServiceSimple and PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head again, previous had unrelated broken win_rel test. Created 8 years 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
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 <map> 5 #include <map>
6 #include <string> 6 #include <string>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 non_default_charset_value_("foo") {} 117 non_default_charset_value_("foo") {}
118 118
119 virtual void SetUp() { 119 virtual void SetUp() {
120 AbstractProfileSyncServiceTest::SetUp(); 120 AbstractProfileSyncServiceTest::SetUp();
121 profile_.reset(new TestingProfile()); 121 profile_.reset(new TestingProfile());
122 profile_->CreateRequestContext(); 122 profile_->CreateRequestContext();
123 prefs_ = profile_->GetTestingPrefService(); 123 prefs_ = profile_->GetTestingPrefService();
124 124
125 prefs_->RegisterStringPref(not_synced_preference_name_.c_str(), 125 prefs_->RegisterStringPref(not_synced_preference_name_.c_str(),
126 not_synced_preference_default_value_, 126 not_synced_preference_default_value_,
127 PrefService::UNSYNCABLE_PREF); 127 PrefServiceSyncable::UNSYNCABLE_PREF);
128 } 128 }
129 129
130 virtual void TearDown() { 130 virtual void TearDown() {
131 profile_.reset(); 131 profile_.reset();
132 AbstractProfileSyncServiceTest::TearDown(); 132 AbstractProfileSyncServiceTest::TearDown();
133 } 133 }
134 134
135 int GetSyncPreferenceCount() { 135 int GetSyncPreferenceCount() {
136 syncer::ReadTransaction trans(FROM_HERE, sync_service_->GetUserShare()); 136 syncer::ReadTransaction trans(FROM_HERE, sync_service_->GetUserShare());
137 syncer::ReadNode node(&trans); 137 syncer::ReadNode node(&trans);
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 } 234 }
235 235
236 std::string ValueString(const Value& value) { 236 std::string ValueString(const Value& value) {
237 std::string serialized; 237 std::string serialized;
238 JSONStringValueSerializer json(&serialized); 238 JSONStringValueSerializer json(&serialized);
239 json.Serialize(value); 239 json.Serialize(value);
240 return serialized; 240 return serialized;
241 } 241 }
242 242
243 scoped_ptr<TestingProfile> profile_; 243 scoped_ptr<TestingProfile> profile_;
244 TestingPrefService* prefs_; 244 TestingPrefServiceSyncable* prefs_;
245 245
246 UIDataTypeController* dtc_; 246 UIDataTypeController* dtc_;
247 PrefModelAssociator* pref_sync_service_; 247 PrefModelAssociator* pref_sync_service_;
248 GenericChangeProcessor* change_processor_; 248 GenericChangeProcessor* change_processor_;
249 syncer::DataTypeAssociationStats association_stats_; 249 syncer::DataTypeAssociationStats association_stats_;
250 base::WeakPtrFactory<DataTypeDebugInfoListener> debug_ptr_factory_; 250 base::WeakPtrFactory<DataTypeDebugInfoListener> debug_ptr_factory_;
251 251
252 std::string example_url0_; 252 std::string example_url0_;
253 std::string example_url1_; 253 std::string example_url1_;
254 std::string example_url2_; 254 std::string example_url2_;
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 EXPECT_FALSE(pref->IsDefaultValue()); 674 EXPECT_FALSE(pref->IsDefaultValue());
675 // There should be no synced value. 675 // There should be no synced value.
676 EXPECT_TRUE(GetSyncedValue(prefs::kHomePage) == NULL); 676 EXPECT_TRUE(GetSyncedValue(prefs::kHomePage) == NULL);
677 // Switch kHomePage back to unmanaged. 677 // Switch kHomePage back to unmanaged.
678 profile_->GetTestingPrefService()->RemoveManagedPref(prefs::kHomePage); 678 profile_->GetTestingPrefService()->RemoveManagedPref(prefs::kHomePage);
679 // The original value should be picked up. 679 // The original value should be picked up.
680 EXPECT_TRUE(pref->IsDefaultValue()); 680 EXPECT_TRUE(pref->IsDefaultValue());
681 // There should still be no synced value. 681 // There should still be no synced value.
682 EXPECT_TRUE(GetSyncedValue(prefs::kHomePage) == NULL); 682 EXPECT_TRUE(GetSyncedValue(prefs::kHomePage) == NULL);
683 } 683 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_components_factory_impl.cc ('k') | chrome/browser/sync/sync_prefs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698