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

Side by Side Diff: chrome/browser/sync/glue/sync_backend_host_impl_unittest.cc

Issue 1395103003: Don't use base::MessageLoop::{Quit,QuitClosure} in chrome/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_impl.h" 5 #include "chrome/browser/sync/glue/sync_backend_host_impl.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 8
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 const char kTestProfileName[] = "test-profile"; 63 const char kTestProfileName[] = "test-profile";
64 64
65 static const base::FilePath::CharType kTestSyncDir[] = 65 static const base::FilePath::CharType kTestSyncDir[] =
66 FILE_PATH_LITERAL("sync-test"); 66 FILE_PATH_LITERAL("sync-test");
67 67
68 ACTION_P(Signal, event) { 68 ACTION_P(Signal, event) {
69 event->Signal(); 69 event->Signal();
70 } 70 }
71 71
72 void QuitMessageLoop() { 72 void QuitMessageLoop() {
73 base::MessageLoop::current()->Quit(); 73 base::MessageLoop::current()->QuitWhenIdle();
74 } 74 }
75 75
76 class MockSyncFrontend : public sync_driver::SyncFrontend { 76 class MockSyncFrontend : public sync_driver::SyncFrontend {
77 public: 77 public:
78 virtual ~MockSyncFrontend() {} 78 virtual ~MockSyncFrontend() {}
79 79
80 MOCK_METHOD4( 80 MOCK_METHOD4(
81 OnBackendInitialized, 81 OnBackendInitialized,
82 void(const syncer::WeakHandle<syncer::JsBackend>&, 82 void(const syncer::WeakHandle<syncer::JsBackend>&,
83 const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>&, 83 const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>&,
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 267
268 content::NotificationService::current()->Notify( 268 content::NotificationService::current()->Notify(
269 chrome::NOTIFICATION_SYNC_REFRESH_LOCAL, 269 chrome::NOTIFICATION_SYNC_REFRESH_LOCAL,
270 content::Source<Profile>(profile_), 270 content::Source<Profile>(profile_),
271 content::Details<syncer::ModelTypeSet>(&types)); 271 content::Details<syncer::ModelTypeSet>(&types));
272 } 272 }
273 273
274 protected: 274 protected:
275 void DownloadReady(syncer::ModelTypeSet succeeded_types, 275 void DownloadReady(syncer::ModelTypeSet succeeded_types,
276 syncer::ModelTypeSet failed_types) { 276 syncer::ModelTypeSet failed_types) {
277 base::MessageLoop::current()->Quit(); 277 base::MessageLoop::current()->QuitWhenIdle();
278 } 278 }
279 279
280 void OnDownloadRetry() { 280 void OnDownloadRetry() {
281 NOTIMPLEMENTED(); 281 NOTIMPLEMENTED();
282 } 282 }
283 283
284 content::TestBrowserThreadBundle thread_bundle_; 284 content::TestBrowserThreadBundle thread_bundle_;
285 StrictMock<MockSyncFrontend> mock_frontend_; 285 StrictMock<MockSyncFrontend> mock_frontend_;
286 syncer::SyncCredentials credentials_; 286 syncer::SyncCredentials credentials_;
287 TestingProfileManager profile_manager_; 287 TestingProfileManager profile_manager_;
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after
865 EXPECT_EQ(invalidation_versions.size(), 865 EXPECT_EQ(invalidation_versions.size(),
866 persisted_invalidation_versions.size()); 866 persisted_invalidation_versions.size());
867 for (auto iter : persisted_invalidation_versions) { 867 for (auto iter : persisted_invalidation_versions) {
868 EXPECT_EQ(invalidation_versions[iter.first], iter.second); 868 EXPECT_EQ(invalidation_versions[iter.first], iter.second);
869 } 869 }
870 } 870 }
871 871
872 } // namespace 872 } // namespace
873 873
874 } // namespace browser_sync 874 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/browser_thread_model_worker_unittest.cc ('k') | chrome/browser/sync/glue/ui_model_worker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698