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

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

Issue 12094113: Migrate invalidator client IDs out of sync (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix sync_client compile errors Created 7 years, 10 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/invalidations/invalidator_storage.cc ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b07b0e65d7247eee6cbcb756f989dfb28fd16e4c..03a9c49245acde63940693ffedd67ba0a595b07f 100644
--- a/chrome/browser/sync/invalidations/invalidator_storage_unittest.cc
+++ b/chrome/browser/sync/invalidations/invalidator_storage_unittest.cc
@@ -107,15 +107,20 @@ TEST_F(InvalidatorStorageTest, Forget) {
EXPECT_EQ(expected_states, storage.GetAllInvalidationStates());
}
-// Clearing the storage should erase all version map entries and the bootstrap
-// data.
+// Clearing the storage should erase all version map entries, bootstrap data,
+// and the client ID.
TEST_F(InvalidatorStorageTest, Clear) {
InvalidatorStorage storage(&pref_service_);
EXPECT_TRUE(storage.GetAllInvalidationStates().empty());
EXPECT_TRUE(storage.GetBootstrapData().empty());
+ EXPECT_TRUE(storage.GetInvalidatorClientId().empty());
+
+ storage.SetInvalidatorClientId("fake_id");
+ EXPECT_EQ("fake_id", storage.GetInvalidatorClientId());
storage.SetBootstrapData("test");
EXPECT_EQ("test", storage.GetBootstrapData());
+
{
InvalidationStateMap expected_states;
expected_states[kAppNotificationsId_].version = 3;
@@ -127,6 +132,7 @@ TEST_F(InvalidatorStorageTest, Clear) {
EXPECT_TRUE(storage.GetAllInvalidationStates().empty());
EXPECT_TRUE(storage.GetBootstrapData().empty());
+ EXPECT_TRUE(storage.GetInvalidatorClientId().empty());
}
TEST_F(InvalidatorStorageTest, SerializeEmptyMap) {
@@ -401,6 +407,14 @@ TEST_F(InvalidatorStorageTest, MigrateLegacyPreferences) {
EXPECT_EQ(54, map[kPreferencesId_].version);
}
+TEST_F(InvalidatorStorageTest, SetGetNotifierClientId) {
+ InvalidatorStorage storage(&pref_service_);
+ const std::string client_id("fK6eDzAIuKqx9A4+93bljg==");
+
+ storage.SetInvalidatorClientId(client_id);
+ EXPECT_EQ(client_id, storage.GetInvalidatorClientId());
+}
+
TEST_F(InvalidatorStorageTest, SetGetBootstrapData) {
InvalidatorStorage storage(&pref_service_);
const std::string mess("n\0tK\0\0l\344", 8);
« no previous file with comments | « chrome/browser/sync/invalidations/invalidator_storage.cc ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698