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

Unified Diff: chrome/test/live_sync/bookmark_model_verifier.cc

Issue 6351001: Debugging updates for sync integration tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Favicon size Created 9 years, 11 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 | « no previous file | chrome/test/live_sync/live_sync_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/live_sync/bookmark_model_verifier.cc
diff --git a/chrome/test/live_sync/bookmark_model_verifier.cc b/chrome/test/live_sync/bookmark_model_verifier.cc
index 0623c77b6965c5cc67623a458ece464764fee085..ec0e87d5bcd24d7bd020359d55a737f52f3ca721 100644
--- a/chrome/test/live_sync/bookmark_model_verifier.cc
+++ b/chrome/test/live_sync/bookmark_model_verifier.cc
@@ -71,13 +71,28 @@ bool BookmarkModelVerifier::NodesMatch(const BookmarkNode* node_a,
const BookmarkNode* node_b) {
if (node_a == NULL || node_b == NULL)
return node_a == node_b;
- bool ret_val = true;
- ret_val = ret_val && (node_a->GetTitle() == node_b->GetTitle());
- ret_val = ret_val && (node_a->is_folder() == node_b->is_folder());
- ret_val = ret_val && (node_a->GetURL() == node_b->GetURL());
- ret_val = ret_val && (node_a->GetParent()->IndexOfChild(node_a) ==
- node_b->GetParent()->IndexOfChild(node_b));
- return ret_val;
+ if (node_a->is_folder() != node_b->is_folder()) {
+ LOG(ERROR) << "Cannot compare folder with bookmark";
+ return false;
+ }
+ if (node_a->GetTitle() != node_b->GetTitle()) {
+ LOG(ERROR) << "Title mismatch: " << node_a->GetTitle() << " vs. "
+ << node_b->GetTitle();
+ return false;
+ }
+ if (node_a->GetURL() != node_b->GetURL()) {
+ LOG(ERROR) << "URL mismatch: " << node_a->GetURL() << " vs. "
+ << node_b->GetURL();
+ return false;
+ }
+ if (node_a->GetParent()->IndexOfChild(node_a) !=
+ node_b->GetParent()->IndexOfChild(node_b)) {
+ LOG(ERROR) << "Index mismatch: "
+ << node_a->GetParent()->IndexOfChild(node_a) << " vs. "
+ << node_b->GetParent()->IndexOfChild(node_b);
+ return false;
+ }
+ return true;
}
// static
@@ -105,17 +120,25 @@ bool BookmarkModelVerifier::FaviconsMatch(const SkBitmap& bitmap_a,
return true;
if ((bitmap_a.getSize() != bitmap_b.getSize()) ||
(bitmap_a.width() != bitmap_b.width()) ||
- (bitmap_a.height() != bitmap_b.height()))
+ (bitmap_a.height() != bitmap_b.height())) {
+ LOG(ERROR) << "Favicon size mismatch: " << bitmap_a.getSize() << " ("
+ << bitmap_a.width() << "x" << bitmap_a.height() << ") vs. "
+ << bitmap_b.getSize() << " (" << bitmap_b.width() << "x"
+ << bitmap_b.height() << ")";
return false;
+ }
SkAutoLockPixels bitmap_lock_a(bitmap_a);
SkAutoLockPixels bitmap_lock_b(bitmap_b);
void* node_pixel_addr_a = bitmap_a.getPixels();
EXPECT_TRUE(node_pixel_addr_a);
void* node_pixel_addr_b = bitmap_b.getPixels();
EXPECT_TRUE(node_pixel_addr_b);
- return (memcmp(node_pixel_addr_a,
- node_pixel_addr_b,
- bitmap_a.getSize()) == 0);
+ if (memcmp(node_pixel_addr_a, node_pixel_addr_b, bitmap_a.getSize()) != 0) {
+ LOG(ERROR) << "Favicon bitmap mismatch";
+ return false;
+ } else {
+ return true;
+ }
}
bool BookmarkModelVerifier::ContainsDuplicateBookmarks(BookmarkModel* model) {
« no previous file with comments | « no previous file | chrome/test/live_sync/live_sync_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698