Index: components/sync_driver/ui_model_type_controller_unittest.cc |
diff --git a/components/sync_driver/ui_model_type_controller_unittest.cc b/components/sync_driver/ui_model_type_controller_unittest.cc |
index 51d2cd2377496bacb2a8263e8ad3dea89ed98ffb..3228af0312e57f5ab57d3074c8db3c45ab06bd85 100644 |
--- a/components/sync_driver/ui_model_type_controller_unittest.cc |
+++ b/components/sync_driver/ui_model_type_controller_unittest.cc |
@@ -183,6 +183,13 @@ class UIModelTypeControllerTest : public testing::Test, |
} |
} |
+ void RegisterWithBackend() { |
+ controller_->RegisterWithBackend(&configurer_); |
+ if (auto_run_tasks_) { |
+ RunAllTasks(); |
+ } |
+ } |
+ |
void StartAssociating() { |
controller_->StartAssociating(base::Bind( |
&UIModelTypeControllerTest::AssociationDone, base::Unretained(this))); |
@@ -190,14 +197,6 @@ class UIModelTypeControllerTest : public testing::Test, |
EXPECT_TRUE(association_callback_called_); |
} |
- void ActivateDataType() { |
- DCHECK(association_callback_called_); |
- controller_->ActivateDataType(&configurer_); |
- if (auto_run_tasks_) { |
- RunAllTasks(); |
- } |
- } |
- |
void DeactivateDataTypeAndStop() { |
controller_->DeactivateDataType(&configurer_); |
controller_->Stop(); |
@@ -279,19 +278,18 @@ TEST_F(UIModelTypeControllerTest, ActivateDataTypeOnUIThread) { |
LoadModels(); |
EXPECT_EQ(sync_driver::DataTypeController::MODEL_LOADED, |
controller_->state()); |
+ RegisterWithBackend(); |
+ TestTypeProcessor(true, true); // enabled, connected. |
StartAssociating(); |
EXPECT_EQ(sync_driver::DataTypeController::RUNNING, controller_->state()); |
- |
- ActivateDataType(); |
- TestTypeProcessor(true, true); // enabled, connected. |
} |
TEST_F(UIModelTypeControllerTest, Stop) { |
LoadModels(); |
- StartAssociating(); |
- ActivateDataType(); |
+ RegisterWithBackend(); |
TestTypeProcessor(true, true); // enabled, connected. |
+ StartAssociating(); |
DeactivateDataTypeAndStop(); |
EXPECT_EQ(sync_driver::DataTypeController::NOT_RUNNING, controller_->state()); |