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

Side by Side Diff: sync/notifier/fake_invalidation_state_tracker.cc

Issue 10827133: [Sync] Rework unit tests for ChromeInvalidationClient (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync to head Created 8 years, 4 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 | « sync/notifier/fake_invalidation_state_tracker.h ('k') | sync/notifier/invalidation_notifier.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "sync/notifier/fake_invalidation_state_tracker.h"
6
7 #include "testing/gtest/include/gtest/gtest.h"
8
9 namespace syncer {
10
11 const int64 FakeInvalidationStateTracker::kMinVersion = kint64min;
12
13 FakeInvalidationStateTracker::FakeInvalidationStateTracker() {}
14
15 FakeInvalidationStateTracker::~FakeInvalidationStateTracker() {}
16
17 InvalidationVersionMap
18 FakeInvalidationStateTracker::GetAllMaxVersions() const {
19 return versions_;
20 }
21
22 void FakeInvalidationStateTracker::SetMaxVersion(
23 const invalidation::ObjectId& id, int64 max_version) {
24 InvalidationVersionMap::const_iterator it = versions_.find(id);
25 if ((it != versions_.end()) && (max_version <= it->second)) {
26 ADD_FAILURE();
27 return;
28 }
29 versions_[id] = max_version;
30 }
31
32 int64 FakeInvalidationStateTracker::GetMaxVersion(
33 const invalidation::ObjectId& id) const {
34 InvalidationVersionMap::const_iterator it = versions_.find(id);
35 return (it == versions_.end()) ? kMinVersion : it->second;
36 }
37
38 void FakeInvalidationStateTracker::SetInvalidationState(
39 const std::string& state) {
40 state_ = state;
41 }
42
43 std::string FakeInvalidationStateTracker::GetInvalidationState() const {
44 return state_;
45 }
46
47 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/notifier/fake_invalidation_state_tracker.h ('k') | sync/notifier/invalidation_notifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698