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

Unified Diff: sync/internal_api/public/base/model_type_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
Index: sync/internal_api/public/base/model_type_invalidation_map_test_util.cc
diff --git a/sync/internal_api/public/base/model_type_state_map_test_util.cc b/sync/internal_api/public/base/model_type_invalidation_map_test_util.cc
similarity index 64%
rename from sync/internal_api/public/base/model_type_state_map_test_util.cc
rename to sync/internal_api/public/base/model_type_invalidation_map_test_util.cc
index 3b975f8d5ffd5aaf1257bdc422c8b6ca2a10c693..991a6e1065b9e654da54e17def98808ce9d56844 100644
--- a/sync/internal_api/public/base/model_type_state_map_test_util.cc
+++ b/sync/internal_api/public/base/model_type_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/internal_api/public/base/model_type_state_map_test_util.h"
+#include "sync/internal_api/public/base/model_type_invalidation_map_test_util.h"
#include <algorithm>
@@ -19,32 +19,33 @@ using ::testing::PrintToString;
namespace {
-class ModelTypeStateMapEqMatcher
- : public MatcherInterface<const ModelTypeStateMap&> {
+class ModelTypeInvalidationMapEqMatcher
+ : public MatcherInterface<const ModelTypeInvalidationMap&> {
public:
- explicit ModelTypeStateMapEqMatcher(const ModelTypeStateMap& expected);
+ explicit ModelTypeInvalidationMapEqMatcher(
+ const ModelTypeInvalidationMap& expected);
- virtual bool MatchAndExplain(const ModelTypeStateMap& lhs,
+ virtual bool MatchAndExplain(const ModelTypeInvalidationMap& lhs,
MatchResultListener* listener) const;
virtual void DescribeTo(::std::ostream* os) const;
virtual void DescribeNegationTo(::std::ostream* os) const;
private:
- const ModelTypeStateMap expected_;
+ const ModelTypeInvalidationMap expected_;
- DISALLOW_COPY_AND_ASSIGN(ModelTypeStateMapEqMatcher);
+ DISALLOW_COPY_AND_ASSIGN(ModelTypeInvalidationMapEqMatcher);
};
-ModelTypeStateMapEqMatcher::ModelTypeStateMapEqMatcher(
- const ModelTypeStateMap& expected) : expected_(expected) {
+ModelTypeInvalidationMapEqMatcher::ModelTypeInvalidationMapEqMatcher(
+ const ModelTypeInvalidationMap& expected) : expected_(expected) {
}
-bool ModelTypeStateMapEqMatcher::MatchAndExplain(
- const ModelTypeStateMap& actual, MatchResultListener* listener) const {
- ModelTypeStateMap expected_only;
- ModelTypeStateMap actual_only;
- typedef std::pair<ModelType,
- std::pair<InvalidationState, InvalidationState> >
+bool ModelTypeInvalidationMapEqMatcher::MatchAndExplain(
+ const ModelTypeInvalidationMap& actual,
+ MatchResultListener* listener) const {
+ ModelTypeInvalidationMap expected_only;
+ ModelTypeInvalidationMap actual_only;
+ typedef std::pair<ModelType, std::pair<Invalidation, Invalidation> >
ValueDifference;
std::vector<ValueDifference> value_differences;
@@ -57,9 +58,9 @@ bool ModelTypeStateMapEqMatcher::MatchAndExplain(
std::inserter(actual_only, actual_only.begin()),
actual.value_comp());
- for (ModelTypeStateMap::const_iterator it = expected_.begin();
+ for (ModelTypeInvalidationMap::const_iterator it = expected_.begin();
it != expected_.end(); ++it) {
- ModelTypeStateMap::const_iterator find_it =
+ ModelTypeInvalidationMap::const_iterator find_it =
actual.find(it->first);
if (find_it != actual.end() &&
!Matches(Eq(it->second))(find_it->second)) {
@@ -94,18 +95,20 @@ bool ModelTypeStateMapEqMatcher::MatchAndExplain(
return false;
}
-void ModelTypeStateMapEqMatcher::DescribeTo(::std::ostream* os) const {
+void ModelTypeInvalidationMapEqMatcher::DescribeTo(::std::ostream* os) const {
*os << " is equal to " << PrintToString(expected_);
}
-void ModelTypeStateMapEqMatcher::DescribeNegationTo(::std::ostream* os) const {
+void ModelTypeInvalidationMapEqMatcher::DescribeNegationTo(
+ ::std::ostream* os) const {
*os << " isn't equal to " << PrintToString(expected_);
}
} // namespace
-Matcher<const ModelTypeStateMap&> Eq(const ModelTypeStateMap& expected) {
- return MakeMatcher(new ModelTypeStateMapEqMatcher(expected));
+Matcher<const ModelTypeInvalidationMap&> Eq(
+ const ModelTypeInvalidationMap& expected) {
+ return MakeMatcher(new ModelTypeInvalidationMapEqMatcher(expected));
}
} // namespace syncer

Powered by Google App Engine
This is Rietveld 408576698