| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/sync/driver/data_type_manager_impl.h" | 5 #include "components/sync/driver/data_type_manager_impl.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 // The actual test harness class, parametrized on nigori state (i.e., tests are | 255 // The actual test harness class, parametrized on nigori state (i.e., tests are |
| 256 // run both configuring with nigori, and configuring without). | 256 // run both configuring with nigori, and configuring without). |
| 257 class SyncDataTypeManagerImplTest : public testing::Test { | 257 class SyncDataTypeManagerImplTest : public testing::Test { |
| 258 public: | 258 public: |
| 259 SyncDataTypeManagerImplTest() {} | 259 SyncDataTypeManagerImplTest() {} |
| 260 | 260 |
| 261 ~SyncDataTypeManagerImplTest() override {} | 261 ~SyncDataTypeManagerImplTest() override {} |
| 262 | 262 |
| 263 protected: | 263 protected: |
| 264 void SetUp() override { | 264 void SetUp() override { |
| 265 dtm_.reset(new TestDataTypeManager(WeakHandle<DataTypeDebugInfoListener>(), | 265 dtm_ = base::MakeUnique<TestDataTypeManager>( |
| 266 &configurer_, &controllers_, | 266 WeakHandle<DataTypeDebugInfoListener>(), &configurer_, &controllers_, |
| 267 &encryption_handler_, &observer_)); | 267 &encryption_handler_, &observer_); |
| 268 } | 268 } |
| 269 | 269 |
| 270 void SetConfigureStartExpectation() { observer_.ExpectStart(); } | 270 void SetConfigureStartExpectation() { observer_.ExpectStart(); } |
| 271 | 271 |
| 272 void SetConfigureDoneExpectation(DataTypeManager::ConfigureStatus status, | 272 void SetConfigureDoneExpectation(DataTypeManager::ConfigureStatus status, |
| 273 const DataTypeStatusTable& status_table) { | 273 const DataTypeStatusTable& status_table) { |
| 274 DataTypeManager::ConfigureResult result; | 274 DataTypeManager::ConfigureResult result; |
| 275 result.status = status; | 275 result.status = status; |
| 276 result.data_type_status_table = status_table; | 276 result.data_type_status_table = status_table; |
| 277 observer_.ExpectDone(result); | 277 observer_.ExpectDone(result); |
| (...skipping 1392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1670 GetController(PASSWORDS)->state()); | 1670 GetController(PASSWORDS)->state()); |
| 1671 EXPECT_EQ(0, GetController(BOOKMARKS)->register_with_backend_call_count()); | 1671 EXPECT_EQ(0, GetController(BOOKMARKS)->register_with_backend_call_count()); |
| 1672 EXPECT_EQ(0, GetController(PASSWORDS)->register_with_backend_call_count()); | 1672 EXPECT_EQ(0, GetController(PASSWORDS)->register_with_backend_call_count()); |
| 1673 | 1673 |
| 1674 dtm_->OnAllDataTypesReadyForConfigure(); | 1674 dtm_->OnAllDataTypesReadyForConfigure(); |
| 1675 EXPECT_EQ(0, GetController(BOOKMARKS)->register_with_backend_call_count()); | 1675 EXPECT_EQ(0, GetController(BOOKMARKS)->register_with_backend_call_count()); |
| 1676 EXPECT_EQ(1, GetController(PASSWORDS)->register_with_backend_call_count()); | 1676 EXPECT_EQ(1, GetController(PASSWORDS)->register_with_backend_call_count()); |
| 1677 } | 1677 } |
| 1678 | 1678 |
| 1679 } // namespace syncer | 1679 } // namespace syncer |
| OLD | NEW |