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

Unified Diff: chrome/browser/sync/profile_sync_factory_impl_unittest.cc

Issue 2833042: Enable extensions sync by default. (Closed)
Patch Set: Fixed unittests Created 10 years, 6 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 | « chrome/browser/sync/profile_sync_factory_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/profile_sync_factory_impl_unittest.cc
diff --git a/chrome/browser/sync/profile_sync_factory_impl_unittest.cc b/chrome/browser/sync/profile_sync_factory_impl_unittest.cc
index b63c23a16ab4c64262a16b0c07d8494ffb13120f..d5d1e550c55196e34f421aa03bb779256755943f 100644
--- a/chrome/browser/sync/profile_sync_factory_impl_unittest.cc
+++ b/chrome/browser/sync/profile_sync_factory_impl_unittest.cc
@@ -43,11 +43,12 @@ TEST_F(ProfileSyncFactoryImplTest, CreatePSSDefault) {
DataTypeController::StateMap controller_states;
DataTypeController::StateMap* controller_states_ptr = &controller_states;
pss->GetDataTypeControllerStates(controller_states_ptr);
- EXPECT_EQ(4U, controller_states_ptr->size());
+ EXPECT_EQ(5U, controller_states_ptr->size());
EXPECT_EQ(1U, controller_states_ptr->count(syncable::BOOKMARKS));
EXPECT_EQ(1U, controller_states_ptr->count(syncable::PREFERENCES));
EXPECT_EQ(1U, controller_states_ptr->count(syncable::AUTOFILL));
EXPECT_EQ(1U, controller_states_ptr->count(syncable::THEMES));
+ EXPECT_EQ(1U, controller_states_ptr->count(syncable::EXTENSIONS));
}
TEST_F(ProfileSyncFactoryImplTest, CreatePSSDisableAutofill) {
@@ -57,11 +58,12 @@ TEST_F(ProfileSyncFactoryImplTest, CreatePSSDisableAutofill) {
DataTypeController::StateMap controller_states;
DataTypeController::StateMap* controller_states_ptr = &controller_states;
pss->GetDataTypeControllerStates(controller_states_ptr);
- EXPECT_EQ(3U, controller_states_ptr->size());
+ EXPECT_EQ(4U, controller_states_ptr->size());
EXPECT_EQ(1U, controller_states_ptr->count(syncable::BOOKMARKS));
EXPECT_EQ(1U, controller_states_ptr->count(syncable::PREFERENCES));
EXPECT_EQ(0U, controller_states_ptr->count(syncable::AUTOFILL));
EXPECT_EQ(1U, controller_states_ptr->count(syncable::THEMES));
+ EXPECT_EQ(1U, controller_states_ptr->count(syncable::EXTENSIONS));
}
TEST_F(ProfileSyncFactoryImplTest, CreatePSSDisableBookmarks) {
@@ -71,11 +73,12 @@ TEST_F(ProfileSyncFactoryImplTest, CreatePSSDisableBookmarks) {
DataTypeController::StateMap controller_states;
DataTypeController::StateMap* controller_states_ptr = &controller_states;
pss->GetDataTypeControllerStates(controller_states_ptr);
- EXPECT_EQ(3U, controller_states_ptr->size());
+ EXPECT_EQ(4U, controller_states_ptr->size());
EXPECT_EQ(0U, controller_states_ptr->count(syncable::BOOKMARKS));
EXPECT_EQ(1U, controller_states_ptr->count(syncable::PREFERENCES));
EXPECT_EQ(1U, controller_states_ptr->count(syncable::AUTOFILL));
EXPECT_EQ(1U, controller_states_ptr->count(syncable::THEMES));
+ EXPECT_EQ(1U, controller_states_ptr->count(syncable::EXTENSIONS));
}
TEST_F(ProfileSyncFactoryImplTest, CreatePSSDisablePreferences) {
@@ -85,11 +88,12 @@ TEST_F(ProfileSyncFactoryImplTest, CreatePSSDisablePreferences) {
DataTypeController::StateMap controller_states;
DataTypeController::StateMap* controller_states_ptr = &controller_states;
pss->GetDataTypeControllerStates(controller_states_ptr);
- EXPECT_EQ(3U, controller_states_ptr->size());
+ EXPECT_EQ(4U, controller_states_ptr->size());
EXPECT_EQ(1U, controller_states_ptr->count(syncable::BOOKMARKS));
EXPECT_EQ(0U, controller_states_ptr->count(syncable::PREFERENCES));
EXPECT_EQ(1U, controller_states_ptr->count(syncable::AUTOFILL));
EXPECT_EQ(1U, controller_states_ptr->count(syncable::THEMES));
+ EXPECT_EQ(1U, controller_states_ptr->count(syncable::EXTENSIONS));
}
TEST_F(ProfileSyncFactoryImplTest, CreatePSSDisableThemes) {
@@ -99,9 +103,25 @@ TEST_F(ProfileSyncFactoryImplTest, CreatePSSDisableThemes) {
DataTypeController::StateMap controller_states;
DataTypeController::StateMap* controller_states_ptr = &controller_states;
pss->GetDataTypeControllerStates(controller_states_ptr);
- EXPECT_EQ(3U, controller_states_ptr->size());
+ EXPECT_EQ(4U, controller_states_ptr->size());
EXPECT_EQ(1U, controller_states_ptr->count(syncable::BOOKMARKS));
EXPECT_EQ(1U, controller_states_ptr->count(syncable::PREFERENCES));
EXPECT_EQ(1U, controller_states_ptr->count(syncable::AUTOFILL));
EXPECT_EQ(0U, controller_states_ptr->count(syncable::THEMES));
+ EXPECT_EQ(1U, controller_states_ptr->count(syncable::EXTENSIONS));
+}
+
+TEST_F(ProfileSyncFactoryImplTest, CreatePSSDisableExtensions) {
+ command_line_->AppendSwitch(switches::kDisableSyncExtensions);
+ scoped_ptr<ProfileSyncService> pss;
+ pss.reset(profile_sync_service_factory_->CreateProfileSyncService());
+ DataTypeController::StateMap controller_states;
+ DataTypeController::StateMap* controller_states_ptr = &controller_states;
+ pss->GetDataTypeControllerStates(controller_states_ptr);
+ EXPECT_EQ(4U, controller_states_ptr->size());
+ EXPECT_EQ(1U, controller_states_ptr->count(syncable::BOOKMARKS));
+ EXPECT_EQ(1U, controller_states_ptr->count(syncable::PREFERENCES));
+ EXPECT_EQ(1U, controller_states_ptr->count(syncable::AUTOFILL));
+ EXPECT_EQ(1U, controller_states_ptr->count(syncable::THEMES));
+ EXPECT_EQ(0U, controller_states_ptr->count(syncable::EXTENSIONS));
}
« no previous file with comments | « chrome/browser/sync/profile_sync_factory_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698