Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(512)

Unified Diff: components/sync_driver/non_ui_model_type_controller_unittest.cc

Issue 1848793006: [Sync] Register USS types with ModelTypeRegistry before download (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/sync_driver/non_ui_model_type_controller_unittest.cc
diff --git a/components/sync_driver/non_ui_model_type_controller_unittest.cc b/components/sync_driver/non_ui_model_type_controller_unittest.cc
index b76f8a07a422e1f193c13acb03169a2714774de6..bb202b89774a5870877db28a8ad399bb4bcf2c32 100644
--- a/components/sync_driver/non_ui_model_type_controller_unittest.cc
+++ b/components/sync_driver/non_ui_model_type_controller_unittest.cc
@@ -267,6 +267,13 @@ class NonUIModelTypeControllerTest : public testing::Test,
}
}
+ void RegisterWithBackend() {
+ controller_->RegisterWithBackend(&configurer_);
+ if (auto_run_tasks_) {
+ RunAllTasks();
+ }
+ }
+
void StartAssociating() {
controller_->StartAssociating(
base::Bind(&NonUIModelTypeControllerTest::AssociationDone,
@@ -275,14 +282,6 @@ class NonUIModelTypeControllerTest : 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();
@@ -380,20 +379,20 @@ TEST_F(NonUIModelTypeControllerTest, ActivateDataTypeOnBackendThread) {
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(NonUIModelTypeControllerTest, Stop) {
LoadModels();
- StartAssociating();
- ActivateDataType();
+ RegisterWithBackend();
TestTypeProcessor(true, true); // enabled, connected.
+ StartAssociating();
+
DeactivateDataTypeAndStop();
EXPECT_EQ(sync_driver::DataTypeController::NOT_RUNNING, controller_->state());
}

Powered by Google App Engine
This is Rietveld 408576698