OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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/trees/layer_tree_impl.h" | 5 #include "cc/trees/layer_tree_impl.h" |
6 | 6 |
7 #include "cc/layers/heads_up_display_layer_impl.h" | 7 #include "cc/layers/heads_up_display_layer_impl.h" |
8 #include "cc/layers/layer.h" | 8 #include "cc/layers/layer.h" |
9 #include "cc/test/fake_impl_proxy.h" | 9 #include "cc/test/fake_impl_proxy.h" |
10 #include "cc/test/fake_layer_tree_host_impl.h" | 10 #include "cc/test/fake_layer_tree_host_impl.h" |
(...skipping 2301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2312 EXPECT_EQ(left_input.layer_rect, left_output.viewport_rect); | 2312 EXPECT_EQ(left_input.layer_rect, left_output.viewport_rect); |
2313 EXPECT_TRUE(left_output.visible); | 2313 EXPECT_TRUE(left_output.visible); |
2314 EXPECT_EQ(right_input.type, right_output.type); | 2314 EXPECT_EQ(right_input.type, right_output.type); |
2315 gfx::RectF expected_right_output_rect = right_input.layer_rect; | 2315 gfx::RectF expected_right_output_rect = right_input.layer_rect; |
2316 expected_right_output_rect.Offset(sub_layer_offset); | 2316 expected_right_output_rect.Offset(sub_layer_offset); |
2317 expected_right_output_rect.Scale(page_scale_factor); | 2317 expected_right_output_rect.Scale(page_scale_factor); |
2318 EXPECT_EQ(expected_right_output_rect, right_output.viewport_rect); | 2318 EXPECT_EQ(expected_right_output_rect, right_output.viewport_rect); |
2319 EXPECT_TRUE(right_output.visible); | 2319 EXPECT_TRUE(right_output.visible); |
2320 } | 2320 } |
2321 | 2321 |
| 2322 TEST_F(LayerTreeImplTest, NumLayersTestOne) { |
| 2323 EXPECT_EQ(0u, host_impl().active_tree()->NumLayers()); |
| 2324 scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl().active_tree(), 1); |
| 2325 EXPECT_EQ(1u, host_impl().active_tree()->NumLayers()); |
| 2326 } |
| 2327 |
| 2328 TEST_F(LayerTreeImplTest, NumLayersSmallTree) { |
| 2329 EXPECT_EQ(0u, host_impl().active_tree()->NumLayers()); |
| 2330 scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl().active_tree(), 1); |
| 2331 root->AddChild(LayerImpl::Create(host_impl().active_tree(), 2)); |
| 2332 root->AddChild(LayerImpl::Create(host_impl().active_tree(), 3)); |
| 2333 root->child_at(1)->AddChild(LayerImpl::Create(host_impl().active_tree(), 4)); |
| 2334 EXPECT_EQ(4u, host_impl().active_tree()->NumLayers()); |
| 2335 } |
| 2336 |
2322 } // namespace | 2337 } // namespace |
2323 } // namespace cc | 2338 } // namespace cc |
OLD | NEW |