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

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

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 7 years, 6 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
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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698