| 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 "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 Loading... |
| 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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 | 241 |
| 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 types) { | 250 void DownloadReady(syncer::ModelTypeSet types) { |
| 251 MessageLoop::current()->Quit(); | 251 base::MessageLoop::current()->Quit(); |
| 252 } | 252 } |
| 253 | 253 |
| 254 void OnDownloadRetry() { | 254 void OnDownloadRetry() { |
| 255 NOTIMPLEMENTED(); | 255 NOTIMPLEMENTED(); |
| 256 } | 256 } |
| 257 | 257 |
| 258 MessageLoop ui_loop_; | 258 base::MessageLoop ui_loop_; |
| 259 content::TestBrowserThread ui_thread_; | 259 content::TestBrowserThread ui_thread_; |
| 260 content::TestBrowserThread io_thread_; | 260 content::TestBrowserThread io_thread_; |
| 261 StrictMock<MockSyncFrontend> mock_frontend_; | 261 StrictMock<MockSyncFrontend> mock_frontend_; |
| 262 syncer::SyncCredentials credentials_; | 262 syncer::SyncCredentials credentials_; |
| 263 syncer::TestUnrecoverableErrorHandler handler_; | 263 syncer::TestUnrecoverableErrorHandler handler_; |
| 264 scoped_ptr<TestingProfile> profile_; | 264 scoped_ptr<TestingProfile> profile_; |
| 265 scoped_ptr<SyncPrefs> sync_prefs_; | 265 scoped_ptr<SyncPrefs> sync_prefs_; |
| 266 scoped_ptr<InvalidatorStorage> invalidator_storage_; | 266 scoped_ptr<InvalidatorStorage> invalidator_storage_; |
| 267 scoped_ptr<SyncBackendHost> backend_; | 267 scoped_ptr<SyncBackendHost> backend_; |
| 268 FakeSyncManager* fake_manager_; | 268 FakeSyncManager* fake_manager_; |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 744 fake_manager_->WaitForSyncThread(); | 744 fake_manager_->WaitForSyncThread(); |
| 745 EXPECT_FALSE(types.Equals(fake_manager_->GetLastRefreshRequestTypes())); | 745 EXPECT_FALSE(types.Equals(fake_manager_->GetLastRefreshRequestTypes())); |
| 746 | 746 |
| 747 backend_->Shutdown(false); | 747 backend_->Shutdown(false); |
| 748 backend_.reset(); | 748 backend_.reset(); |
| 749 } | 749 } |
| 750 | 750 |
| 751 } // namespace | 751 } // namespace |
| 752 | 752 |
| 753 } // namespace browser_sync | 753 } // namespace browser_sync |
| OLD | NEW |