| 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/input/scrollbar_animation_controller_linear_fade.h" | 5 #include "cc/input/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_task_runner_provider.h" | 8 #include "cc/test/fake_impl_task_runner_provider.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 23 matching lines...) Expand all Loading... |
| 34 } | 34 } |
| 35 void SetNeedsRedrawForScrollbarAnimation() override { | 35 void SetNeedsRedrawForScrollbarAnimation() override { |
| 36 did_request_redraw_ = true; | 36 did_request_redraw_ = true; |
| 37 } | 37 } |
| 38 void SetNeedsAnimateForScrollbarAnimation() override { | 38 void SetNeedsAnimateForScrollbarAnimation() override { |
| 39 did_request_animate_ = true; | 39 did_request_animate_ = true; |
| 40 } | 40 } |
| 41 ScrollbarSet ScrollbarsFor(int scroll_layer_id) const override { | 41 ScrollbarSet ScrollbarsFor(int scroll_layer_id) const override { |
| 42 return host_impl_.ScrollbarsFor(scroll_layer_id); | 42 return host_impl_.ScrollbarsFor(scroll_layer_id); |
| 43 } | 43 } |
| 44 void SetScrollbarsHidden(int layer_id, bool hidden) override {} |
| 44 | 45 |
| 45 protected: | 46 protected: |
| 46 void SetUp() override { | 47 void SetUp() override { |
| 47 const int kThumbThickness = 10; | 48 const int kThumbThickness = 10; |
| 48 const int kTrackStart = 0; | 49 const int kTrackStart = 0; |
| 49 const bool kIsLeftSideVerticalScrollbar = false; | 50 const bool kIsLeftSideVerticalScrollbar = false; |
| 50 const bool kIsOverlayScrollbar = true; // Allow opacity animations. | 51 const bool kIsOverlayScrollbar = true; // Allow opacity animations. |
| 51 | 52 |
| 52 std::unique_ptr<LayerImpl> scroll_layer = | 53 std::unique_ptr<LayerImpl> scroll_layer = |
| 53 LayerImpl::Create(host_impl_.active_tree(), 1); | 54 LayerImpl::Create(host_impl_.active_tree(), 1); |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 EXPECT_FLOAT_EQ(1, scrollbar_layer_->Opacity()); | 499 EXPECT_FLOAT_EQ(1, scrollbar_layer_->Opacity()); |
| 499 | 500 |
| 500 time += base::TimeDelta::FromSeconds(1); | 501 time += base::TimeDelta::FromSeconds(1); |
| 501 scrollbar_controller_->DidScrollEnd(); | 502 scrollbar_controller_->DidScrollEnd(); |
| 502 EXPECT_FALSE(did_request_animate_); | 503 EXPECT_FALSE(did_request_animate_); |
| 503 EXPECT_FLOAT_EQ(1, scrollbar_layer_->Opacity()); | 504 EXPECT_FLOAT_EQ(1, scrollbar_layer_->Opacity()); |
| 504 } | 505 } |
| 505 | 506 |
| 506 } // namespace | 507 } // namespace |
| 507 } // namespace cc | 508 } // namespace cc |
| OLD | NEW |