OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
7 #include "content/browser/renderer_host/input/input_ack_handler.h" | 7 #include "content/browser/renderer_host/input/input_ack_handler.h" |
8 #include "content/browser/renderer_host/input/input_router_client.h" | 8 #include "content/browser/renderer_host/input/input_router_client.h" |
9 #include "content/browser/renderer_host/input/input_router_impl.h" | 9 #include "content/browser/renderer_host/input/input_router_impl.h" |
10 #include "content/common/input/web_input_event_traits.h" | 10 #include "content/common/input/web_input_event_traits.h" |
11 #include "content/common/input_messages.h" | 11 #include "content/common/input_messages.h" |
12 #include "content/common/view_messages.h" | |
13 #include "ipc/ipc_sender.h" | 12 #include "ipc/ipc_sender.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
15 #include "testing/perf/perf_test.h" | 14 #include "testing/perf/perf_test.h" |
16 #include "ui/gfx/geometry/vector2d_f.h" | 15 #include "ui/gfx/geometry/vector2d_f.h" |
17 | 16 |
18 using base::TimeDelta; | 17 using base::TimeDelta; |
19 using blink::WebGestureEvent; | 18 using blink::WebGestureEvent; |
20 using blink::WebInputEvent; | 19 using blink::WebInputEvent; |
21 using blink::WebTouchEvent; | 20 using blink::WebTouchEvent; |
22 using blink::WebTouchPoint; | 21 using blink::WebTouchPoint; |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 InputEventAckState ack_result) { | 238 InputEventAckState ack_result) { |
240 if (!WebInputEventTraits::WillReceiveAckFromRenderer(event)) | 239 if (!WebInputEventTraits::WillReceiveAckFromRenderer(event)) |
241 return; | 240 return; |
242 InputEventAck ack(event.type, ack_result); | 241 InputEventAck ack(event.type, ack_result); |
243 InputHostMsg_HandleInputEvent_ACK response(0, ack); | 242 InputHostMsg_HandleInputEvent_ACK response(0, ack); |
244 input_router_->OnMessageReceived(response); | 243 input_router_->OnMessageReceived(response); |
245 } | 244 } |
246 | 245 |
247 void OnHasTouchEventHandlers(bool has_handlers) { | 246 void OnHasTouchEventHandlers(bool has_handlers) { |
248 input_router_->OnMessageReceived( | 247 input_router_->OnMessageReceived( |
249 ViewHostMsg_HasTouchEventHandlers(0, has_handlers)); | 248 InputHostMsg_HasTouchEventHandlers(0, has_handlers)); |
250 } | 249 } |
251 | 250 |
252 size_t GetAndResetSentEventCount() { | 251 size_t GetAndResetSentEventCount() { |
253 return sender_->GetAndResetSentEventCount(); | 252 return sender_->GetAndResetSentEventCount(); |
254 } | 253 } |
255 | 254 |
256 size_t GetAndResetAckCount() { return ack_handler_->GetAndResetAckCount(); } | 255 size_t GetAndResetAckCount() { return ack_handler_->GetAndResetAckCount(); } |
257 | 256 |
258 size_t AckCount() const { return ack_handler_->ack_count(); } | 257 size_t AckCount() const { return ack_handler_->ack_count(); } |
259 | 258 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 | 377 |
379 TEST_F(InputRouterImplPerfTest, TouchSwipeToGestureScroll) { | 378 TEST_F(InputRouterImplPerfTest, TouchSwipeToGestureScroll) { |
380 SimulateTouchAndScrollEventSequence("TouchSwipeToGestureScroll ", | 379 SimulateTouchAndScrollEventSequence("TouchSwipeToGestureScroll ", |
381 kDefaultSteps, | 380 kDefaultSteps, |
382 kDefaultOrigin, | 381 kDefaultOrigin, |
383 kDefaultDistance, | 382 kDefaultDistance, |
384 kDefaultIterations); | 383 kDefaultIterations); |
385 } | 384 } |
386 | 385 |
387 } // namespace content | 386 } // namespace content |
OLD | NEW |