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

Unified Diff: cc/test/pixel_test_utils.cc

Issue 385083002: cc: Log pngs in pixel test only if they are different. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/pixel_test_utils.cc
diff --git a/cc/test/pixel_test_utils.cc b/cc/test/pixel_test_utils.cc
index 9fbc86a79a34787b548c46288a81adb0060c6ae5..a0ddad382eb247ef34a90937b32af452fb2ddc58 100644
--- a/cc/test/pixel_test_utils.cc
+++ b/cc/test/pixel_test_utils.cc
@@ -72,13 +72,15 @@ bool MatchesPNGFile(const SkBitmap& gen_bmp, base::FilePath ref_img_path,
if (gen_bmp.width() == 0 || gen_bmp.height() == 0)
return true;
- std::string gen_bmp_data_url = GetPNGDataUrl(gen_bmp);
- std::string ref_bmp_data_url = GetPNGDataUrl(ref_bmp);
- LOG(ERROR) << "Pixels do not match!";
- LOG(ERROR) << "Actual: " << gen_bmp_data_url;
- LOG(ERROR) << "Expected: " << ref_bmp_data_url;
-
- return comparator.Compare(gen_bmp, ref_bmp);
+ bool compare = comparator.Compare(gen_bmp, ref_bmp);
+ if (!compare) {
+ std::string gen_bmp_data_url = GetPNGDataUrl(gen_bmp);
+ std::string ref_bmp_data_url = GetPNGDataUrl(ref_bmp);
+ LOG(ERROR) << "Pixels do not match!";
+ LOG(ERROR) << "Actual: " << gen_bmp_data_url;
+ LOG(ERROR) << "Expected: " << ref_bmp_data_url;
+ }
+ return compare;
}
} // namespace cc
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698