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/layers/solid_color_scrollbar_layer_impl.h" | 5 #include "cc/layers/solid_color_scrollbar_layer_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "cc/test/layer_test_common.h" | 9 #include "cc/test/layer_test_common.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 thumb_thickness, | 30 thumb_thickness, |
31 track_start, | 31 track_start, |
32 is_left_side_vertical_scrollbar, | 32 is_left_side_vertical_scrollbar, |
33 is_overlay); | 33 is_overlay); |
34 scrollbar_layer_impl->SetBounds(layer_size); | 34 scrollbar_layer_impl->SetBounds(layer_size); |
35 scrollbar_layer_impl->SetDrawsContent(true); | 35 scrollbar_layer_impl->SetDrawsContent(true); |
36 scrollbar_layer_impl->SetCurrentPos(25.f); | 36 scrollbar_layer_impl->SetCurrentPos(25.f); |
37 scrollbar_layer_impl->SetClipLayerLength(100.f); | 37 scrollbar_layer_impl->SetClipLayerLength(100.f); |
38 scrollbar_layer_impl->SetScrollLayerLength(200.f); | 38 scrollbar_layer_impl->SetScrollLayerLength(200.f); |
39 // SolidColorScrollbarLayers construct with opacity = 0.f, so override. | 39 // SolidColorScrollbarLayers construct with opacity = 0.f, so override. |
40 scrollbar_layer_impl->SetOpacity(1.f); | 40 scrollbar_layer_impl->test_properties()->opacity = 1.f; |
41 | 41 |
42 impl.CalcDrawProps(viewport_size); | 42 impl.CalcDrawProps(viewport_size); |
43 | 43 |
44 gfx::Rect thumb_rect = scrollbar_layer_impl->ComputeThumbQuadRect(); | 44 gfx::Rect thumb_rect = scrollbar_layer_impl->ComputeThumbQuadRect(); |
45 EXPECT_EQ(gfx::Rect(0, 500 / 4, 10, layer_size.height() / 2).ToString(), | 45 EXPECT_EQ(gfx::Rect(0, 500 / 4, 10, layer_size.height() / 2).ToString(), |
46 thumb_rect.ToString()); | 46 thumb_rect.ToString()); |
47 | 47 |
48 { | 48 { |
49 SCOPED_TRACE("No occlusion"); | 49 SCOPED_TRACE("No occlusion"); |
50 gfx::Rect occluded; | 50 gfx::Rect occluded; |
(...skipping 21 matching lines...) Expand all Loading... |
72 LayerTestCommon::VerifyQuadsAreOccluded( | 72 LayerTestCommon::VerifyQuadsAreOccluded( |
73 impl.quad_list(), occluded, &partially_occluded_count); | 73 impl.quad_list(), occluded, &partially_occluded_count); |
74 // The layer outputs one quad, which is partially occluded. | 74 // The layer outputs one quad, which is partially occluded. |
75 EXPECT_EQ(1u, impl.quad_list().size()); | 75 EXPECT_EQ(1u, impl.quad_list().size()); |
76 EXPECT_EQ(1u, partially_occluded_count); | 76 EXPECT_EQ(1u, partially_occluded_count); |
77 } | 77 } |
78 } | 78 } |
79 | 79 |
80 } // namespace | 80 } // namespace |
81 } // namespace cc | 81 } // namespace cc |
OLD | NEW |