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/animation/scrollbar_animation_controller_linear_fade.h" | 5 #include "cc/animation/scrollbar_animation_controller_linear_fade.h" |
6 | 6 |
7 #include "cc/layers/solid_color_scrollbar_layer_impl.h" | 7 #include "cc/layers/solid_color_scrollbar_layer_impl.h" |
8 #include "cc/test/fake_impl_proxy.h" | 8 #include "cc/test/fake_impl_proxy.h" |
9 #include "cc/test/fake_layer_tree_host_impl.h" | 9 #include "cc/test/fake_layer_tree_host_impl.h" |
10 #include "cc/test/geometry_test_utils.h" | 10 #include "cc/test/geometry_test_utils.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 : host_impl_(&proxy_, &shared_bitmap_manager_), needs_frame_count_(0) {} | 23 : host_impl_(&proxy_, &shared_bitmap_manager_), needs_frame_count_(0) {} |
24 | 24 |
25 void PostDelayedScrollbarFade(const base::Closure& start_fade, | 25 void PostDelayedScrollbarFade(const base::Closure& start_fade, |
26 base::TimeDelta delay) override { | 26 base::TimeDelta delay) override { |
27 start_fade_ = start_fade; | 27 start_fade_ = start_fade; |
28 delay_ = delay; | 28 delay_ = delay; |
29 } | 29 } |
30 void SetNeedsScrollbarAnimationFrame() override { needs_frame_count_++; } | 30 void SetNeedsScrollbarAnimationFrame() override { needs_frame_count_++; } |
31 | 31 |
32 protected: | 32 protected: |
33 virtual void SetUp() { | 33 void SetUp() override { |
34 const int kThumbThickness = 10; | 34 const int kThumbThickness = 10; |
35 const int kTrackStart = 0; | 35 const int kTrackStart = 0; |
36 const bool kIsLeftSideVerticalScrollbar = false; | 36 const bool kIsLeftSideVerticalScrollbar = false; |
37 const bool kIsOverlayScrollbar = true; // Allow opacity animations. | 37 const bool kIsOverlayScrollbar = true; // Allow opacity animations. |
38 | 38 |
39 scoped_ptr<LayerImpl> scroll_layer = | 39 scoped_ptr<LayerImpl> scroll_layer = |
40 LayerImpl::Create(host_impl_.active_tree(), 1); | 40 LayerImpl::Create(host_impl_.active_tree(), 1); |
41 scrollbar_layer_ = | 41 scrollbar_layer_ = |
42 SolidColorScrollbarLayerImpl::Create(host_impl_.active_tree(), | 42 SolidColorScrollbarLayerImpl::Create(host_impl_.active_tree(), |
43 2, | 43 2, |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 scrollbar_controller_->DidScrollUpdate(false); | 410 scrollbar_controller_->DidScrollUpdate(false); |
411 EXPECT_FLOAT_EQ(1, scrollbar_layer_->opacity()); | 411 EXPECT_FLOAT_EQ(1, scrollbar_layer_->opacity()); |
412 | 412 |
413 time += base::TimeDelta::FromSeconds(1); | 413 time += base::TimeDelta::FromSeconds(1); |
414 scrollbar_controller_->DidScrollEnd(); | 414 scrollbar_controller_->DidScrollEnd(); |
415 EXPECT_FLOAT_EQ(1, scrollbar_layer_->opacity()); | 415 EXPECT_FLOAT_EQ(1, scrollbar_layer_->opacity()); |
416 } | 416 } |
417 | 417 |
418 } // namespace | 418 } // namespace |
419 } // namespace cc | 419 } // namespace cc |
OLD | NEW |