summaryrefslogtreecommitdiffstats
path: root/components/invalidation/invalidation_service_test_template.cc
blob: 3205c6f0155ce3b4941fa089cbdce7d8745c757b (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
// Copyright 2014 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 "components/invalidation/invalidation_service_test_template.h"

namespace internal {

BoundFakeInvalidationHandler::BoundFakeInvalidationHandler(
    const invalidation::InvalidationService& invalidator)
    : invalidator_(invalidator),
      last_retrieved_state_(syncer::DEFAULT_INVALIDATION_ERROR) {}

BoundFakeInvalidationHandler::~BoundFakeInvalidationHandler() {}

syncer::InvalidatorState
BoundFakeInvalidationHandler::GetLastRetrievedState() const {
  return last_retrieved_state_;
}

void BoundFakeInvalidationHandler::OnInvalidatorStateChange(
    syncer::InvalidatorState state) {
  FakeInvalidationHandler::OnInvalidatorStateChange(state);
  last_retrieved_state_ = invalidator_.GetInvalidatorState();
}

}  // namespace internal