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

Unified Diff: chrome/browser/sync/syncable/model_type_unittest.cc

Issue 8851006: [Sync] Replace all instances of ModelTypeSet with ModelEnumSet (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup pass #2 Created 9 years 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: chrome/browser/sync/syncable/model_type_unittest.cc
diff --git a/chrome/browser/sync/syncable/model_type_unittest.cc b/chrome/browser/sync/syncable/model_type_unittest.cc
index 2db0ab91e7be1506ed1cb3ad8602a292ce274a3c..c5b9196b8736d2aa767b63723c6d67168343d0b5 100644
--- a/chrome/browser/sync/syncable/model_type_unittest.cc
+++ b/chrome/browser/sync/syncable/model_type_unittest.cc
@@ -38,12 +38,10 @@ TEST_F(ModelTypeTest, ModelTypeFromValue) {
}
}
-TEST_F(ModelTypeTest, ModelTypeSetToValue) {
- ModelTypeSet model_types;
- model_types.insert(syncable::BOOKMARKS);
- model_types.insert(syncable::APPS);
+TEST_F(ModelTypeTest, ModelEnumSetToValue) {
+ const ModelEnumSet model_types(syncable::BOOKMARKS, syncable::APPS);
- scoped_ptr<ListValue> value(ModelTypeSetToValue(model_types));
+ scoped_ptr<ListValue> value(ModelEnumSetToValue(model_types));
EXPECT_EQ(2u, value->GetSize());
std::string types[2];
EXPECT_TRUE(value->GetString(0, &types[0]));
@@ -52,26 +50,17 @@ TEST_F(ModelTypeTest, ModelTypeSetToValue) {
EXPECT_EQ("Apps", types[1]);
}
-TEST_F(ModelTypeTest, ModelTypeSetFromValue) {
+TEST_F(ModelTypeTest, ModelEnumSetFromValue) {
// Try empty set first.
- ModelTypeSet model_types;
- scoped_ptr<ListValue> value(ModelTypeSetToValue(model_types));
- EXPECT_EQ(model_types, ModelTypeSetFromValue(*value));
+ ModelEnumSet model_types;
+ scoped_ptr<ListValue> value(ModelEnumSetToValue(model_types));
+ EXPECT_TRUE(model_types.Equals(ModelEnumSetFromValue(*value)));
// Now try with a few random types.
- model_types.insert(BOOKMARKS);
- model_types.insert(APPS);
- value.reset(ModelTypeSetToValue(model_types));
- EXPECT_EQ(model_types, ModelTypeSetFromValue(*value));
-}
-
-TEST_F(ModelTypeTest, GetAllRealModelTypes) {
- const ModelTypeSet& all_types = GetAllRealModelTypes();
- for (int i = 0; i < MODEL_TYPE_COUNT; ++i) {
- ModelType type = ModelTypeFromInt(i);
- EXPECT_EQ(IsRealDataType(type), all_types.count(type) > 0u);
- }
- EXPECT_EQ(0u, all_types.count(MODEL_TYPE_COUNT));
+ model_types.Put(BOOKMARKS);
+ model_types.Put(APPS);
+ value.reset(ModelEnumSetToValue(model_types));
+ EXPECT_TRUE(model_types.Equals(ModelEnumSetFromValue(*value)));
}
TEST_F(ModelTypeTest, IsRealDataType) {
« no previous file with comments | « chrome/browser/sync/syncable/model_type.cc ('k') | chrome/browser/sync/test/integration/enable_disable_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698