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

Unified Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 2621133002: Return main thread scroll layer in FindScrollLayerForDeviceViewportPoint (Closed)
Patch Set: add test Created 3 years, 11 months 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 side-by-side diff with in-line comments
Download patch
« cc/trees/layer_tree_host_impl.cc ('K') | « cc/trees/layer_tree_host_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..ed8d79e1f7d6db8893a07a4cc7d1f8e2d235df68 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(
bokan 2017/01/13 19:23:38 IMO, TestScrollbarStates would be a better name
+ 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(
chaopeng 2017/01/13 19:15:28 Can child layer be not main thread scroll if the p
bokan 2017/01/13 19:23:38 Yes, they're independent so a child that scrolls o
+ MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects);
+ }
+
// scrollbar_1 on root scroll.
std::unique_ptr<SolidColorScrollbarLayerImpl> scrollbar_1 =
SolidColorScrollbarLayerImpl::Create(host_impl_->active_tree(),
@@ -11746,5 +11754,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
« cc/trees/layer_tree_host_impl.cc ('K') | « cc/trees/layer_tree_host_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698