Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(602)

Side by Side Diff: cc/input/scrollbar_animation_controller_thinning_unittest.cc

Issue 2453553003: Disable overlay scrollbars in Blink when hidden by the compositor. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_thinning.h" 5 #include "cc/input/scrollbar_animation_controller_thinning.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 26 matching lines...) Expand all
37 } 37 }
38 void SetNeedsRedrawForScrollbarAnimation() override { 38 void SetNeedsRedrawForScrollbarAnimation() override {
39 did_request_redraw_ = true; 39 did_request_redraw_ = true;
40 } 40 }
41 void SetNeedsAnimateForScrollbarAnimation() override { 41 void SetNeedsAnimateForScrollbarAnimation() override {
42 did_request_animate_ = true; 42 did_request_animate_ = true;
43 } 43 }
44 ScrollbarSet ScrollbarsFor(int scroll_layer_id) const override { 44 ScrollbarSet ScrollbarsFor(int scroll_layer_id) const override {
45 return host_impl_.ScrollbarsFor(scroll_layer_id); 45 return host_impl_.ScrollbarsFor(scroll_layer_id);
46 } 46 }
47 void SetScrollbarsHidden(int layer_id, bool hidden) override {}
47 48
48 protected: 49 protected:
49 const base::TimeDelta kDelayBeforeStarting = base::TimeDelta::FromSeconds(2); 50 const base::TimeDelta kDelayBeforeStarting = base::TimeDelta::FromSeconds(2);
50 const base::TimeDelta kResizeDelayBeforeStarting = 51 const base::TimeDelta kResizeDelayBeforeStarting =
51 base::TimeDelta::FromSeconds(5); 52 base::TimeDelta::FromSeconds(5);
52 const base::TimeDelta kFadeDuration = base::TimeDelta::FromSeconds(3); 53 const base::TimeDelta kFadeDuration = base::TimeDelta::FromSeconds(3);
53 const base::TimeDelta kThinningDuration = base::TimeDelta::FromSeconds(2); 54 const base::TimeDelta kThinningDuration = base::TimeDelta::FromSeconds(2);
54 55
55 void SetUp() override { 56 void SetUp() override {
56 std::unique_ptr<LayerImpl> scroll_layer = 57 std::unique_ptr<LayerImpl> scroll_layer =
(...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after
926 scrollbar_controller_->Animate(time); 927 scrollbar_controller_->Animate(time);
927 EXPECT_FLOAT_EQ(0.5f, scrollbar_layer_->Opacity()); 928 EXPECT_FLOAT_EQ(0.5f, scrollbar_layer_->Opacity());
928 929
929 time += kFadeDuration / 2; 930 time += kFadeDuration / 2;
930 scrollbar_controller_->Animate(time); 931 scrollbar_controller_->Animate(time);
931 EXPECT_FLOAT_EQ(0.0f, scrollbar_layer_->Opacity()); 932 EXPECT_FLOAT_EQ(0.0f, scrollbar_layer_->Opacity());
932 } 933 }
933 934
934 } // namespace 935 } // namespace
935 } // namespace cc 936 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698