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

Side by Side Diff: components/sync_driver/sync_prefs_unittest.cc

Issue 1549993003: Switch to standard integer types in components/, part 4 of 4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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
« no previous file with comments | « components/sync_driver/sync_prefs.cc ('k') | components/sync_driver/sync_stopped_reporter.h » ('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 #include "components/sync_driver/sync_prefs.h" 5 #include "components/sync_driver/sync_prefs.h"
6 6
7 #include <stdint.h>
8
7 #include <map> 9 #include <map>
8 10
9 #include "base/command_line.h" 11 #include "base/command_line.h"
10 #include "base/message_loop/message_loop.h" 12 #include "base/message_loop/message_loop.h"
11 #include "base/prefs/pref_notifier_impl.h" 13 #include "base/prefs/pref_notifier_impl.h"
12 #include "base/prefs/pref_value_store.h" 14 #include "base/prefs/pref_value_store.h"
13 #include "base/prefs/testing_pref_service.h" 15 #include "base/prefs/testing_pref_service.h"
14 #include "base/time/time.h" 16 #include "base/time/time.h"
15 #include "components/pref_registry/testing_pref_service_syncable.h" 17 #include "components/pref_registry/testing_pref_service_syncable.h"
16 #include "components/sync_driver/pref_names.h" 18 #include "components/sync_driver/pref_names.h"
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 sync_prefs.SetKeepEverythingSynced(true); 236 sync_prefs.SetKeepEverythingSynced(true);
235 EXPECT_TRUE(sync_prefs.GetPreferredDataTypes(syncer::UserTypes()) 237 EXPECT_TRUE(sync_prefs.GetPreferredDataTypes(syncer::UserTypes())
236 .Has(syncer::DEVICE_INFO)); 238 .Has(syncer::DEVICE_INFO));
237 sync_prefs.SetKeepEverythingSynced(false); 239 sync_prefs.SetKeepEverythingSynced(false);
238 EXPECT_TRUE(sync_prefs.GetPreferredDataTypes(syncer::UserTypes()) 240 EXPECT_TRUE(sync_prefs.GetPreferredDataTypes(syncer::UserTypes())
239 .Has(syncer::DEVICE_INFO)); 241 .Has(syncer::DEVICE_INFO));
240 } 242 }
241 243
242 // Verify that invalidation versions are persisted and loaded correctly. 244 // Verify that invalidation versions are persisted and loaded correctly.
243 TEST_F(SyncPrefsTest, InvalidationVersions) { 245 TEST_F(SyncPrefsTest, InvalidationVersions) {
244 std::map<syncer::ModelType, int64> versions; 246 std::map<syncer::ModelType, int64_t> versions;
245 versions[syncer::BOOKMARKS] = 10; 247 versions[syncer::BOOKMARKS] = 10;
246 versions[syncer::SESSIONS] = 20; 248 versions[syncer::SESSIONS] = 20;
247 versions[syncer::PREFERENCES] = 30; 249 versions[syncer::PREFERENCES] = 30;
248 250
249 SyncPrefs sync_prefs(&pref_service_); 251 SyncPrefs sync_prefs(&pref_service_);
250 sync_prefs.UpdateInvalidationVersions(versions); 252 sync_prefs.UpdateInvalidationVersions(versions);
251 253
252 std::map<syncer::ModelType, int64> versions2; 254 std::map<syncer::ModelType, int64_t> versions2;
253 sync_prefs.GetInvalidationVersions(&versions2); 255 sync_prefs.GetInvalidationVersions(&versions2);
254 256
255 EXPECT_EQ(versions.size(), versions2.size()); 257 EXPECT_EQ(versions.size(), versions2.size());
256 for (auto map_iter : versions2) { 258 for (auto map_iter : versions2) {
257 EXPECT_EQ(versions[map_iter.first], map_iter.second); 259 EXPECT_EQ(versions[map_iter.first], map_iter.second);
258 } 260 }
259 } 261 }
260 262
261 } // namespace 263 } // namespace
262 264
263 } // namespace sync_driver 265 } // namespace sync_driver
OLDNEW
« no previous file with comments | « components/sync_driver/sync_prefs.cc ('k') | components/sync_driver/sync_stopped_reporter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698