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

Side by Side Diff: chrome/browser/sync/syncable/model_type_test_util.cc

Issue 9699057: [Sync] Move 'sync' target to sync/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Tim's comments Created 8 years, 9 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 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 "chrome/browser/sync/syncable/model_type_test_util.h"
6
7 namespace syncable {
8
9 void PrintTo(ModelTypeSet model_types, ::std::ostream* os) {
10 *os << ModelTypeSetToString(model_types);
11 }
12
13 namespace {
14
15 // Matcher implementation for HasModelTypes().
16 class HasModelTypesMatcher
17 : public ::testing::MatcherInterface<ModelTypeSet> {
18 public:
19 explicit HasModelTypesMatcher(ModelTypeSet expected_types)
20 : expected_types_(expected_types) {}
21
22 virtual ~HasModelTypesMatcher() {}
23
24 virtual bool MatchAndExplain(
25 ModelTypeSet model_types,
26 ::testing::MatchResultListener* listener) const {
27 // No need to annotate listener since we already define PrintTo().
28 return model_types.Equals(expected_types_);
29 }
30
31 virtual void DescribeTo(::std::ostream* os) const {
32 *os << "has model types " << ModelTypeSetToString(expected_types_);
33 }
34
35 virtual void DescribeNegationTo(::std::ostream* os) const {
36 *os << "doesn't have model types "
37 << ModelTypeSetToString(expected_types_);
38 }
39
40 private:
41 const ModelTypeSet expected_types_;
42
43 DISALLOW_COPY_AND_ASSIGN(HasModelTypesMatcher);
44 };
45
46 } // namespace
47
48 ::testing::Matcher<ModelTypeSet> HasModelTypes(ModelTypeSet expected_types) {
49 return ::testing::MakeMatcher(new HasModelTypesMatcher(expected_types));
50 }
51
52 } // namespace syncable
OLDNEW
« no previous file with comments | « chrome/browser/sync/syncable/model_type_test_util.h ('k') | chrome/browser/sync/syncable/model_type_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698