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

Unified Diff: components/sync/driver/model_association_manager_unittest.cc

Issue 2641253004: Revert of [Sync] Make directory types registration explicit in ModelTypeRegistry (patchset #3 id:40… (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « components/sync/driver/model_association_manager.cc ('k') | components/sync/driver/model_type_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/driver/model_association_manager_unittest.cc
diff --git a/components/sync/driver/model_association_manager_unittest.cc b/components/sync/driver/model_association_manager_unittest.cc
index 251bb6370bae2abb8fdbb75e2795894d2768a703..ebb576b54b82effe8255820ff0da1cf420778db8 100644
--- a/components/sync/driver/model_association_manager_unittest.cc
+++ b/components/sync/driver/model_association_manager_unittest.cc
@@ -25,7 +25,6 @@ class MockModelAssociationManagerDelegate
MOCK_METHOD2(OnSingleDataTypeAssociationDone,
void(ModelType type,
const DataTypeAssociationStats& association_stats));
- MOCK_METHOD1(OnSingleDataTypeWillStart, void(ModelType type));
MOCK_METHOD2(OnSingleDataTypeWillStop,
void(ModelType, const SyncError& error));
MOCK_METHOD1(OnModelAssociationDone,
@@ -65,8 +64,6 @@ TEST_F(SyncModelAssociationManagerTest, SimpleModelStart) {
ModelAssociationManager model_association_manager(&controllers_, &delegate_);
ModelTypeSet types(BOOKMARKS, APPS);
DataTypeManager::ConfigureResult expected_result(DataTypeManager::OK, types);
- EXPECT_CALL(delegate_, OnSingleDataTypeWillStart(BOOKMARKS));
- EXPECT_CALL(delegate_, OnSingleDataTypeWillStart(APPS));
EXPECT_CALL(delegate_, OnAllDataTypesReadyForConfigure());
EXPECT_CALL(delegate_, OnModelAssociationDone(_))
.WillOnce(VerifyResult(expected_result));
@@ -102,9 +99,9 @@ TEST_F(SyncModelAssociationManagerTest, StopModelBeforeFinish) {
ModelTypeSet types;
types.Put(BOOKMARKS);
- EXPECT_CALL(delegate_, OnSingleDataTypeWillStart(BOOKMARKS));
DataTypeManager::ConfigureResult expected_result(DataTypeManager::ABORTED,
types);
+
EXPECT_CALL(delegate_, OnModelAssociationDone(_))
.WillOnce(VerifyResult(expected_result));
EXPECT_CALL(delegate_, OnSingleDataTypeWillStop(BOOKMARKS, _));
@@ -125,7 +122,6 @@ TEST_F(SyncModelAssociationManagerTest, StopAfterFinish) {
ModelAssociationManager model_association_manager(&controllers_, &delegate_);
ModelTypeSet types;
types.Put(BOOKMARKS);
- EXPECT_CALL(delegate_, OnSingleDataTypeWillStart(BOOKMARKS));
DataTypeManager::ConfigureResult expected_result(DataTypeManager::OK, types);
EXPECT_CALL(delegate_, OnModelAssociationDone(_))
.WillOnce(VerifyResult(expected_result));
@@ -149,7 +145,6 @@ TEST_F(SyncModelAssociationManagerTest, TypeFailModelAssociation) {
ModelAssociationManager model_association_manager(&controllers_, &delegate_);
ModelTypeSet types;
types.Put(BOOKMARKS);
- EXPECT_CALL(delegate_, OnSingleDataTypeWillStart(BOOKMARKS));
DataTypeManager::ConfigureResult expected_result(DataTypeManager::OK, types);
EXPECT_CALL(delegate_, OnSingleDataTypeWillStop(BOOKMARKS, _));
EXPECT_CALL(delegate_, OnModelAssociationDone(_))
@@ -172,7 +167,6 @@ TEST_F(SyncModelAssociationManagerTest, TypeReturnUnrecoverableError) {
ModelAssociationManager model_association_manager(&controllers_, &delegate_);
ModelTypeSet types;
types.Put(BOOKMARKS);
- EXPECT_CALL(delegate_, OnSingleDataTypeWillStart(BOOKMARKS));
DataTypeManager::ConfigureResult expected_result(
DataTypeManager::UNRECOVERABLE_ERROR, types);
EXPECT_CALL(delegate_, OnSingleDataTypeWillStop(BOOKMARKS, _));
@@ -201,8 +195,6 @@ TEST_F(SyncModelAssociationManagerTest, SlowTypeAsFailedType) {
DataTypeManager::ConfigureResult expected_result_partially_done(
DataTypeManager::OK, types);
- EXPECT_CALL(delegate_, OnSingleDataTypeWillStart(BOOKMARKS));
- EXPECT_CALL(delegate_, OnSingleDataTypeWillStart(APPS));
EXPECT_CALL(delegate_, OnModelAssociationDone(_))
.WillOnce(VerifyResult(expected_result_partially_done));
@@ -270,7 +262,6 @@ TEST_F(SyncModelAssociationManagerTest, ModelLoadFailBeforeAssociationStart) {
ModelTypeSet types;
types.Put(BOOKMARKS);
DataTypeManager::ConfigureResult expected_result(DataTypeManager::OK, types);
- EXPECT_CALL(delegate_, OnSingleDataTypeWillStart(BOOKMARKS));
EXPECT_CALL(delegate_, OnSingleDataTypeWillStop(BOOKMARKS, _));
EXPECT_CALL(delegate_, OnModelAssociationDone(_))
.WillOnce(VerifyResult(expected_result));
@@ -290,7 +281,6 @@ TEST_F(SyncModelAssociationManagerTest, StopAfterConfiguration) {
ModelTypeSet types;
types.Put(BOOKMARKS);
DataTypeManager::ConfigureResult expected_result(DataTypeManager::OK, types);
- EXPECT_CALL(delegate_, OnSingleDataTypeWillStart(BOOKMARKS));
EXPECT_CALL(delegate_, OnModelAssociationDone(_))
.WillOnce(VerifyResult(expected_result));
@@ -325,8 +315,6 @@ TEST_F(SyncModelAssociationManagerTest, AbortDuringAssociation) {
DataTypeManager::ConfigureResult expected_result_partially_done(
DataTypeManager::OK, types);
- EXPECT_CALL(delegate_, OnSingleDataTypeWillStart(BOOKMARKS));
- EXPECT_CALL(delegate_, OnSingleDataTypeWillStart(APPS));
EXPECT_CALL(delegate_, OnModelAssociationDone(_))
.WillOnce(VerifyResult(expected_result_partially_done));
@@ -362,8 +350,6 @@ TEST_F(SyncModelAssociationManagerTest, OnAllDataTypesReadyForConfigure) {
DataTypeManager::ConfigureResult expected_result(DataTypeManager::OK, types);
// OnAllDataTypesReadyForConfigure shouldn't be called, APPS data type is not
// loaded yet.
- EXPECT_CALL(delegate_, OnSingleDataTypeWillStart(BOOKMARKS));
- EXPECT_CALL(delegate_, OnSingleDataTypeWillStart(APPS));
EXPECT_CALL(delegate_, OnAllDataTypesReadyForConfigure()).Times(0);
model_association_manager.Initialize(types);
@@ -409,7 +395,6 @@ TEST_F(SyncModelAssociationManagerTest,
DataTypeManager::ConfigureResult expected_result(DataTypeManager::OK, types);
// OnAllDataTypesReadyForConfigure shouldn't be called, APPS data type is not
// loaded yet.
- EXPECT_CALL(delegate_, OnSingleDataTypeWillStart(APPS));
EXPECT_CALL(delegate_, OnAllDataTypesReadyForConfigure()).Times(0);
model_association_manager.Initialize(types);
@@ -451,8 +436,6 @@ TEST_F(SyncModelAssociationManagerTest,
// Apps will finish loading but bookmarks won't.
// OnAllDataTypesReadyForConfigure shouldn't be called.
- EXPECT_CALL(delegate_, OnSingleDataTypeWillStart(BOOKMARKS));
- EXPECT_CALL(delegate_, OnSingleDataTypeWillStart(APPS));
EXPECT_CALL(delegate_, OnAllDataTypesReadyForConfigure()).Times(0);
model_association_manager.Initialize(types);
« no previous file with comments | « components/sync/driver/model_association_manager.cc ('k') | components/sync/driver/model_type_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698