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

Unified Diff: chrome/browser/sync/invalidations/invalidator_storage_unittest.cc

Issue 10824140: Add InvalidationStateTracker::Forget() to erase an entry from storage. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix sync_client target Created 8 years, 3 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: chrome/browser/sync/invalidations/invalidator_storage_unittest.cc
diff --git a/chrome/browser/sync/invalidations/invalidator_storage_unittest.cc b/chrome/browser/sync/invalidations/invalidator_storage_unittest.cc
index 0c8202f724e7aaad934af3ab990ac09148a623eb..0fc4504db2d7ea1f645dde4f596a19c84de6c811 100644
--- a/chrome/browser/sync/invalidations/invalidator_storage_unittest.cc
+++ b/chrome/browser/sync/invalidations/invalidator_storage_unittest.cc
@@ -72,6 +72,25 @@ TEST_F(InvalidatorStorageTest, MaxInvalidationVersions) {
EXPECT_EQ(expected_max_versions, storage.GetAllMaxVersions());
}
+// Forgetting an entry should cause that entry to be deleted.
+TEST_F(InvalidatorStorageTest, Forget) {
+ InvalidatorStorage storage(&pref_service_);
+ EXPECT_TRUE(storage.GetAllMaxVersions().empty());
+
+ InvalidationVersionMap expected_max_versions;
+ expected_max_versions[kBookmarksId_] = 2;
+ expected_max_versions[kPreferencesId_] = 5;
+ storage.SetMaxVersion(kBookmarksId_, 2);
+ storage.SetMaxVersion(kPreferencesId_, 5);
+ EXPECT_EQ(expected_max_versions, storage.GetAllMaxVersions());
+
+ expected_max_versions.erase(kPreferencesId_);
+ syncer::ObjectIdSet to_forget;
+ to_forget.insert(kPreferencesId_);
+ storage.Forget(to_forget);
+ EXPECT_EQ(expected_max_versions, storage.GetAllMaxVersions());
+}
+
// Clearing the storage should result in an empty version map.
TEST_F(InvalidatorStorageTest, Clear) {
InvalidatorStorage storage(&pref_service_);
« no previous file with comments | « chrome/browser/sync/invalidations/invalidator_storage.cc ('k') | sync/notifier/chrome_invalidation_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698