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

Unified Diff: chrome/browser/sync/notifier/chrome_invalidation_client_unittest.cc

Issue 8772074: [Sync] Convert syncable/ directory to ModelEnumSet (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix typo 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/notifier/chrome_invalidation_client_unittest.cc
diff --git a/chrome/browser/sync/notifier/chrome_invalidation_client_unittest.cc b/chrome/browser/sync/notifier/chrome_invalidation_client_unittest.cc
index 09a473eb0a4e9800f1224ba2ddd30a9021beecf7..0c128634c0a8022768cd48c6ac2cbb65f2ce05e3 100644
--- a/chrome/browser/sync/notifier/chrome_invalidation_client_unittest.cc
+++ b/chrome/browser/sync/notifier/chrome_invalidation_client_unittest.cc
@@ -142,22 +142,15 @@ syncable::ModelTypePayloadMap MakeMap(syncable::ModelType model_type,
return type_payloads;
}
-syncable::ModelTypePayloadMap MakeMapFromSet(syncable::ModelTypeSet types,
+syncable::ModelTypePayloadMap MakeMapFromSet(syncable::ModelEnumSet types,
const std::string& payload) {
- syncable::ModelTypePayloadMap type_payloads;
- for (syncable::ModelTypeSet::const_iterator it = types.begin();
- it != types.end(); ++it) {
- type_payloads[*it] = payload;
- }
- return type_payloads;
+ return syncable::ModelTypePayloadMapFromEnumSet(types, payload);
}
} // namespace
TEST_F(ChromeInvalidationClientTest, InvalidateBadObjectId) {
- syncable::ModelTypeSet types;
- types.insert(syncable::BOOKMARKS);
- types.insert(syncable::APPS);
+ syncable::ModelEnumSet types(syncable::BOOKMARKS, syncable::APPS);
client_.RegisterTypes(types);
EXPECT_CALL(mock_listener_, OnInvalidate(MakeMapFromSet(types, "")));
FireInvalidate("bad", 1, NULL);
@@ -210,9 +203,7 @@ TEST_F(ChromeInvalidationClientTest, InvalidateUnknownVersion) {
TEST_F(ChromeInvalidationClientTest, InvalidateVersionMultipleTypes) {
using ::testing::Mock;
- syncable::ModelTypeSet types;
- types.insert(syncable::BOOKMARKS);
- types.insert(syncable::APPS);
+ syncable::ModelEnumSet types(syncable::BOOKMARKS, syncable::APPS);
client_.RegisterTypes(types);
EXPECT_CALL(mock_listener_,
@@ -267,18 +258,14 @@ TEST_F(ChromeInvalidationClientTest, InvalidateVersionMultipleTypes) {
}
TEST_F(ChromeInvalidationClientTest, InvalidateAll) {
- syncable::ModelTypeSet types;
- types.insert(syncable::PREFERENCES);
- types.insert(syncable::EXTENSIONS);
+ syncable::ModelEnumSet types(syncable::PREFERENCES, syncable::EXTENSIONS);
client_.RegisterTypes(types);
EXPECT_CALL(mock_listener_, OnInvalidate(MakeMapFromSet(types, "")));
FireInvalidateAll();
}
TEST_F(ChromeInvalidationClientTest, RegisterTypes) {
- syncable::ModelTypeSet types;
- types.insert(syncable::PREFERENCES);
- types.insert(syncable::EXTENSIONS);
+ syncable::ModelEnumSet types(syncable::PREFERENCES, syncable::EXTENSIONS);
client_.RegisterTypes(types);
// Registered types should be preserved across Stop/Start.
TearDown();
« no previous file with comments | « chrome/browser/sync/notifier/chrome_invalidation_client.cc ('k') | chrome/browser/sync/notifier/invalidation_notifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698