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

Unified Diff: cc/test/pixel_test_utils.h

Issue 12558003: cc: Made image comparison for pixel tests error tolerant. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Introduced PixelComparator interface. Refactored code. Created 7 years, 9 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: cc/test/pixel_test_utils.h
diff --git a/cc/test/pixel_test_utils.h b/cc/test/pixel_test_utils.h
index 29dad87caca79ce2ec4f990acbf57e21c22fcbe2..6d445985af176799cd3504dfb933a3fef79ade27 100644
--- a/cc/test/pixel_test_utils.h
+++ b/cc/test/pixel_test_utils.h
@@ -6,6 +6,7 @@
#define CC_TEST_PIXEL_TEST_UTILS_H_
#include "base/files/file_path.h"
+#include "cc/test/pixel_comparator.h"
class SkBitmap;
@@ -19,9 +20,10 @@ bool WritePNGFile(const SkBitmap& bitmap, const base::FilePath& file_path);
// should have been encoded using |gfx::PNGCodec::Encode|.
bool ReadPNGFile(const base::FilePath& file_path, SkBitmap* bitmap);
-// Compares with a PNG file on disk, and returns true if it is the same as
-// the given image. |ref_img_path| is absolute.
-bool IsSameAsPNGFile(const SkBitmap& gen_bmp, base::FilePath ref_img_path);
+// Compares with a PNG file on disk using the given ImageComparator, and returns
reveman 2013/03/07 21:41:25 s/ImageComparator/PixelComparator/
ernstm 2013/03/08 00:14:46 Done.
+// true if the comparator returns a match. |ref_img_path| is absolute.
+bool MatchesPNGFile(const SkBitmap& gen_bmp, base::FilePath ref_img_path,
+ const PixelComparator& comparator);
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698