| Index: cc/trees/layer_tree_host_impl_unittest.cc
|
| diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc
|
| index 761b4a6bd9e7dd4c561511e8a9e2d9102fbdd620..aea9e01d9da7bd16726bebddc1760a74f24c591e 100644
|
| --- a/cc/trees/layer_tree_host_impl_unittest.cc
|
| +++ b/cc/trees/layer_tree_host_impl_unittest.cc
|
| @@ -464,6 +464,8 @@ class LayerTreeHostImplTest : public testing::Test,
|
|
|
| void SetupMouseMoveAtWithDeviceScale(float device_scale_factor);
|
|
|
| + void SetupMouseMoveAtTestScrollbarStates(bool main_thread_scrolling);
|
| +
|
| scoped_refptr<AnimationTimeline> timeline() { return timeline_; }
|
|
|
| protected:
|
| @@ -11621,7 +11623,8 @@ TEST_F(LayerTreeHostImplTest, RecomputeGpuRasterOnCompositorFrameSinkChange) {
|
| EXPECT_FALSE(host_impl_->use_gpu_rasterization());
|
| }
|
|
|
| -TEST_F(LayerTreeHostImplTest, LayerTreeHostImplTestScrollbarStates) {
|
| +void LayerTreeHostImplTest::SetupMouseMoveAtTestScrollbarStates(
|
| + bool main_thread_scrolling) {
|
| LayerTreeSettings settings = DefaultSettings();
|
| settings.scrollbar_fade_delay = base::TimeDelta::FromMilliseconds(500);
|
| settings.scrollbar_fade_duration = base::TimeDelta::FromMilliseconds(300);
|
| @@ -11647,6 +11650,11 @@ TEST_F(LayerTreeHostImplTest, LayerTreeHostImplTestScrollbarStates) {
|
| LayerImpl* root_scroll =
|
| host_impl_->active_tree()->OuterViewportScrollLayer();
|
|
|
| + if (main_thread_scrolling) {
|
| + root_scroll->set_main_thread_scrolling_reasons(
|
| + MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects);
|
| + }
|
| +
|
| // scrollbar_1 on root scroll.
|
| std::unique_ptr<SolidColorScrollbarLayerImpl> scrollbar_1 =
|
| SolidColorScrollbarLayerImpl::Create(host_impl_->active_tree(),
|
| @@ -11705,6 +11713,11 @@ TEST_F(LayerTreeHostImplTest, LayerTreeHostImplTestScrollbarStates) {
|
| child->SetDrawsContent(true);
|
| child->SetScrollClipLayer(child_clip_id);
|
|
|
| + if (main_thread_scrolling) {
|
| + child->set_main_thread_scrolling_reasons(
|
| + MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects);
|
| + }
|
| +
|
| scrollbar_2->SetScrollLayerId(child_scroll_id);
|
| scrollbar_2->SetDrawsContent(true);
|
| scrollbar_2->SetBounds(scrollbar_size_2);
|
| @@ -11746,5 +11759,15 @@ TEST_F(LayerTreeHostImplTest, LayerTreeHostImplTestScrollbarStates) {
|
| EXPECT_FALSE(scrollbar_2_animation_controller->mouse_is_over_scrollbar());
|
| }
|
|
|
| +TEST_F(LayerTreeHostImplTest,
|
| + LayerTreeHostImplTestScrollbarStatesInMainThreadScorlling) {
|
| + SetupMouseMoveAtTestScrollbarStates(true);
|
| +}
|
| +
|
| +TEST_F(LayerTreeHostImplTest,
|
| + LayerTreeHostImplTestScrollbarStatesInNotMainThreadScorlling) {
|
| + SetupMouseMoveAtTestScrollbarStates(false);
|
| +}
|
| +
|
| } // namespace
|
| } // namespace cc
|
|
|