| OLD | NEW |
| 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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 // Overscroll notifications received outside of handling an input event should | 263 // Overscroll notifications received outside of handling an input event should |
| 264 // be sent as a separate IPC. | 264 // be sent as a separate IPC. |
| 265 widget()->didOverscroll(blink::WebFloatSize(10, 5), blink::WebFloatSize(5, 5), | 265 widget()->didOverscroll(blink::WebFloatSize(10, 5), blink::WebFloatSize(5, 5), |
| 266 blink::WebFloatPoint(1, 1), | 266 blink::WebFloatPoint(1, 1), |
| 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, ¶ms); | 272 InputHostMsg_DidOverscroll::Read(message, ¶ms); |
| 273 const 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); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 histogram_tester().ExpectTotalCount( | 342 histogram_tester().ExpectTotalCount( |
| 343 "Event.Touch.TouchStartLatencyDuringFling", 1); | 343 "Event.Touch.TouchStartLatencyDuringFling", 1); |
| 344 | 344 |
| 345 touch.dispatchedDuringFling = false; | 345 touch.dispatchedDuringFling = false; |
| 346 widget()->SendInputEvent(touch); | 346 widget()->SendInputEvent(touch); |
| 347 histogram_tester().ExpectTotalCount( | 347 histogram_tester().ExpectTotalCount( |
| 348 "Event.Touch.TouchStartLatencyOutsideFling", 1); | 348 "Event.Touch.TouchStartLatencyOutsideFling", 1); |
| 349 } | 349 } |
| 350 | 350 |
| 351 } // namespace content | 351 } // namespace content |
| OLD | NEW |