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

Unified Diff: chrome/browser/sync/test/integration/sync_app_helper.cc

Issue 9340007: Make the Chrome Web Store Icon Syncable (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Better detection of what apps need ordinals Created 8 years, 10 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: chrome/browser/sync/test/integration/sync_app_helper.cc
diff --git a/chrome/browser/sync/test/integration/sync_app_helper.cc b/chrome/browser/sync/test/integration/sync_app_helper.cc
index 9ab1875a958d87a1199312d951c104a427e0f593..a2864beef3c6d3efe2e8b8604527414876c126d9 100644
--- a/chrome/browser/sync/test/integration/sync_app_helper.cc
+++ b/chrome/browser/sync/test/integration/sync_app_helper.cc
@@ -17,6 +17,7 @@ namespace {
struct AppState {
AppState();
~AppState();
+ bool IsValid() const;
bool Equals(const AppState& other) const;
StringOrdinal app_launch_ordinal;
@@ -29,6 +30,10 @@ AppState::AppState() {}
AppState::~AppState() {}
+bool AppState::IsValid() const {
+ return page_ordinal.IsValid() && app_launch_ordinal.IsValid();
+}
+
bool AppState::Equals(const AppState& other) const {
return app_launch_ordinal.Equal(other.app_launch_ordinal) &&
page_ordinal.Equal(other.page_ordinal);
@@ -112,6 +117,14 @@ bool SyncAppHelper::AppStatesMatch(Profile* profile1, Profile* profile2) {
DVLOG(2) << "Apps for profile " << profile1->GetDebugName()
<< " do not match profile " << profile2->GetDebugName();
return false;
+ } else if (!it1->second.IsValid()) {
+ DVLOG(2) << "Apps for profile " << profile1->GetDebugName()
+ << " are not valid.";
+ return false;
+ } else if (!it2->second.IsValid()) {
+ DVLOG(2) << "Apps for profile " << profile2->GetDebugName()
+ << " are not valid.";
+ return false;
} else if (!it1->second.Equals(it2->second)) {
DVLOG(2) << "App states for profile " << profile1->GetDebugName()
<< " do not match profile " << profile2->GetDebugName();

Powered by Google App Engine
This is Rietveld 408576698