Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(244)

Side by Side Diff: sync/internal_api/public/base/model_type_test_util.cc

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2012 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.
4
5 #include "base/macros.h"
6 #include "sync/internal_api/public/base/model_type_test_util.h"
7
8 namespace syncer {
9
10 void PrintTo(ModelTypeSet model_types, ::std::ostream* os) {
11 *os << ModelTypeSetToString(model_types);
12 }
13
14 namespace {
15
16 // Matcher implementation for HasModelTypes().
17 class HasModelTypesMatcher
18 : public ::testing::MatcherInterface<ModelTypeSet> {
19 public:
20 explicit HasModelTypesMatcher(ModelTypeSet expected_types)
21 : expected_types_(expected_types) {}
22
23 virtual ~HasModelTypesMatcher() {}
24
25 virtual bool MatchAndExplain(
26 ModelTypeSet model_types,
27 ::testing::MatchResultListener* listener) const {
28 // No need to annotate listener since we already define PrintTo().
29 return model_types == expected_types_;
30 }
31
32 virtual void DescribeTo(::std::ostream* os) const {
33 *os << "has model types " << ModelTypeSetToString(expected_types_);
34 }
35
36 virtual void DescribeNegationTo(::std::ostream* os) const {
37 *os << "doesn't have model types "
38 << ModelTypeSetToString(expected_types_);
39 }
40
41 private:
42 const ModelTypeSet expected_types_;
43
44 DISALLOW_COPY_AND_ASSIGN(HasModelTypesMatcher);
45 };
46
47 } // namespace
48
49 ::testing::Matcher<ModelTypeSet> HasModelTypes(ModelTypeSet expected_types) {
50 return ::testing::MakeMatcher(new HasModelTypesMatcher(expected_types));
51 }
52
53 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/internal_api/public/base/model_type_test_util.h ('k') | sync/internal_api/public/base/node_ordinal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698