Roll src/third_party/WebKit f36d5e0:68b67cd (svn 193299:193303)
[chromium-blink-merge.git] / sync / test / mock_invalidation.cc
blobbfcb3c3d866013e65b1b08c6ffdf658f52dc1509
1 // Copyright 2014 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.
5 #include "sync/test/mock_invalidation.h"
7 #include "base/logging.h"
8 #include "sync/test/mock_invalidation_tracker.h"
10 namespace syncer {
12 scoped_ptr<MockInvalidation> MockInvalidation::BuildUnknownVersion() {
13 return scoped_ptr<MockInvalidation>(
14 new MockInvalidation(true, -1, std::string()));
17 scoped_ptr<MockInvalidation> MockInvalidation::Build(
18 int64 version,
19 const std::string& payload) {
20 return scoped_ptr<MockInvalidation>(
21 new MockInvalidation(false, version, payload));
24 MockInvalidation::~MockInvalidation() {
27 bool MockInvalidation::IsUnknownVersion() const {
28 return is_unknown_version_;
31 const std::string& MockInvalidation::GetPayload() const {
32 DCHECK(!is_unknown_version_);
33 return payload_;
36 int64 MockInvalidation::GetVersion() const {
37 DCHECK(!is_unknown_version_);
38 return version_;
41 void MockInvalidation::Acknowledge() {
42 // Do nothing.
45 void MockInvalidation::Drop() {
46 // Do nothing.
49 MockInvalidation::MockInvalidation(bool is_unknown_version,
50 int64 version,
51 const std::string& payload)
52 : is_unknown_version_(is_unknown_version),
53 version_(version),
54 payload_(payload) {
57 } // namespace syncer