OLD | NEW |
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/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 FILE_PATH_LITERAL("sync-test"); | 65 FILE_PATH_LITERAL("sync-test"); |
66 | 66 |
67 ACTION_P(Signal, event) { | 67 ACTION_P(Signal, event) { |
68 event->Signal(); | 68 event->Signal(); |
69 } | 69 } |
70 | 70 |
71 void QuitMessageLoop() { | 71 void QuitMessageLoop() { |
72 base::MessageLoop::current()->Quit(); | 72 base::MessageLoop::current()->Quit(); |
73 } | 73 } |
74 | 74 |
75 class MockSyncFrontend : public SyncFrontend { | 75 class MockSyncFrontend : public sync_driver::SyncFrontend { |
76 public: | 76 public: |
77 virtual ~MockSyncFrontend() {} | 77 virtual ~MockSyncFrontend() {} |
78 | 78 |
79 MOCK_METHOD4( | 79 MOCK_METHOD4( |
80 OnBackendInitialized, | 80 OnBackendInitialized, |
81 void(const syncer::WeakHandle<syncer::JsBackend>&, | 81 void(const syncer::WeakHandle<syncer::JsBackend>&, |
82 const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>&, | 82 const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>&, |
83 const std::string&, | 83 const std::string&, |
84 bool)); | 84 bool)); |
85 MOCK_METHOD0(OnSyncCycleCompleted, void()); | 85 MOCK_METHOD0(OnSyncCycleCompleted, void()); |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 // |fake_manager_factory_|'s fake_manager() is set on the sync | 230 // |fake_manager_factory_|'s fake_manager() is set on the sync |
231 // thread, but we can rely on the message loop barriers to | 231 // thread, but we can rely on the message loop barriers to |
232 // guarantee that we see the updated value. | 232 // guarantee that we see the updated value. |
233 DCHECK(fake_manager_); | 233 DCHECK(fake_manager_); |
234 } | 234 } |
235 | 235 |
236 // Synchronously configures the backend's datatypes. | 236 // Synchronously configures the backend's datatypes. |
237 void ConfigureDataTypes(syncer::ModelTypeSet types_to_add, | 237 void ConfigureDataTypes(syncer::ModelTypeSet types_to_add, |
238 syncer::ModelTypeSet types_to_remove, | 238 syncer::ModelTypeSet types_to_remove, |
239 syncer::ModelTypeSet types_to_unapply) { | 239 syncer::ModelTypeSet types_to_unapply) { |
240 BackendDataTypeConfigurer::DataTypeConfigStateMap config_state_map; | 240 sync_driver::BackendDataTypeConfigurer::DataTypeConfigStateMap |
241 BackendDataTypeConfigurer::SetDataTypesState( | 241 config_state_map; |
242 BackendDataTypeConfigurer::CONFIGURE_ACTIVE, | 242 sync_driver::BackendDataTypeConfigurer::SetDataTypesState( |
| 243 sync_driver::BackendDataTypeConfigurer::CONFIGURE_ACTIVE, |
243 types_to_add, | 244 types_to_add, |
244 &config_state_map); | 245 &config_state_map); |
245 BackendDataTypeConfigurer::SetDataTypesState( | 246 sync_driver::BackendDataTypeConfigurer::SetDataTypesState( |
246 BackendDataTypeConfigurer::DISABLED, | 247 sync_driver::BackendDataTypeConfigurer::DISABLED, |
247 types_to_remove, &config_state_map); | 248 types_to_remove, &config_state_map); |
248 BackendDataTypeConfigurer::SetDataTypesState( | 249 sync_driver::BackendDataTypeConfigurer::SetDataTypesState( |
249 BackendDataTypeConfigurer::UNREADY, | 250 sync_driver::BackendDataTypeConfigurer::UNREADY, |
250 types_to_unapply, &config_state_map); | 251 types_to_unapply, &config_state_map); |
251 | 252 |
252 types_to_add.PutAll(syncer::ControlTypes()); | 253 types_to_add.PutAll(syncer::ControlTypes()); |
253 backend_->ConfigureDataTypes( | 254 backend_->ConfigureDataTypes( |
254 syncer::CONFIGURE_REASON_RECONFIGURATION, | 255 syncer::CONFIGURE_REASON_RECONFIGURATION, |
255 config_state_map, | 256 config_state_map, |
256 base::Bind(&SyncBackendHostTest::DownloadReady, | 257 base::Bind(&SyncBackendHostTest::DownloadReady, |
257 base::Unretained(this)), | 258 base::Unretained(this)), |
258 base::Bind(&SyncBackendHostTest::OnDownloadRetry, | 259 base::Bind(&SyncBackendHostTest::OnDownloadRetry, |
259 base::Unretained(this))); | 260 base::Unretained(this))); |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 Difference(syncer::ModelTypeSet::All(), | 779 Difference(syncer::ModelTypeSet::All(), |
779 enabled_types_), | 780 enabled_types_), |
780 syncer::ModelTypeSet()); | 781 syncer::ModelTypeSet()); |
781 EXPECT_FALSE(fake_manager_->GetTypesWithEmptyProgressMarkerToken( | 782 EXPECT_FALSE(fake_manager_->GetTypesWithEmptyProgressMarkerToken( |
782 error_types).Empty()); | 783 error_types).Empty()); |
783 } | 784 } |
784 | 785 |
785 } // namespace | 786 } // namespace |
786 | 787 |
787 } // namespace browser_sync | 788 } // namespace browser_sync |
OLD | NEW |