| Index: components/sync/driver/data_type_manager_impl_unittest.cc
|
| diff --git a/components/sync/driver/data_type_manager_impl_unittest.cc b/components/sync/driver/data_type_manager_impl_unittest.cc
|
| index 52ecd5826daf1ab2fe47939587520abeacfc1517..af1bf7ec100e6e6d652f9d06715ac79f9a1ec98c 100644
|
| --- a/components/sync/driver/data_type_manager_impl_unittest.cc
|
| +++ b/components/sync/driver/data_type_manager_impl_unittest.cc
|
| @@ -5,7 +5,6 @@
|
| #include "components/sync/driver/data_type_manager_impl.h"
|
|
|
| #include <memory>
|
| -#include <utility>
|
|
|
| #include "base/memory/ptr_util.h"
|
| #include "base/message_loop/message_loop.h"
|
| @@ -81,15 +80,6 @@
|
| last_params_ = std::move(params);
|
| }
|
|
|
| - void RegisterDirectoryDataType(ModelType type,
|
| - ModelSafeGroup group) override {
|
| - registered_directory_types_.Put(type);
|
| - }
|
| -
|
| - void UnregisterDirectoryDataType(ModelType type) override {
|
| - registered_directory_types_.Remove(type);
|
| - }
|
| -
|
| void ActivateDirectoryDataType(ModelType type,
|
| ModelSafeGroup group,
|
| ChangeProcessor* change_processor) override {
|
| @@ -110,10 +100,6 @@
|
| // TODO(stanisc): crbug.com/515962: Add test coverage.
|
| }
|
|
|
| - const ModelTypeSet registered_directory_types() {
|
| - return registered_directory_types_;
|
| - }
|
| -
|
| const ModelTypeSet activated_types() { return activated_types_; }
|
|
|
| int configure_call_count() const { return configure_call_count_; }
|
| @@ -121,7 +107,6 @@
|
| const ConfigureParams& last_params() const { return last_params_; }
|
|
|
| private:
|
| - ModelTypeSet registered_directory_types_;
|
| ModelTypeSet activated_types_;
|
| int configure_call_count_ = 0;
|
| ConfigureParams last_params_;
|
| @@ -357,7 +342,6 @@
|
|
|
| Configure(ModelTypeSet(BOOKMARKS));
|
| EXPECT_EQ(DataTypeManager::CONFIGURING, dtm_->state());
|
| - EXPECT_EQ(ModelTypeSet(BOOKMARKS), configurer_.registered_directory_types());
|
|
|
| FinishDownload(ModelTypeSet(), ModelTypeSet());
|
| FinishDownload(ModelTypeSet(BOOKMARKS), ModelTypeSet());
|
| @@ -370,7 +354,6 @@
|
| dtm_->Stop();
|
| EXPECT_EQ(DataTypeManager::STOPPED, dtm_->state());
|
| EXPECT_TRUE(configurer_.activated_types().Empty());
|
| - EXPECT_TRUE(configurer_.registered_directory_types().Empty());
|
| }
|
|
|
| // Set up a DTM with a single controller, configure it, but stop it
|
| @@ -386,12 +369,9 @@
|
|
|
| Configure(ModelTypeSet(BOOKMARKS));
|
| EXPECT_EQ(DataTypeManager::CONFIGURING, dtm_->state());
|
| - EXPECT_EQ(ModelTypeSet(BOOKMARKS),
|
| - configurer_.registered_directory_types());
|
|
|
| dtm_->Stop();
|
| EXPECT_EQ(DataTypeManager::STOPPED, dtm_->state());
|
| - EXPECT_TRUE(configurer_.registered_directory_types().Empty());
|
| }
|
|
|
| last_configure_params().ready_task.Run(ModelTypeSet(BOOKMARKS),
|
| @@ -413,15 +393,13 @@
|
|
|
| Configure(ModelTypeSet(BOOKMARKS));
|
| EXPECT_EQ(DataTypeManager::CONFIGURING, dtm_->state());
|
| - EXPECT_EQ(ModelTypeSet(BOOKMARKS),
|
| - configurer_.registered_directory_types());
|
| +
|
| FinishDownload(ModelTypeSet(), ModelTypeSet());
|
| FinishDownload(ModelTypeSet(BOOKMARKS), ModelTypeSet());
|
| EXPECT_EQ(DataTypeManager::CONFIGURING, dtm_->state());
|
|
|
| dtm_->Stop();
|
| EXPECT_EQ(DataTypeManager::STOPPED, dtm_->state());
|
| - EXPECT_TRUE(configurer_.registered_directory_types().Empty());
|
| dtm_.reset();
|
| }
|
|
|
| @@ -444,8 +422,6 @@
|
|
|
| Configure(ModelTypeSet(BOOKMARKS));
|
| EXPECT_EQ(DataTypeManager::CONFIGURING, dtm_->state());
|
| - EXPECT_EQ(ModelTypeSet(BOOKMARKS),
|
| - configurer_.registered_directory_types());
|
|
|
| FinishDownload(ModelTypeSet(), ModelTypeSet());
|
| FinishDownload(ModelTypeSet(BOOKMARKS), ModelTypeSet());
|
| @@ -454,7 +430,6 @@
|
|
|
| dtm_->Stop();
|
| EXPECT_EQ(DataTypeManager::STOPPED, dtm_->state());
|
| - EXPECT_TRUE(configurer_.registered_directory_types().Empty());
|
| dtm_.reset();
|
| }
|
|
|
| @@ -522,7 +497,6 @@
|
| // Step 1.
|
| Configure(ModelTypeSet(BOOKMARKS));
|
| EXPECT_EQ(DataTypeManager::CONFIGURING, dtm_->state());
|
| - EXPECT_EQ(ModelTypeSet(BOOKMARKS), configurer_.registered_directory_types());
|
|
|
| // Step 2.
|
| FinishDownload(ModelTypeSet(), ModelTypeSet());
|
| @@ -540,8 +514,6 @@
|
| // Step 4.
|
| Configure(ModelTypeSet(BOOKMARKS, PREFERENCES));
|
| EXPECT_EQ(DataTypeManager::CONFIGURING, dtm_->state());
|
| - EXPECT_EQ(ModelTypeSet(BOOKMARKS, PREFERENCES),
|
| - configurer_.registered_directory_types());
|
|
|
| // Step 5.
|
| FinishDownload(ModelTypeSet(), ModelTypeSet());
|
| @@ -557,7 +529,6 @@
|
| dtm_->Stop();
|
| EXPECT_EQ(DataTypeManager::STOPPED, dtm_->state());
|
| EXPECT_TRUE(configurer_.activated_types().Empty());
|
| - EXPECT_TRUE(configurer_.registered_directory_types().Empty());
|
| }
|
|
|
| // Set up a DTM with two controllers. Then:
|
| @@ -579,7 +550,6 @@
|
| // Step 1.
|
| Configure(ModelTypeSet(BOOKMARKS));
|
| EXPECT_EQ(DataTypeManager::CONFIGURING, dtm_->state());
|
| - EXPECT_EQ(ModelTypeSet(BOOKMARKS), configurer_.registered_directory_types());
|
|
|
| // Step 2.
|
| FinishDownload(ModelTypeSet(), ModelTypeSet());
|
| @@ -597,8 +567,6 @@
|
| // Step 4.
|
| Configure(ModelTypeSet(PREFERENCES));
|
| EXPECT_EQ(DataTypeManager::CONFIGURING, dtm_->state());
|
| - EXPECT_EQ(ModelTypeSet(PREFERENCES),
|
| - configurer_.registered_directory_types());
|
|
|
| // Step 5.
|
| FinishDownload(ModelTypeSet(), ModelTypeSet());
|
| @@ -614,7 +582,6 @@
|
| dtm_->Stop();
|
| EXPECT_EQ(DataTypeManager::STOPPED, dtm_->state());
|
| EXPECT_TRUE(configurer_.activated_types().Empty());
|
| - EXPECT_TRUE(configurer_.registered_directory_types().Empty());
|
| }
|
|
|
| // Set up a DTM with two controllers. Then:
|
| @@ -636,7 +603,6 @@
|
| // Step 1.
|
| Configure(ModelTypeSet(BOOKMARKS));
|
| EXPECT_EQ(DataTypeManager::CONFIGURING, dtm_->state());
|
| - EXPECT_EQ(ModelTypeSet(BOOKMARKS), configurer_.registered_directory_types());
|
|
|
| // Step 2.
|
| FinishDownload(ModelTypeSet(), ModelTypeSet());
|
| @@ -660,14 +626,11 @@
|
| GetController(PREFERENCES)->FinishStart(DataTypeController::OK);
|
| EXPECT_EQ(DataTypeManager::CONFIGURED, dtm_->state());
|
| EXPECT_EQ(2U, configurer_.activated_types().Size());
|
| - EXPECT_EQ(ModelTypeSet(BOOKMARKS, PREFERENCES),
|
| - configurer_.registered_directory_types());
|
|
|
| // Step 7.
|
| dtm_->Stop();
|
| EXPECT_EQ(DataTypeManager::STOPPED, dtm_->state());
|
| EXPECT_TRUE(configurer_.activated_types().Empty());
|
| - EXPECT_TRUE(configurer_.registered_directory_types().Empty());
|
| }
|
|
|
| // Set up a DTM with one controller. Then configure, finish
|
| @@ -684,7 +647,6 @@
|
|
|
| Configure(ModelTypeSet(BOOKMARKS));
|
| EXPECT_EQ(DataTypeManager::CONFIGURING, dtm_->state());
|
| - EXPECT_EQ(ModelTypeSet(BOOKMARKS), configurer_.registered_directory_types());
|
|
|
| FinishDownload(ModelTypeSet(), ModelTypeSet());
|
| FinishDownload(ModelTypeSet(BOOKMARKS), ModelTypeSet());
|
| @@ -695,7 +657,6 @@
|
| DataTypeController::UNRECOVERABLE_ERROR);
|
| EXPECT_EQ(DataTypeManager::STOPPED, dtm_->state());
|
| EXPECT_TRUE(configurer_.activated_types().Empty());
|
| - EXPECT_TRUE(configurer_.registered_directory_types().Empty());
|
| }
|
|
|
| // Set up a DTM with two controllers. Then:
|
| @@ -719,8 +680,6 @@
|
| // Step 1.
|
| Configure(ModelTypeSet(BOOKMARKS, PREFERENCES));
|
| EXPECT_EQ(DataTypeManager::CONFIGURING, dtm_->state());
|
| - EXPECT_EQ(ModelTypeSet(BOOKMARKS, PREFERENCES),
|
| - configurer_.registered_directory_types());
|
|
|
| // Step 2.
|
| FinishDownload(ModelTypeSet(), ModelTypeSet());
|
| @@ -735,7 +694,6 @@
|
| GetController(PREFERENCES)
|
| ->FinishStart(DataTypeController::UNRECOVERABLE_ERROR);
|
| EXPECT_EQ(DataTypeManager::STOPPED, dtm_->state());
|
| - EXPECT_TRUE(configurer_.registered_directory_types().Empty());
|
| }
|
|
|
| // Set up a DTM with two controllers. Then:
|
| @@ -764,8 +722,6 @@
|
| // Step 1.
|
| Configure(ModelTypeSet(BOOKMARKS, PREFERENCES));
|
| EXPECT_EQ(DataTypeManager::CONFIGURING, dtm_->state());
|
| - EXPECT_EQ(ModelTypeSet(BOOKMARKS, PREFERENCES),
|
| - configurer_.registered_directory_types());
|
|
|
| // Step 2.
|
| FinishDownload(ModelTypeSet(), ModelTypeSet());
|
| @@ -786,13 +742,11 @@
|
| FinishDownload(ModelTypeSet(BOOKMARKS), ModelTypeSet());
|
| EXPECT_EQ(DataTypeManager::CONFIGURED, dtm_->state());
|
| EXPECT_EQ(1U, configurer_.activated_types().Size());
|
| - EXPECT_EQ(ModelTypeSet(BOOKMARKS), configurer_.registered_directory_types());
|
|
|
| // Step 6.
|
| dtm_->Stop();
|
| EXPECT_EQ(DataTypeManager::STOPPED, dtm_->state());
|
| EXPECT_TRUE(configurer_.activated_types().Empty());
|
| - EXPECT_TRUE(configurer_.registered_directory_types().Empty());
|
| }
|
|
|
| // Set up a DTM with two controllers. Then:
|
| @@ -813,7 +767,6 @@
|
| // Step 1.
|
| Configure(ModelTypeSet(BOOKMARKS));
|
| EXPECT_EQ(DataTypeManager::CONFIGURING, dtm_->state());
|
| - EXPECT_EQ(ModelTypeSet(BOOKMARKS), configurer_.registered_directory_types());
|
|
|
| // Step 2.
|
| Configure(ModelTypeSet(BOOKMARKS, PREFERENCES));
|
| @@ -833,13 +786,10 @@
|
| EXPECT_EQ(DataTypeManager::CONFIGURING, dtm_->state());
|
| GetController(PREFERENCES)->FinishStart(DataTypeController::OK);
|
| EXPECT_EQ(DataTypeManager::CONFIGURED, dtm_->state());
|
| - EXPECT_EQ(ModelTypeSet(BOOKMARKS, PREFERENCES),
|
| - configurer_.registered_directory_types());
|
|
|
| // Step 6.
|
| dtm_->Stop();
|
| EXPECT_EQ(DataTypeManager::STOPPED, dtm_->state());
|
| - EXPECT_TRUE(configurer_.registered_directory_types().Empty());
|
| }
|
|
|
| // Set up a DTM with two controllers. Then:
|
| @@ -864,7 +814,6 @@
|
| Configure(ModelTypeSet(BOOKMARKS));
|
| FinishDownload(ModelTypeSet(), ModelTypeSet());
|
| EXPECT_EQ(DataTypeManager::CONFIGURING, dtm_->state());
|
| - EXPECT_EQ(ModelTypeSet(BOOKMARKS), configurer_.registered_directory_types());
|
|
|
| // Step 2.
|
| Configure(ModelTypeSet(BOOKMARKS, PREFERENCES));
|
| @@ -884,13 +833,10 @@
|
| EXPECT_EQ(DataTypeManager::CONFIGURING, dtm_->state());
|
| GetController(PREFERENCES)->FinishStart(DataTypeController::OK);
|
| EXPECT_EQ(DataTypeManager::CONFIGURED, dtm_->state());
|
| - EXPECT_EQ(ModelTypeSet(BOOKMARKS, PREFERENCES),
|
| - configurer_.registered_directory_types());
|
|
|
| // Step 6.
|
| dtm_->Stop();
|
| EXPECT_EQ(DataTypeManager::STOPPED, dtm_->state());
|
| - EXPECT_TRUE(configurer_.registered_directory_types().Empty());
|
| }
|
|
|
| // Tests a Purge then Configure. This is similar to the sequence of
|
|
|