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

Side by Side Diff: cc/trees/layer_tree_host_unittest_scroll.cc

Issue 2360113003: Remove cc's MainThreadScrollingReason::kEventHandlers (Closed)
Patch Set: Undo changes to mask bits Created 4 years, 3 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 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/trees/layer_tree_host.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "base/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 1192 matching lines...) Expand 10 before | Expand all | Expand 10 after
1203 class LayerTreeHostScrollTestImplScrollUnderMainThreadScrollingParent 1203 class LayerTreeHostScrollTestImplScrollUnderMainThreadScrollingParent
1204 : public LayerTreeHostScrollTest { 1204 : public LayerTreeHostScrollTest {
1205 public: 1205 public:
1206 LayerTreeHostScrollTestImplScrollUnderMainThreadScrollingParent() {} 1206 LayerTreeHostScrollTestImplScrollUnderMainThreadScrollingParent() {}
1207 1207
1208 void BeginTest() override { PostSetNeedsCommitToMainThread(); } 1208 void BeginTest() override { PostSetNeedsCommitToMainThread(); }
1209 1209
1210 void SetupTree() override { 1210 void SetupTree() override {
1211 LayerTreeHostScrollTest::SetupTree(); 1211 LayerTreeHostScrollTest::SetupTree();
1212 layer_tree()->inner_viewport_scroll_layer()->AddMainThreadScrollingReasons( 1212 layer_tree()->inner_viewport_scroll_layer()->AddMainThreadScrollingReasons(
1213 MainThreadScrollingReason::kEventHandlers); 1213 MainThreadScrollingReason::kNonFastScrollableRegion);
1214 } 1214 }
1215 1215
1216 void DrawLayersOnThread(LayerTreeHostImpl* impl) override { 1216 void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
1217 LayerImpl* inner_scroll_layer = impl->InnerViewportScrollLayer(); 1217 LayerImpl* inner_scroll_layer = impl->InnerViewportScrollLayer();
1218 LayerImpl* outer_scroll_layer = impl->OuterViewportScrollLayer(); 1218 LayerImpl* outer_scroll_layer = impl->OuterViewportScrollLayer();
1219 1219
1220 ScrollTree& scroll_tree = 1220 ScrollTree& scroll_tree =
1221 impl->active_tree()->property_trees()->scroll_tree; 1221 impl->active_tree()->property_trees()->scroll_tree;
1222 ScrollNode* inner_scroll_node = 1222 ScrollNode* inner_scroll_node =
1223 scroll_tree.Node(inner_scroll_layer->scroll_tree_index()); 1223 scroll_tree.Node(inner_scroll_layer->scroll_tree_index());
1224 ScrollNode* outer_scroll_node = 1224 ScrollNode* outer_scroll_node =
1225 scroll_tree.Node(outer_scroll_layer->scroll_tree_index()); 1225 scroll_tree.Node(outer_scroll_layer->scroll_tree_index());
1226 1226
1227 InputHandler::ScrollStatus status = 1227 InputHandler::ScrollStatus status =
1228 impl->TryScroll(gfx::PointF(1.f, 1.f), InputHandler::TOUCHSCREEN, 1228 impl->TryScroll(gfx::PointF(1.f, 1.f), InputHandler::TOUCHSCREEN,
1229 scroll_tree, inner_scroll_node); 1229 scroll_tree, inner_scroll_node);
1230 EXPECT_EQ(InputHandler::SCROLL_ON_MAIN_THREAD, status.thread); 1230 EXPECT_EQ(InputHandler::SCROLL_ON_MAIN_THREAD, status.thread);
1231 EXPECT_EQ(MainThreadScrollingReason::kEventHandlers, 1231 EXPECT_EQ(MainThreadScrollingReason::kNonFastScrollableRegion,
1232 status.main_thread_scrolling_reasons); 1232 status.main_thread_scrolling_reasons);
1233 1233
1234 status = impl->TryScroll(gfx::PointF(1.f, 1.f), InputHandler::TOUCHSCREEN, 1234 status = impl->TryScroll(gfx::PointF(1.f, 1.f), InputHandler::TOUCHSCREEN,
1235 scroll_tree, outer_scroll_node); 1235 scroll_tree, outer_scroll_node);
1236 EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD, status.thread); 1236 EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD, status.thread);
1237 EXPECT_EQ(MainThreadScrollingReason::kNotScrollingOnMain, 1237 EXPECT_EQ(MainThreadScrollingReason::kNotScrollingOnMain,
1238 status.main_thread_scrolling_reasons); 1238 status.main_thread_scrolling_reasons);
1239 EndTest(); 1239 EndTest();
1240 } 1240 }
1241 1241
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after
1973 1973
1974 const gfx::Vector2dF elastic_overscroll_test_cases_[5] = { 1974 const gfx::Vector2dF elastic_overscroll_test_cases_[5] = {
1975 gfx::Vector2dF(0, 0), gfx::Vector2dF(5, 10), gfx::Vector2dF(5, 5), 1975 gfx::Vector2dF(0, 0), gfx::Vector2dF(5, 10), gfx::Vector2dF(5, 5),
1976 gfx::Vector2dF(-4, -5), gfx::Vector2dF(0, 0)}; 1976 gfx::Vector2dF(-4, -5), gfx::Vector2dF(0, 0)};
1977 }; 1977 };
1978 1978
1979 MULTI_THREAD_TEST_F(LayerTreeHostScrollTestElasticOverscroll); 1979 MULTI_THREAD_TEST_F(LayerTreeHostScrollTestElasticOverscroll);
1980 1980
1981 } // namespace 1981 } // namespace
1982 } // namespace cc 1982 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698