cc: Log pngs in pixel test only if they are different.

BUG=

Review URL: https://codereview.chromium.org/385083002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282666 0039d316-1c4b-4281-b951-d872f2087c98
parent a4aac089
...@@ -72,13 +72,15 @@ bool MatchesPNGFile(const SkBitmap& gen_bmp, base::FilePath ref_img_path, ...@@ -72,13 +72,15 @@ bool MatchesPNGFile(const SkBitmap& gen_bmp, base::FilePath ref_img_path,
if (gen_bmp.width() == 0 || gen_bmp.height() == 0) if (gen_bmp.width() == 0 || gen_bmp.height() == 0)
return true; return true;
bool compare = comparator.Compare(gen_bmp, ref_bmp);
if (!compare) {
std::string gen_bmp_data_url = GetPNGDataUrl(gen_bmp); std::string gen_bmp_data_url = GetPNGDataUrl(gen_bmp);
std::string ref_bmp_data_url = GetPNGDataUrl(ref_bmp); std::string ref_bmp_data_url = GetPNGDataUrl(ref_bmp);
LOG(ERROR) << "Pixels do not match!"; LOG(ERROR) << "Pixels do not match!";
LOG(ERROR) << "Actual: " << gen_bmp_data_url; LOG(ERROR) << "Actual: " << gen_bmp_data_url;
LOG(ERROR) << "Expected: " << ref_bmp_data_url; LOG(ERROR) << "Expected: " << ref_bmp_data_url;
}
return comparator.Compare(gen_bmp, ref_bmp); return compare;
} }
} // namespace cc } // namespace cc
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment