summaryrefslogtreecommitdiffstats
path: root/chromium/sync/notifier/fake_invalidation_state_tracker.cc
blob: 47e2f0f0dc7ffbd1036c21647f1bb265072915fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// 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 "base/bind.h"
#include "base/callback.h"
#include "base/location.h"
#include "base/task_runner.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace syncer {

const int64 FakeInvalidationStateTracker::kMinVersion = kint64min;

FakeInvalidationStateTracker::FakeInvalidationStateTracker() {}

FakeInvalidationStateTracker::~FakeInvalidationStateTracker() {}

void FakeInvalidationStateTracker::SetInvalidatorClientId(
    const std::string& client_id) {
  Clear();
  invalidator_client_id_ = client_id;
}

std::string FakeInvalidationStateTracker::GetInvalidatorClientId() const {
  return invalidator_client_id_;
}

void FakeInvalidationStateTracker::SetBootstrapData(
    const std::string& data) {
  bootstrap_data_ = data;
}

std::string FakeInvalidationStateTracker::GetBootstrapData() const {
  return bootstrap_data_;
}

void FakeInvalidationStateTracker::SetSavedInvalidations(
    const UnackedInvalidationsMap& states) {
  unacked_invalidations_map_ = states;
}

UnackedInvalidationsMap
FakeInvalidationStateTracker::GetSavedInvalidations() const {
  return unacked_invalidations_map_;
}

void FakeInvalidationStateTracker::Clear() {
  invalidator_client_id_.clear();
  bootstrap_data_.clear();
}

}  // namespace syncer