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"
12 scoped_ptr
<MockInvalidation
> MockInvalidation::BuildUnknownVersion() {
13 return scoped_ptr
<MockInvalidation
>(
14 new MockInvalidation(true, -1, std::string()));
17 scoped_ptr
<MockInvalidation
> MockInvalidation::Build(
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_
);
36 int64
MockInvalidation::GetVersion() const {
37 DCHECK(!is_unknown_version_
);
41 void MockInvalidation::Acknowledge() {
45 void MockInvalidation::Drop() {
49 MockInvalidation::MockInvalidation(bool is_unknown_version
,
51 const std::string
& payload
)
52 : is_unknown_version_(is_unknown_version
),