| 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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 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 Loading... |
| 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 |
| OLD | NEW |