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

Unified Diff: components/sync_driver/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/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());

Powered by Google App Engine
This is Rietveld 408576698