| 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 EXPECT_CALL(*components, CreateSharedChangeProcessor()). | 175 EXPECT_CALL(*components, CreateSharedChangeProcessor()). |
| 176 WillOnce(Return(new SharedChangeProcessor())); | 176 WillOnce(Return(new SharedChangeProcessor())); |
| 177 EXPECT_CALL(*components, CreateGenericChangeProcessor(_, _, _, _)). | 177 EXPECT_CALL(*components, CreateGenericChangeProcessor(_, _, _, _)). |
| 178 WillOnce(CreateAndSaveChangeProcessor( | 178 WillOnce(CreateAndSaveChangeProcessor( |
| 179 &change_processor_)); | 179 &change_processor_)); |
| 180 sync_service_->RegisterDataTypeController(dtc_); | 180 sync_service_->RegisterDataTypeController(dtc_); |
| 181 TokenServiceFactory::GetForProfile(profile_.get())->IssueAuthTokenForTest( | 181 TokenServiceFactory::GetForProfile(profile_.get())->IssueAuthTokenForTest( |
| 182 GaiaConstants::kSyncService, "token"); | 182 GaiaConstants::kSyncService, "token"); |
| 183 | 183 |
| 184 sync_service_->Initialize(); | 184 sync_service_->Initialize(); |
| 185 MessageLoop::current()->Run(); | 185 base::MessageLoop::current()->Run(); |
| 186 | 186 |
| 187 // It's possible this test triggered an unrecoverable error, in which case | 187 // It's possible this test triggered an unrecoverable error, in which case |
| 188 // we can't get the preference count. | 188 // we can't get the preference count. |
| 189 if (sync_service_->ShouldPushChanges()) { | 189 if (sync_service_->ShouldPushChanges()) { |
| 190 EXPECT_EQ(GetSyncPreferenceCount(), | 190 EXPECT_EQ(GetSyncPreferenceCount(), |
| 191 association_stats_.num_sync_items_after_association); | 191 association_stats_.num_sync_items_after_association); |
| 192 } | 192 } |
| 193 EXPECT_EQ(association_stats_.num_sync_items_after_association, | 193 EXPECT_EQ(association_stats_.num_sync_items_after_association, |
| 194 association_stats_.num_sync_items_before_association + | 194 association_stats_.num_sync_items_before_association + |
| 195 association_stats_.num_sync_items_added - | 195 association_stats_.num_sync_items_added - |
| (...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 677 EXPECT_FALSE(pref->IsDefaultValue()); | 677 EXPECT_FALSE(pref->IsDefaultValue()); |
| 678 // There should be no synced value. | 678 // There should be no synced value. |
| 679 EXPECT_TRUE(GetSyncedValue(prefs::kHomePage) == NULL); | 679 EXPECT_TRUE(GetSyncedValue(prefs::kHomePage) == NULL); |
| 680 // Switch kHomePage back to unmanaged. | 680 // Switch kHomePage back to unmanaged. |
| 681 profile_->GetTestingPrefService()->RemoveManagedPref(prefs::kHomePage); | 681 profile_->GetTestingPrefService()->RemoveManagedPref(prefs::kHomePage); |
| 682 // The original value should be picked up. | 682 // The original value should be picked up. |
| 683 EXPECT_TRUE(pref->IsDefaultValue()); | 683 EXPECT_TRUE(pref->IsDefaultValue()); |
| 684 // There should still be no synced value. | 684 // There should still be no synced value. |
| 685 EXPECT_TRUE(GetSyncedValue(prefs::kHomePage) == NULL); | 685 EXPECT_TRUE(GetSyncedValue(prefs::kHomePage) == NULL); |
| 686 } | 686 } |
| OLD | NEW |