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

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

Issue 2422353002: Iframe/div MD scrollbars get idle when mouse leaves the nested elements. (Closed)
Patch Set: Move the scrollbar animation logic to animation controllers. Created 4 years, 2 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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <cmath> 10 #include <cmath>
(...skipping 3212 matching lines...) Expand 10 before | Expand all | Expand 10 after
3223 EXPECT_TRUE(scrollbar_animation_controller->mouse_is_near_scrollbar()); 3223 EXPECT_TRUE(scrollbar_animation_controller->mouse_is_near_scrollbar());
3224 3224
3225 host_impl_->MouseMoveAt(gfx::Point(116, 100)); 3225 host_impl_->MouseMoveAt(gfx::Point(116, 100));
3226 EXPECT_FALSE(scrollbar_animation_controller->mouse_is_near_scrollbar()); 3226 EXPECT_FALSE(scrollbar_animation_controller->mouse_is_near_scrollbar());
3227 3227
3228 scrollbar_animation_controller->set_mouse_move_distance_for_test(102.f); 3228 scrollbar_animation_controller->set_mouse_move_distance_for_test(102.f);
3229 host_impl_->MouseMoveAt(gfx::Point(116, 100)); 3229 host_impl_->MouseMoveAt(gfx::Point(116, 100));
3230 EXPECT_TRUE(scrollbar_animation_controller->mouse_is_near_scrollbar()); 3230 EXPECT_TRUE(scrollbar_animation_controller->mouse_is_near_scrollbar());
3231 3231
3232 did_request_redraw_ = false; 3232 did_request_redraw_ = false;
3233 EXPECT_EQ(Layer::INVALID_ID, 3233 EXPECT_FALSE(scrollbar_animation_controller->mouse_is_over_scrollbar());
3234 host_impl_->scroll_layer_id_when_mouse_over_scrollbar());
3235 host_impl_->MouseMoveAt(gfx::Point(10, 100)); 3234 host_impl_->MouseMoveAt(gfx::Point(10, 100));
3236 EXPECT_EQ(117, host_impl_->scroll_layer_id_when_mouse_over_scrollbar()); 3235 EXPECT_TRUE(scrollbar_animation_controller->mouse_is_over_scrollbar());
3237 host_impl_->MouseMoveAt(gfx::Point(10, 120)); 3236 host_impl_->MouseMoveAt(gfx::Point(10, 120));
3238 EXPECT_EQ(117, host_impl_->scroll_layer_id_when_mouse_over_scrollbar()); 3237 EXPECT_TRUE(scrollbar_animation_controller->mouse_is_over_scrollbar());
3239 host_impl_->MouseMoveAt(gfx::Point(150, 120)); 3238 host_impl_->MouseMoveAt(gfx::Point(150, 120));
3240 EXPECT_EQ(Layer::INVALID_ID, 3239 EXPECT_FALSE(scrollbar_animation_controller->mouse_is_over_scrollbar());
3241 host_impl_->scroll_layer_id_when_mouse_over_scrollbar());
3242 } 3240 }
3243 3241
3244 TEST_F(LayerTreeHostImplTest, MouseMoveAtWithDeviceScaleOf1) { 3242 TEST_F(LayerTreeHostImplTest, MouseMoveAtWithDeviceScaleOf1) {
3245 SetupMouseMoveAtWithDeviceScale(1.f); 3243 SetupMouseMoveAtWithDeviceScale(1.f);
3246 } 3244 }
3247 3245
3248 TEST_F(LayerTreeHostImplTest, MouseMoveAtWithDeviceScaleOf2) { 3246 TEST_F(LayerTreeHostImplTest, MouseMoveAtWithDeviceScaleOf2) {
3249 SetupMouseMoveAtWithDeviceScale(2.f); 3247 SetupMouseMoveAtWithDeviceScale(2.f);
3250 } 3248 }
3251 3249
(...skipping 8151 matching lines...) Expand 10 before | Expand all | Expand 10 after
11403 EXPECT_TRUE(host_impl_->use_gpu_rasterization()); 11401 EXPECT_TRUE(host_impl_->use_gpu_rasterization());
11404 11402
11405 // Re-initialize with a software output surface. 11403 // Re-initialize with a software output surface.
11406 compositor_frame_sink_ = FakeCompositorFrameSink::CreateSoftware(); 11404 compositor_frame_sink_ = FakeCompositorFrameSink::CreateSoftware();
11407 host_impl_->InitializeRenderer(compositor_frame_sink_.get()); 11405 host_impl_->InitializeRenderer(compositor_frame_sink_.get());
11408 EXPECT_FALSE(host_impl_->use_gpu_rasterization()); 11406 EXPECT_FALSE(host_impl_->use_gpu_rasterization());
11409 } 11407 }
11410 11408
11411 } // namespace 11409 } // namespace
11412 } // namespace cc 11410 } // namespace cc
OLDNEW
« 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