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

Side by Side Diff: chrome/browser/sync/glue/sync_backend_host_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 "chrome/browser/sync/glue/sync_backend_host.h" 5 #include "chrome/browser/sync/glue/sync_backend_host.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 8
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 namespace browser_sync { 47 namespace browser_sync {
48 48
49 namespace { 49 namespace {
50 50
51 ACTION_P(Signal, event) { 51 ACTION_P(Signal, event) {
52 event->Signal(); 52 event->Signal();
53 } 53 }
54 54
55 void QuitMessageLoop() { 55 void QuitMessageLoop() {
56 MessageLoop::current()->Quit(); 56 base::MessageLoop::current()->Quit();
57 } 57 }
58 58
59 class MockSyncFrontend : public SyncFrontend { 59 class MockSyncFrontend : public SyncFrontend {
60 public: 60 public:
61 virtual ~MockSyncFrontend() {} 61 virtual ~MockSyncFrontend() {}
62 62
63 MOCK_METHOD1(OnInvalidatorStateChange, 63 MOCK_METHOD1(OnInvalidatorStateChange,
64 void(syncer::InvalidatorState)); 64 void(syncer::InvalidatorState));
65 MOCK_METHOD1(OnIncomingInvalidation, 65 MOCK_METHOD1(OnIncomingInvalidation,
66 void(const syncer::ObjectIdInvalidationMap&)); 66 void(const syncer::ObjectIdInvalidationMap&));
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 content::NotificationService::current()->Notify( 242 content::NotificationService::current()->Notify(
243 chrome::NOTIFICATION_SYNC_REFRESH_LOCAL, 243 chrome::NOTIFICATION_SYNC_REFRESH_LOCAL,
244 content::Source<Profile>(profile_.get()), 244 content::Source<Profile>(profile_.get()),
245 content::Details<syncer::ModelTypeInvalidationMap>( 245 content::Details<syncer::ModelTypeInvalidationMap>(
246 &invalidation_map)); 246 &invalidation_map));
247 } 247 }
248 248
249 protected: 249 protected:
250 void DownloadReady(syncer::ModelTypeSet succeeded_types, 250 void DownloadReady(syncer::ModelTypeSet succeeded_types,
251 syncer::ModelTypeSet failed_types) { 251 syncer::ModelTypeSet failed_types) {
252 MessageLoop::current()->Quit(); 252 base::MessageLoop::current()->Quit();
253 } 253 }
254 254
255 void OnDownloadRetry() { 255 void OnDownloadRetry() {
256 NOTIMPLEMENTED(); 256 NOTIMPLEMENTED();
257 } 257 }
258 258
259 MessageLoop ui_loop_; 259 base::MessageLoop ui_loop_;
260 content::TestBrowserThread ui_thread_; 260 content::TestBrowserThread ui_thread_;
261 content::TestBrowserThread io_thread_; 261 content::TestBrowserThread io_thread_;
262 StrictMock<MockSyncFrontend> mock_frontend_; 262 StrictMock<MockSyncFrontend> mock_frontend_;
263 syncer::SyncCredentials credentials_; 263 syncer::SyncCredentials credentials_;
264 syncer::TestUnrecoverableErrorHandler handler_; 264 syncer::TestUnrecoverableErrorHandler handler_;
265 scoped_ptr<TestingProfile> profile_; 265 scoped_ptr<TestingProfile> profile_;
266 scoped_ptr<SyncPrefs> sync_prefs_; 266 scoped_ptr<SyncPrefs> sync_prefs_;
267 scoped_ptr<invalidation::InvalidatorStorage> invalidator_storage_; 267 scoped_ptr<invalidation::InvalidatorStorage> invalidator_storage_;
268 scoped_ptr<SyncBackendHost> backend_; 268 scoped_ptr<SyncBackendHost> backend_;
269 FakeSyncManager* fake_manager_; 269 FakeSyncManager* fake_manager_;
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
760 TEST_F(SyncBackendHostTest, DownloadControlTypesRestart) { 760 TEST_F(SyncBackendHostTest, DownloadControlTypesRestart) {
761 sync_prefs_->SetSyncSetupCompleted(); 761 sync_prefs_->SetSyncSetupCompleted();
762 InitializeBackend(true); 762 InitializeBackend(true);
763 EXPECT_EQ(syncer::CONFIGURE_REASON_NEWLY_ENABLED_DATA_TYPE, 763 EXPECT_EQ(syncer::CONFIGURE_REASON_NEWLY_ENABLED_DATA_TYPE,
764 fake_manager_->GetAndResetConfigureReason()); 764 fake_manager_->GetAndResetConfigureReason());
765 } 765 }
766 766
767 } // namespace 767 } // namespace
768 768
769 } // namespace browser_sync 769 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/sync_backend_host.cc ('k') | chrome/browser/sync/glue/sync_backend_registrar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698