OLD | NEW |
| (Empty) |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "build/build_config.h" | |
6 #include "cc/layers/content_layer_client.h" | |
7 #include "cc/layers/picture_image_layer.h" | |
8 #include "cc/layers/picture_layer.h" | |
9 #include "cc/layers/solid_color_layer.h" | |
10 #include "cc/test/fake_content_layer_client.h" | |
11 #include "cc/test/layer_tree_pixel_test.h" | |
12 #include "cc/test/pixel_comparator.h" | |
13 | |
14 #if !defined(OS_ANDROID) | |
15 | |
16 namespace cc { | |
17 namespace { | |
18 | |
19 class LayerTreeHostSynchronousPixelTest : public LayerTreePixelTest { | |
20 public: | |
21 void InitializeSettings(LayerTreeSettings* settings) override { | |
22 LayerTreePixelTest::InitializeSettings(settings); | |
23 settings->single_thread_proxy_scheduler = false; | |
24 } | |
25 | |
26 void BeginTest() override { | |
27 LayerTreePixelTest::BeginTest(); | |
28 PostCompositeImmediatelyToMainThread(); | |
29 } | |
30 }; | |
31 | |
32 TEST_F(LayerTreeHostSynchronousPixelTest, OneContentLayer) { | |
33 gfx::Size bounds(200, 200); | |
34 | |
35 FakeContentLayerClient client; | |
36 SkPaint green_paint; | |
37 green_paint.setColor(SkColorSetARGB(255, 0, 255, 0)); | |
38 client.add_draw_rect(gfx::RectF(bounds), green_paint); | |
39 scoped_refptr<PictureLayer> root = PictureLayer::Create(&client); | |
40 root->SetBounds(bounds); | |
41 root->SetIsDrawable(true); | |
42 | |
43 RunSingleThreadedPixelTest( | |
44 PIXEL_TEST_GL, root, base::FilePath(FILE_PATH_LITERAL("green.png"))); | |
45 } | |
46 | |
47 } // namespace | |
48 } // namespace cc | |
49 | |
50 #endif // OS_ANDROID | |
OLD | NEW |