| Index: sync/notifier/fake_invalidation_state_tracker.cc
|
| diff --git a/sync/notifier/fake_invalidation_state_tracker.cc b/sync/notifier/fake_invalidation_state_tracker.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..426166b83b5ea5ad0b2b05b741672005fceadcf2
|
| --- /dev/null
|
| +++ b/sync/notifier/fake_invalidation_state_tracker.cc
|
| @@ -0,0 +1,47 @@
|
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "sync/notifier/fake_invalidation_state_tracker.h"
|
| +
|
| +#include "testing/gtest/include/gtest/gtest.h"
|
| +
|
| +namespace syncer {
|
| +
|
| +const int64 FakeInvalidationStateTracker::kMinVersion = kint64min;
|
| +
|
| +FakeInvalidationStateTracker::FakeInvalidationStateTracker() {}
|
| +
|
| +FakeInvalidationStateTracker::~FakeInvalidationStateTracker() {}
|
| +
|
| +InvalidationVersionMap
|
| +FakeInvalidationStateTracker::GetAllMaxVersions() const {
|
| + return versions_;
|
| +}
|
| +
|
| +void FakeInvalidationStateTracker::SetMaxVersion(
|
| + const invalidation::ObjectId& id, int64 max_version) {
|
| + InvalidationVersionMap::const_iterator it = versions_.find(id);
|
| + if ((it != versions_.end()) && (max_version <= it->second)) {
|
| + ADD_FAILURE();
|
| + return;
|
| + }
|
| + versions_[id] = max_version;
|
| +}
|
| +
|
| +int64 FakeInvalidationStateTracker::GetMaxVersion(
|
| + const invalidation::ObjectId& id) const {
|
| + InvalidationVersionMap::const_iterator it = versions_.find(id);
|
| + return (it == versions_.end()) ? kMinVersion : it->second;
|
| +}
|
| +
|
| +void FakeInvalidationStateTracker::SetInvalidationState(
|
| + const std::string& state) {
|
| + state_ = state;
|
| +}
|
| +
|
| +std::string FakeInvalidationStateTracker::GetInvalidationState() const {
|
| + return state_;
|
| +}
|
| +
|
| +} // namespace syncer
|
|
|