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

Side by Side Diff: cc/test/layer_tree_pixel_test.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 unified diff | Download patch
« no previous file with comments | « cc/output/gl_renderer_pixeltest.cc ('k') | cc/test/pixel_comparator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/layer_tree_pixel_test.h" 5 #include "cc/test/layer_tree_pixel_test.h"
6 6
7 #include "base/path_service.h" 7 #include "base/path_service.h"
8 #include "cc/test/paths.h" 8 #include "cc/test/paths.h"
9 #include "cc/test/pixel_test_utils.h" 9 #include "cc/test/pixel_test_utils.h"
10 #include "cc/trees/layer_tree_impl.h" 10 #include "cc/trees/layer_tree_impl.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 bitmap.allocPixels(); 59 bitmap.allocPixels();
60 unsigned char* pixels = static_cast<unsigned char*>(bitmap.getPixels()); 60 unsigned char* pixels = static_cast<unsigned char*>(bitmap.getPixels());
61 host_impl->Readback(pixels, device_viewport_rect); 61 host_impl->Readback(pixels, device_viewport_rect);
62 62
63 base::FilePath test_data_dir; 63 base::FilePath test_data_dir;
64 EXPECT_TRUE(PathService::Get(cc::DIR_TEST_DATA, &test_data_dir)); 64 EXPECT_TRUE(PathService::Get(cc::DIR_TEST_DATA, &test_data_dir));
65 65
66 // To rebaseline: 66 // To rebaseline:
67 // EXPECT_TRUE(WritePNGFile(bitmap, test_data_dir.Append(ref_file_))); 67 // EXPECT_TRUE(WritePNGFile(bitmap, test_data_dir.Append(ref_file_)));
68 68
69 EXPECT_TRUE(IsSameAsPNGFile(bitmap, test_data_dir.Append(ref_file_), true)); 69 EXPECT_TRUE(MatchesPNGFile(bitmap, test_data_dir.Append(ref_file_),
70 ExactPixelComparator(true)));
70 71
71 EndTest(); 72 EndTest();
72 } 73 }
73 74
74 void LayerTreePixelTest::BeginTest() { 75 void LayerTreePixelTest::BeginTest() {
75 PostSetNeedsCommitToMainThread(); 76 PostSetNeedsCommitToMainThread();
76 } 77 }
77 78
78 void LayerTreePixelTest::AfterTest() {} 79 void LayerTreePixelTest::AfterTest() {}
79 80
(...skipping 18 matching lines...) Expand all
98 99
99 void LayerTreePixelTest::SetupTree() { 100 void LayerTreePixelTest::SetupTree() {
100 scoped_refptr<Layer> root = Layer::Create(); 101 scoped_refptr<Layer> root = Layer::Create();
101 root->SetBounds(content_root_->bounds()); 102 root->SetBounds(content_root_->bounds());
102 root->AddChild(content_root_); 103 root->AddChild(content_root_);
103 layer_tree_host()->SetRootLayer(root); 104 layer_tree_host()->SetRootLayer(root);
104 LayerTreeTest::SetupTree(); 105 LayerTreeTest::SetupTree();
105 } 106 }
106 107
107 } // namespace cc 108 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/gl_renderer_pixeltest.cc ('k') | cc/test/pixel_comparator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698