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

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

Issue 2453553003: Disable overlay scrollbars in Blink when hidden by the compositor. (Closed)
Patch Set: Rebase 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 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 21 matching lines...) Expand all
32 } 32 }
33 void SetNeedsRedrawForScrollbarAnimation() override { 33 void SetNeedsRedrawForScrollbarAnimation() override {
34 did_request_redraw_ = true; 34 did_request_redraw_ = true;
35 } 35 }
36 void SetNeedsAnimateForScrollbarAnimation() override { 36 void SetNeedsAnimateForScrollbarAnimation() override {
37 did_request_animate_ = true; 37 did_request_animate_ = true;
38 } 38 }
39 ScrollbarSet ScrollbarsFor(int scroll_layer_id) const override { 39 ScrollbarSet ScrollbarsFor(int scroll_layer_id) const override {
40 return host_impl_.ScrollbarsFor(scroll_layer_id); 40 return host_impl_.ScrollbarsFor(scroll_layer_id);
41 } 41 }
42 void DidChangeScrollbarVisibility() override {}
42 43
43 protected: 44 protected:
44 void SetUp() override { 45 void SetUp() override {
45 const int kThumbThickness = 10; 46 const int kThumbThickness = 10;
46 const int kTrackStart = 0; 47 const int kTrackStart = 0;
47 const bool kIsLeftSideVerticalScrollbar = false; 48 const bool kIsLeftSideVerticalScrollbar = false;
48 const bool kIsOverlayScrollbar = true; // Allow opacity animations. 49 const bool kIsOverlayScrollbar = true; // Allow opacity animations.
49 50
50 std::unique_ptr<LayerImpl> scroll_layer = 51 std::unique_ptr<LayerImpl> scroll_layer =
51 LayerImpl::Create(host_impl_.active_tree(), 1); 52 LayerImpl::Create(host_impl_.active_tree(), 1);
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 EXPECT_FLOAT_EQ(1, scrollbar_layer_->Opacity()); 496 EXPECT_FLOAT_EQ(1, scrollbar_layer_->Opacity());
496 497
497 time += base::TimeDelta::FromSeconds(1); 498 time += base::TimeDelta::FromSeconds(1);
498 scrollbar_controller_->DidScrollEnd(); 499 scrollbar_controller_->DidScrollEnd();
499 EXPECT_FALSE(did_request_animate_); 500 EXPECT_FALSE(did_request_animate_);
500 EXPECT_FLOAT_EQ(1, scrollbar_layer_->Opacity()); 501 EXPECT_FLOAT_EQ(1, scrollbar_layer_->Opacity());
501 } 502 }
502 503
503 } // namespace 504 } // namespace
504 } // namespace cc 505 } // namespace cc
OLDNEW
« no previous file with comments | « cc/input/scrollbar_animation_controller.cc ('k') | cc/input/scrollbar_animation_controller_thinning.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698