OLD | NEW |
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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 | 120 |
121 virtual void SetUp() { | 121 virtual void SetUp() { |
122 AbstractProfileSyncServiceTest::SetUp(); | 122 AbstractProfileSyncServiceTest::SetUp(); |
123 profile_.reset(new TestingProfile()); | 123 profile_.reset(new TestingProfile()); |
124 profile_->CreateRequestContext(); | 124 profile_->CreateRequestContext(); |
125 prefs_ = profile_->GetTestingPrefService(); | 125 prefs_ = profile_->GetTestingPrefService(); |
126 | 126 |
127 prefs_->registry()->RegisterStringPref( | 127 prefs_->registry()->RegisterStringPref( |
128 not_synced_preference_name_.c_str(), | 128 not_synced_preference_name_.c_str(), |
129 not_synced_preference_default_value_, | 129 not_synced_preference_default_value_, |
130 PrefRegistrySyncable::UNSYNCABLE_PREF); | 130 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
131 } | 131 } |
132 | 132 |
133 virtual void TearDown() { | 133 virtual void TearDown() { |
134 profile_.reset(); | 134 profile_.reset(); |
135 AbstractProfileSyncServiceTest::TearDown(); | 135 AbstractProfileSyncServiceTest::TearDown(); |
136 } | 136 } |
137 | 137 |
138 int GetSyncPreferenceCount() { | 138 int GetSyncPreferenceCount() { |
139 syncer::ReadTransaction trans(FROM_HERE, sync_service_->GetUserShare()); | 139 syncer::ReadTransaction trans(FROM_HERE, sync_service_->GetUserShare()); |
140 syncer::ReadNode node(&trans); | 140 syncer::ReadNode node(&trans); |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 EXPECT_FALSE(pref->IsDefaultValue()); | 676 EXPECT_FALSE(pref->IsDefaultValue()); |
677 // There should be no synced value. | 677 // There should be no synced value. |
678 EXPECT_TRUE(GetSyncedValue(prefs::kHomePage) == NULL); | 678 EXPECT_TRUE(GetSyncedValue(prefs::kHomePage) == NULL); |
679 // Switch kHomePage back to unmanaged. | 679 // Switch kHomePage back to unmanaged. |
680 profile_->GetTestingPrefService()->RemoveManagedPref(prefs::kHomePage); | 680 profile_->GetTestingPrefService()->RemoveManagedPref(prefs::kHomePage); |
681 // The original value should be picked up. | 681 // The original value should be picked up. |
682 EXPECT_TRUE(pref->IsDefaultValue()); | 682 EXPECT_TRUE(pref->IsDefaultValue()); |
683 // There should still be no synced value. | 683 // There should still be no synced value. |
684 EXPECT_TRUE(GetSyncedValue(prefs::kHomePage) == NULL); | 684 EXPECT_TRUE(GetSyncedValue(prefs::kHomePage) == NULL); |
685 } | 685 } |
OLD | NEW |