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

Unified Diff: ui/compositor/layer_unittest.cc

Issue 12558003: cc: Made image comparison for pixel tests error tolerant. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added output of error pixel details. 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
« no previous file with comments | « cc/test/pixel_test_utils.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/layer_unittest.cc
diff --git a/ui/compositor/layer_unittest.cc b/ui/compositor/layer_unittest.cc
index 5dda85f59fe0cd3d06b1546d5006551a95f8ae4d..d8c8e31faaa433d03ce087666b24a9df4852d775 100644
--- a/ui/compositor/layer_unittest.cc
+++ b/ui/compositor/layer_unittest.cc
@@ -25,7 +25,7 @@
#include "ui/gfx/gfx_paths.h"
#include "ui/gfx/skia_util.h"
-using cc::IsSameAsPNGFile;
+using cc::MatchesPNGFile;
namespace ui {
@@ -919,35 +919,35 @@ TEST_F(LayerWithRealCompositorTest, MAYBE_ModifyHierarchy) {
ASSERT_TRUE(ReadPixels(&bitmap));
ASSERT_FALSE(bitmap.empty());
// WritePNGFile(bitmap, ref_img1);
- EXPECT_TRUE(IsSameAsPNGFile(bitmap, ref_img1, true));
+ EXPECT_TRUE(MatchesPNGFile(bitmap, ref_img1, cc::ExactPixelComparator(true)));
l0->StackAtTop(l11.get());
DrawTree(l0.get());
ASSERT_TRUE(ReadPixels(&bitmap));
ASSERT_FALSE(bitmap.empty());
// WritePNGFile(bitmap, ref_img2);
- EXPECT_TRUE(IsSameAsPNGFile(bitmap, ref_img2, true));
+ EXPECT_TRUE(MatchesPNGFile(bitmap, ref_img2, cc::ExactPixelComparator(true)));
// l11 is already at the front, should have no effect.
l0->StackAtTop(l11.get());
DrawTree(l0.get());
ASSERT_TRUE(ReadPixels(&bitmap));
ASSERT_FALSE(bitmap.empty());
- EXPECT_TRUE(IsSameAsPNGFile(bitmap, ref_img2, true));
+ EXPECT_TRUE(MatchesPNGFile(bitmap, ref_img2, cc::ExactPixelComparator(true)));
// l11 is already at the front, should have no effect.
l0->StackAbove(l11.get(), l12.get());
DrawTree(l0.get());
ASSERT_TRUE(ReadPixels(&bitmap));
ASSERT_FALSE(bitmap.empty());
- EXPECT_TRUE(IsSameAsPNGFile(bitmap, ref_img2, true));
+ EXPECT_TRUE(MatchesPNGFile(bitmap, ref_img2, cc::ExactPixelComparator(true)));
// should restore to original configuration
l0->StackAbove(l12.get(), l11.get());
DrawTree(l0.get());
ASSERT_TRUE(ReadPixels(&bitmap));
ASSERT_FALSE(bitmap.empty());
- EXPECT_TRUE(IsSameAsPNGFile(bitmap, ref_img1, true));
+ EXPECT_TRUE(MatchesPNGFile(bitmap, ref_img1, cc::ExactPixelComparator(true)));
}
// Opacity is rendered correctly.
@@ -971,7 +971,7 @@ TEST_F(LayerWithRealCompositorTest, MAYBE_Opacity) {
ASSERT_TRUE(ReadPixels(&bitmap));
ASSERT_FALSE(bitmap.empty());
// WritePNGFile(bitmap, ref_img);
- EXPECT_TRUE(IsSameAsPNGFile(bitmap, ref_img, true));
+ EXPECT_TRUE(MatchesPNGFile(bitmap, ref_img, cc::ExactPixelComparator(true)));
}
namespace {
« no previous file with comments | « cc/test/pixel_test_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698