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

Unified Diff: sync/notifier/object_id_invalidation_map_test_util.cc

Issue 11052007: Rename ModelType/ObjectIdStateMap to InvalidationMap. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sync/notifier/object_id_invalidation_map_test_util.h ('k') | sync/notifier/object_id_state_map.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/notifier/object_id_invalidation_map_test_util.cc
diff --git a/sync/notifier/object_id_state_map_test_util.cc b/sync/notifier/object_id_invalidation_map_test_util.cc
similarity index 64%
rename from sync/notifier/object_id_state_map_test_util.cc
rename to sync/notifier/object_id_invalidation_map_test_util.cc
index 58659af0357454ab050fe5675be4707a284c0295..f2f82853e4e39458ceb3422449ee7f131627f69c 100644
--- a/sync/notifier/object_id_state_map_test_util.cc
+++ b/sync/notifier/object_id_invalidation_map_test_util.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "sync/notifier/object_id_state_map_test_util.h"
+#include "sync/notifier/object_id_invalidation_map_test_util.h"
#include <algorithm>
@@ -18,32 +18,34 @@ using ::testing::PrintToString;
namespace {
-class ObjectIdStateMapEqMatcher
- : public MatcherInterface<const ObjectIdStateMap&> {
+class ObjectIdInvalidationMapEqMatcher
+ : public MatcherInterface<const ObjectIdInvalidationMap&> {
public:
- explicit ObjectIdStateMapEqMatcher(const ObjectIdStateMap& expected);
+ explicit ObjectIdInvalidationMapEqMatcher(
+ const ObjectIdInvalidationMap& expected);
- virtual bool MatchAndExplain(const ObjectIdStateMap& actual,
+ virtual bool MatchAndExplain(const ObjectIdInvalidationMap& actual,
MatchResultListener* listener) const;
virtual void DescribeTo(::std::ostream* os) const;
virtual void DescribeNegationTo(::std::ostream* os) const;
private:
- const ObjectIdStateMap expected_;
+ const ObjectIdInvalidationMap expected_;
- DISALLOW_COPY_AND_ASSIGN(ObjectIdStateMapEqMatcher);
+ DISALLOW_COPY_AND_ASSIGN(ObjectIdInvalidationMapEqMatcher);
};
-ObjectIdStateMapEqMatcher::ObjectIdStateMapEqMatcher(
- const ObjectIdStateMap& expected) : expected_(expected) {
+ObjectIdInvalidationMapEqMatcher::ObjectIdInvalidationMapEqMatcher(
+ const ObjectIdInvalidationMap& expected) : expected_(expected) {
}
-bool ObjectIdStateMapEqMatcher::MatchAndExplain(
- const ObjectIdStateMap& actual, MatchResultListener* listener) const {
- ObjectIdStateMap expected_only;
- ObjectIdStateMap actual_only;
+bool ObjectIdInvalidationMapEqMatcher::MatchAndExplain(
+ const ObjectIdInvalidationMap& actual,
+ MatchResultListener* listener) const {
+ ObjectIdInvalidationMap expected_only;
+ ObjectIdInvalidationMap actual_only;
typedef std::pair<invalidation::ObjectId,
- std::pair<InvalidationState, InvalidationState> >
+ std::pair<Invalidation, Invalidation> >
ValueDifference;
std::vector<ValueDifference> value_differences;
@@ -56,9 +58,9 @@ bool ObjectIdStateMapEqMatcher::MatchAndExplain(
std::inserter(actual_only, actual_only.begin()),
actual.value_comp());
- for (ObjectIdStateMap::const_iterator it = expected_.begin();
+ for (ObjectIdInvalidationMap::const_iterator it = expected_.begin();
it != expected_.end(); ++it) {
- ObjectIdStateMap::const_iterator find_it =
+ ObjectIdInvalidationMap::const_iterator find_it =
actual.find(it->first);
if (find_it != actual.end() &&
!Matches(Eq(it->second))(find_it->second)) {
@@ -93,18 +95,20 @@ bool ObjectIdStateMapEqMatcher::MatchAndExplain(
return false;
}
-void ObjectIdStateMapEqMatcher::DescribeTo(::std::ostream* os) const {
+void ObjectIdInvalidationMapEqMatcher::DescribeTo(::std::ostream* os) const {
*os << " is equal to " << PrintToString(expected_);
}
-void ObjectIdStateMapEqMatcher::DescribeNegationTo(::std::ostream* os) const {
+void ObjectIdInvalidationMapEqMatcher::DescribeNegationTo
+(::std::ostream* os) const {
*os << " isn't equal to " << PrintToString(expected_);
}
} // namespace
-Matcher<const ObjectIdStateMap&> Eq(const ObjectIdStateMap& expected) {
- return MakeMatcher(new ObjectIdStateMapEqMatcher(expected));
+Matcher<const ObjectIdInvalidationMap&> Eq(
+ const ObjectIdInvalidationMap& expected) {
+ return MakeMatcher(new ObjectIdInvalidationMapEqMatcher(expected));
}
} // namespace syncer
« no previous file with comments | « sync/notifier/object_id_invalidation_map_test_util.h ('k') | sync/notifier/object_id_state_map.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698