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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/test/pixel_test_utils.h" 5 #include "cc/test/pixel_test_utils.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 << "Actual: " << gen_bmp.width() << "x" << gen_bmp.height() 65 << "Actual: " << gen_bmp.width() << "x" << gen_bmp.height()
66 << "; " 66 << "; "
67 << "Expected: " << ref_bmp.width() << "x" << ref_bmp.height(); 67 << "Expected: " << ref_bmp.width() << "x" << ref_bmp.height();
68 return false; 68 return false;
69 } 69 }
70 70
71 // Shortcut for empty images. They are always equal. 71 // Shortcut for empty images. They are always equal.
72 if (gen_bmp.width() == 0 || gen_bmp.height() == 0) 72 if (gen_bmp.width() == 0 || gen_bmp.height() == 0)
73 return true; 73 return true;
74 74
75 std::string gen_bmp_data_url = GetPNGDataUrl(gen_bmp); 75 bool compare = comparator.Compare(gen_bmp, ref_bmp);
76 std::string ref_bmp_data_url = GetPNGDataUrl(ref_bmp); 76 if (!compare) {
77 LOG(ERROR) << "Pixels do not match!"; 77 std::string gen_bmp_data_url = GetPNGDataUrl(gen_bmp);
78 LOG(ERROR) << "Actual: " << gen_bmp_data_url; 78 std::string ref_bmp_data_url = GetPNGDataUrl(ref_bmp);
79 LOG(ERROR) << "Expected: " << ref_bmp_data_url; 79 LOG(ERROR) << "Pixels do not match!";
80 80 LOG(ERROR) << "Actual: " << gen_bmp_data_url;
81 return comparator.Compare(gen_bmp, ref_bmp); 81 LOG(ERROR) << "Expected: " << ref_bmp_data_url;
82 }
83 return compare;
82 } 84 }
83 85
84 } // namespace cc 86 } // namespace cc
OLDNEW
« 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