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

Side by Side Diff: components/invalidation/object_id_invalidation_map_test_util.cc

Issue 400073003: Finish decoupling sync and invalidations (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix GN Created 6 years, 5 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/invalidation/object_id_invalidation_map_test_util.h" 5 #include "components/invalidation/object_id_invalidation_map_test_util.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 10
(...skipping 21 matching lines...) Expand all
32 private: 32 private:
33 const ObjectIdInvalidationMap expected_; 33 const ObjectIdInvalidationMap expected_;
34 34
35 DISALLOW_COPY_AND_ASSIGN(ObjectIdInvalidationMapEqMatcher); 35 DISALLOW_COPY_AND_ASSIGN(ObjectIdInvalidationMapEqMatcher);
36 }; 36 };
37 37
38 ObjectIdInvalidationMapEqMatcher::ObjectIdInvalidationMapEqMatcher( 38 ObjectIdInvalidationMapEqMatcher::ObjectIdInvalidationMapEqMatcher(
39 const ObjectIdInvalidationMap& expected) : expected_(expected) { 39 const ObjectIdInvalidationMap& expected) : expected_(expected) {
40 } 40 }
41 41
42 namespace {
43
44 struct InvalidationEqPredicate { 42 struct InvalidationEqPredicate {
45 InvalidationEqPredicate(const Invalidation& inv1) 43 InvalidationEqPredicate(const Invalidation& inv1)
46 : inv1_(inv1) { } 44 : inv1_(inv1) { }
47 45
48 bool operator()(const Invalidation& inv2) { 46 bool operator()(const Invalidation& inv2) {
49 return inv1_.Equals(inv2); 47 return inv1_.Equals(inv2);
50 } 48 }
51 49
52 const Invalidation& inv1_; 50 const Invalidation& inv1_;
53 }; 51 };
54 52
55 }
56
57 bool ObjectIdInvalidationMapEqMatcher::MatchAndExplain( 53 bool ObjectIdInvalidationMapEqMatcher::MatchAndExplain(
58 const ObjectIdInvalidationMap& actual, 54 const ObjectIdInvalidationMap& actual,
59 MatchResultListener* listener) const { 55 MatchResultListener* listener) const {
60 56
61 std::vector<syncer::Invalidation> expected_invalidations; 57 std::vector<syncer::Invalidation> expected_invalidations;
62 std::vector<syncer::Invalidation> actual_invalidations; 58 std::vector<syncer::Invalidation> actual_invalidations;
63 59
64 expected_.GetAllInvalidations(&expected_invalidations); 60 expected_.GetAllInvalidations(&expected_invalidations);
65 actual.GetAllInvalidations(&actual_invalidations); 61 actual.GetAllInvalidations(&actual_invalidations);
66 62
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 } 115 }
120 116
121 } // namespace 117 } // namespace
122 118
123 Matcher<const ObjectIdInvalidationMap&> Eq( 119 Matcher<const ObjectIdInvalidationMap&> Eq(
124 const ObjectIdInvalidationMap& expected) { 120 const ObjectIdInvalidationMap& expected) {
125 return MakeMatcher(new ObjectIdInvalidationMapEqMatcher(expected)); 121 return MakeMatcher(new ObjectIdInvalidationMapEqMatcher(expected));
126 } 122 }
127 123
128 } // namespace syncer 124 } // namespace syncer
OLDNEW
« no previous file with comments | « components/invalidation/object_id_invalidation_map_test_util.h ('k') | components/invalidation/p2p_invalidator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698