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

Side by Side Diff: content/renderer/render_widget_unittest.cc

Issue 2285423002: Stop negating the overscroll velocity to enable the glow of main thread fling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove TODO 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
« no previous file with comments | « content/renderer/input/render_widget_input_handler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/renderer/render_widget.h" 5 #include "content/renderer/render_widget.h"
6 6
7 #include <tuple> 7 #include <tuple>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 blink::WebFloatSize(10, 5)); 267 blink::WebFloatSize(10, 5));
268 ASSERT_EQ(1u, widget()->sink()->message_count()); 268 ASSERT_EQ(1u, widget()->sink()->message_count());
269 const IPC::Message* message = widget()->sink()->GetMessageAt(0); 269 const IPC::Message* message = widget()->sink()->GetMessageAt(0);
270 ASSERT_EQ(InputHostMsg_DidOverscroll::ID, message->type()); 270 ASSERT_EQ(InputHostMsg_DidOverscroll::ID, message->type());
271 InputHostMsg_DidOverscroll::Param params; 271 InputHostMsg_DidOverscroll::Param params;
272 InputHostMsg_DidOverscroll::Read(message, &params); 272 InputHostMsg_DidOverscroll::Read(message, &params);
273 const ui::DidOverscrollParams& overscroll = std::get<0>(params); 273 const ui::DidOverscrollParams& overscroll = std::get<0>(params);
274 EXPECT_EQ(gfx::Vector2dF(10, 5), overscroll.latest_overscroll_delta); 274 EXPECT_EQ(gfx::Vector2dF(10, 5), overscroll.latest_overscroll_delta);
275 EXPECT_EQ(gfx::Vector2dF(5, 5), overscroll.accumulated_overscroll); 275 EXPECT_EQ(gfx::Vector2dF(5, 5), overscroll.accumulated_overscroll);
276 EXPECT_EQ(gfx::PointF(1, 1), overscroll.causal_event_viewport_point); 276 EXPECT_EQ(gfx::PointF(1, 1), overscroll.causal_event_viewport_point);
277 EXPECT_EQ(gfx::Vector2dF(-10, -5), overscroll.current_fling_velocity); 277 EXPECT_EQ(gfx::Vector2dF(10, 5), overscroll.current_fling_velocity);
278 widget()->sink()->ClearMessages(); 278 widget()->sink()->ClearMessages();
279 } 279 }
280 280
281 TEST_F(RenderWidgetUnittest, RenderWidgetInputEventUmaMetrics) { 281 TEST_F(RenderWidgetUnittest, RenderWidgetInputEventUmaMetrics) {
282 SyntheticWebTouchEvent touch; 282 SyntheticWebTouchEvent touch;
283 touch.PressPoint(10, 10); 283 touch.PressPoint(10, 10);
284 touch.touchStartOrFirstTouchMove = true; 284 touch.touchStartOrFirstTouchMove = true;
285 285
286 EXPECT_CALL(*widget()->mock_webwidget(), handleInputEvent(_)) 286 EXPECT_CALL(*widget()->mock_webwidget(), handleInputEvent(_))
287 .Times(5) 287 .Times(5)
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 2); 360 2);
361 361
362 touch.MovePoint(0, 30, 30); 362 touch.MovePoint(0, 30, 30);
363 touch.touchStartOrFirstTouchMove = false; 363 touch.touchStartOrFirstTouchMove = false;
364 widget()->SendInputEvent(touch); 364 widget()->SendInputEvent(touch);
365 histogram_tester().ExpectTotalCount("Event.Touch.TouchLatencyOutsideFling", 365 histogram_tester().ExpectTotalCount("Event.Touch.TouchLatencyOutsideFling",
366 2); 366 2);
367 } 367 }
368 368
369 } // namespace content 369 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/input/render_widget_input_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698