summaryrefslogtreecommitdiffstats
path: root/cc/trees/layer_tree_host_pixeltest_synchronous.cc
diff options
context:
space:
mode:
authorhendrikw <hendrikw@chromium.org>2015-03-25 11:16:12 -0700
committerCommit bot <commit-bot@chromium.org>2015-03-25 18:16:43 +0000
commitae0c69314c5c0025e8e6144f3a7fe64384087c77 (patch)
tree995219d516d3a21e64eefc52bb254e6c9038119f /cc/trees/layer_tree_host_pixeltest_synchronous.cc
parent053c464fe4b43cc3eab2ee41d1d4337d94e5591e (diff)
downloadchromium_src-ae0c69314c5c0025e8e6144f3a7fe64384087c77.zip
chromium_src-ae0c69314c5c0025e8e6144f3a7fe64384087c77.tar.gz
chromium_src-ae0c69314c5c0025e8e6144f3a7fe64384087c77.tar.bz2
cc: Fix crash with blink layout tests and GPU rasterization
We were missing the single-threaded task graph runner, which was required for blink's layout tests that checked for pixels. BUG=468928 Review URL: https://codereview.chromium.org/1036693002 Cr-Commit-Position: refs/heads/master@{#322192}
Diffstat (limited to 'cc/trees/layer_tree_host_pixeltest_synchronous.cc')
-rw-r--r--cc/trees/layer_tree_host_pixeltest_synchronous.cc30
1 files changed, 30 insertions, 0 deletions
diff --git a/cc/trees/layer_tree_host_pixeltest_synchronous.cc b/cc/trees/layer_tree_host_pixeltest_synchronous.cc
index c22075f..7dd6d7d 100644
--- a/cc/trees/layer_tree_host_pixeltest_synchronous.cc
+++ b/cc/trees/layer_tree_host_pixeltest_synchronous.cc
@@ -44,6 +44,36 @@ TEST_F(LayerTreeHostSynchronousPixelTest, OneContentLayer) {
PIXEL_TEST_GL, root, base::FilePath(FILE_PATH_LITERAL("green.png")));
}
+class LayerTreeHostSynchronousGPUPixelTest : public LayerTreePixelTest {
+ public:
+ void InitializeSettings(LayerTreeSettings* settings) override {
+ LayerTreePixelTest::InitializeSettings(settings);
+ settings->single_thread_proxy_scheduler = false;
+ settings->gpu_rasterization_enabled = true;
+ settings->gpu_rasterization_forced = true;
+ }
+
+ void BeginTest() override {
+ LayerTreePixelTest::BeginTest();
+ PostCompositeImmediatelyToMainThread();
+ }
+};
+
+TEST_F(LayerTreeHostSynchronousGPUPixelTest, OneContentLayer) {
+ gfx::Size bounds(200, 200);
+
+ FakeContentLayerClient client;
+ SkPaint green_paint;
+ green_paint.setColor(SkColorSetARGB(255, 0, 255, 0));
+ client.add_draw_rect(gfx::RectF(bounds), green_paint);
+ scoped_refptr<PictureLayer> root = PictureLayer::Create(&client);
+ root->SetBounds(bounds);
+ root->SetIsDrawable(true);
+
+ RunSingleThreadedPixelTest(PIXEL_TEST_GL, root,
+ base::FilePath(FILE_PATH_LITERAL("green.png")));
+}
+
} // namespace
} // namespace cc