| 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/shared_change_processor.h" | 5 #include "chrome/browser/sync/glue/shared_change_processor.h" |
| 6 | 6 |
| 7 #include <cstddef> | 7 #include <cstddef> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 base::Bind(&SyncSharedChangeProcessorTest::ConnectOnDBThread, | 79 base::Bind(&SyncSharedChangeProcessorTest::ConnectOnDBThread, |
| 80 base::Unretained(this), | 80 base::Unretained(this), |
| 81 shared_change_processor_))); | 81 shared_change_processor_))); |
| 82 } | 82 } |
| 83 | 83 |
| 84 private: | 84 private: |
| 85 // Used by SetUp(). | 85 // Used by SetUp(). |
| 86 void SetUpDBSyncableService() { | 86 void SetUpDBSyncableService() { |
| 87 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); | 87 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); |
| 88 DCHECK(!db_syncable_service_.get()); | 88 DCHECK(!db_syncable_service_.get()); |
| 89 db_syncable_service_.reset(new FakeSyncableService()); | 89 db_syncable_service_.reset(new csync::FakeSyncableService()); |
| 90 } | 90 } |
| 91 | 91 |
| 92 // Used by TearDown(). | 92 // Used by TearDown(). |
| 93 void TearDownDBSyncableService() { | 93 void TearDownDBSyncableService() { |
| 94 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); | 94 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); |
| 95 DCHECK(db_syncable_service_.get()); | 95 DCHECK(db_syncable_service_.get()); |
| 96 db_syncable_service_.reset(); | 96 db_syncable_service_.reset(); |
| 97 } | 97 } |
| 98 | 98 |
| 99 // Used by Connect(). The SharedChangeProcessor is passed in | 99 // Used by Connect(). The SharedChangeProcessor is passed in |
| (...skipping 13 matching lines...) Expand all Loading... |
| 113 MessageLoopForUI ui_loop_; | 113 MessageLoopForUI ui_loop_; |
| 114 content::TestBrowserThread ui_thread_; | 114 content::TestBrowserThread ui_thread_; |
| 115 content::TestBrowserThread db_thread_; | 115 content::TestBrowserThread db_thread_; |
| 116 | 116 |
| 117 scoped_refptr<SharedChangeProcessor> shared_change_processor_; | 117 scoped_refptr<SharedChangeProcessor> shared_change_processor_; |
| 118 NiceMock<ProfileSyncComponentsFactoryMock> sync_factory_; | 118 NiceMock<ProfileSyncComponentsFactoryMock> sync_factory_; |
| 119 NiceMock<ProfileSyncServiceMock> sync_service_; | 119 NiceMock<ProfileSyncServiceMock> sync_service_; |
| 120 StrictMock<DataTypeErrorHandlerMock> error_handler_; | 120 StrictMock<DataTypeErrorHandlerMock> error_handler_; |
| 121 | 121 |
| 122 // Used only on DB thread. | 122 // Used only on DB thread. |
| 123 scoped_ptr<FakeSyncableService> db_syncable_service_; | 123 scoped_ptr<csync::FakeSyncableService> db_syncable_service_; |
| 124 }; | 124 }; |
| 125 | 125 |
| 126 // Simply connect the shared change processor. It should succeed, and | 126 // Simply connect the shared change processor. It should succeed, and |
| 127 // nothing further should happen. | 127 // nothing further should happen. |
| 128 TEST_F(SyncSharedChangeProcessorTest, Basic) { | 128 TEST_F(SyncSharedChangeProcessorTest, Basic) { |
| 129 Connect(); | 129 Connect(); |
| 130 } | 130 } |
| 131 | 131 |
| 132 } // namespace | 132 } // namespace |
| 133 | 133 |
| 134 } // namespace browser_sync | 134 } // namespace browser_sync |
| OLD | NEW |