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

Side by Side Diff: chrome/browser/sync/invalidations/invalidator_storage_unittest.cc

Issue 10451060: sync: migrate invalidation state from syncable::Directory to InvalidationStorage (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: include order Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/sync/invalidations/invalidator_storage.cc ('k') | chrome/common/pref_names.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 5
6 #include "chrome/browser/sync/invalidations/invalidator_storage.h" 6 #include "chrome/browser/sync/invalidations/invalidator_storage.h"
7 7
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/string_number_conversions.h" 9 #include "base/string_number_conversions.h"
10 #include "base/string_util.h"
10 #include "chrome/test/base/testing_pref_service.h" 11 #include "chrome/test/base/testing_pref_service.h"
11 #include "sync/syncable/model_type.h" 12 #include "sync/syncable/model_type.h"
12 #include "testing/gmock/include/gmock/gmock.h" 13 #include "testing/gmock/include/gmock/gmock.h"
13 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
14 15
15 using sync_notifier::InvalidationVersionMap; 16 using sync_notifier::InvalidationVersionMap;
16 17
17 namespace browser_sync { 18 namespace browser_sync {
18 19
19 class InvalidatorStorageTest : public testing::Test { 20 class InvalidatorStorageTest : public testing::Test {
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 120
120 dict.SetString(base::IntToString(syncable::AUTOFILL), "10"); 121 dict.SetString(base::IntToString(syncable::AUTOFILL), "10");
121 dict.SetString(base::IntToString(syncable::BOOKMARKS), "15"); 122 dict.SetString(base::IntToString(syncable::BOOKMARKS), "15");
122 123
123 InvalidatorStorage::DeserializeMap(&dict, &map); 124 InvalidatorStorage::DeserializeMap(&dict, &map);
124 EXPECT_EQ(2U, map.size()); 125 EXPECT_EQ(2U, map.size());
125 EXPECT_EQ(10, map[syncable::AUTOFILL]); 126 EXPECT_EQ(10, map[syncable::AUTOFILL]);
126 EXPECT_EQ(15, map[syncable::BOOKMARKS]); 127 EXPECT_EQ(15, map[syncable::BOOKMARKS]);
127 } 128 }
128 129
130 TEST_F(InvalidatorStorageTest, SetGetInvalidationState) {
131 InvalidatorStorage storage(&pref_service_);
132 const std::string mess("n\0tK\0\0l\344", 8);
133 ASSERT_FALSE(IsStringUTF8(mess));
134
135 storage.SetInvalidationState(mess);
136 EXPECT_EQ(mess, storage.GetInvalidationState());
137 }
138
129 } // namespace browser_sync 139 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/invalidations/invalidator_storage.cc ('k') | chrome/common/pref_names.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698