OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/layers/nine_patch_layer.h" | 5 #include "cc/layers/nine_patch_layer.h" |
6 | 6 |
7 #include "cc/resources/resource_provider.h" | 7 #include "cc/resources/resource_provider.h" |
8 #include "cc/resources/scoped_ui_resource.h" | 8 #include "cc/resources/scoped_ui_resource.h" |
9 #include "cc/test/fake_layer_tree_host.h" | 9 #include "cc/test/fake_layer_tree_host.h" |
10 #include "cc/test/fake_layer_tree_host_client.h" | 10 #include "cc/test/fake_layer_tree_host_client.h" |
11 #include "cc/test/fake_output_surface.h" | 11 #include "cc/test/fake_output_surface.h" |
12 #include "cc/test/fake_output_surface_client.h" | 12 #include "cc/test/fake_output_surface_client.h" |
13 #include "cc/test/geometry_test_utils.h" | 13 #include "cc/test/geometry_test_utils.h" |
14 #include "cc/test/test_task_graph_runner.h" | 14 #include "cc/test/test_task_graph_runner.h" |
15 #include "cc/trees/layer_tree_host.h" | 15 #include "cc/trees/layer_tree_host.h" |
16 #include "cc/trees/single_thread_proxy.h" | 16 #include "cc/trees/single_thread_proxy.h" |
17 #include "testing/gmock/include/gmock/gmock.h" | 17 #include "testing/gmock/include/gmock/gmock.h" |
18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
19 #include "third_party/skia/include/core/SkBitmap.h" | 19 #include "third_party/skia/include/core/SkBitmap.h" |
20 | 20 |
21 using ::testing::Mock; | 21 using ::testing::Mock; |
22 using ::testing::_; | 22 using ::testing::_; |
23 using ::testing::AtLeast; | 23 using ::testing::AtLeast; |
24 using ::testing::AnyNumber; | 24 using ::testing::AnyNumber; |
25 | 25 |
26 namespace cc { | 26 namespace cc { |
27 namespace { | 27 namespace { |
28 | 28 |
29 class NinePatchLayerTest : public testing::Test { | 29 class NinePatchLayerTest : public testing::Test { |
30 public: | |
31 NinePatchLayerTest() : fake_client_(FakeLayerTreeHostClient::DIRECT_3D) {} | |
32 | |
33 protected: | 30 protected: |
34 void SetUp() override { | 31 void SetUp() override { |
35 layer_tree_host_ = | 32 layer_tree_host_ = |
36 FakeLayerTreeHost::Create(&fake_client_, &task_graph_runner_); | 33 FakeLayerTreeHost::Create(&fake_client_, &task_graph_runner_); |
37 } | 34 } |
38 | 35 |
39 void TearDown() override { | 36 void TearDown() override { |
40 Mock::VerifyAndClearExpectations(layer_tree_host_.get()); | 37 Mock::VerifyAndClearExpectations(layer_tree_host_.get()); |
41 } | 38 } |
42 | 39 |
(...skipping 26 matching lines...) Expand all Loading... |
69 test_layer->SetAperture(aperture); | 66 test_layer->SetAperture(aperture); |
70 test_layer->SetUIResourceId(resource->id()); | 67 test_layer->SetUIResourceId(resource->id()); |
71 test_layer->SetFillCenter(fill_center); | 68 test_layer->SetFillCenter(fill_center); |
72 test_layer->Update(); | 69 test_layer->Update(); |
73 | 70 |
74 EXPECT_TRUE(test_layer->DrawsContent()); | 71 EXPECT_TRUE(test_layer->DrawsContent()); |
75 } | 72 } |
76 | 73 |
77 } // namespace | 74 } // namespace |
78 } // namespace cc | 75 } // namespace cc |
OLD | NEW |