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

Side by Side Diff: content/browser/renderer_host/input/input_router_impl_perftest.cc

Issue 1218663006: Use new WebTouchPoint field names. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 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"
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 typedef std::vector<WebTouchEvent> Touches; 136 typedef std::vector<WebTouchEvent> Touches;
137 Touches BuildTouchSequence(size_t steps, 137 Touches BuildTouchSequence(size_t steps,
138 const gfx::Vector2dF& origin, 138 const gfx::Vector2dF& origin,
139 const gfx::Vector2dF& distance) { 139 const gfx::Vector2dF& distance) {
140 Touches touches; 140 Touches touches;
141 const gfx::Vector2dF delta = ScaleVector2d(distance, 1.f / steps); 141 const gfx::Vector2dF delta = ScaleVector2d(distance, 1.f / steps);
142 142
143 WebTouchEvent touch; 143 WebTouchEvent touch;
144 touch.touchesLength = 1; 144 touch.touchesLength = 1;
145 touch.type = WebInputEvent::TouchStart; 145 touch.type = WebInputEvent::TouchStart;
146 touch.touches[0].id = 0; 146 touch.touches[0].pointerId = 0;
147 touch.touches[0].state = WebTouchPoint::StatePressed; 147 touch.touches[0].state = WebTouchPoint::StatePressed;
148 touch.touches[0].position.x = origin.x(); 148 touch.touches[0].position.x = origin.x();
149 touch.touches[0].position.y = origin.y(); 149 touch.touches[0].position.y = origin.y();
150 touch.touches[0].screenPosition.x = origin.x(); 150 touch.touches[0].screenPosition.x = origin.x();
151 touch.touches[0].screenPosition.y = origin.y(); 151 touch.touches[0].screenPosition.y = origin.y();
152 touches.push_back(touch); 152 touches.push_back(touch);
153 153
154 touch.type = WebInputEvent::TouchMove; 154 touch.type = WebInputEvent::TouchMove;
155 touch.touches[0].state = WebTouchPoint::StateMoved; 155 touch.touches[0].state = WebTouchPoint::StateMoved;
156 for (size_t i = 0; i < steps; ++i) { 156 for (size_t i = 0; i < steps; ++i) {
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 374
375 TEST_F(InputRouterImplPerfTest, TouchSwipeToGestureScroll) { 375 TEST_F(InputRouterImplPerfTest, TouchSwipeToGestureScroll) {
376 SimulateTouchAndScrollEventSequence("TouchSwipeToGestureScroll ", 376 SimulateTouchAndScrollEventSequence("TouchSwipeToGestureScroll ",
377 kDefaultSteps, 377 kDefaultSteps,
378 kDefaultOrigin, 378 kDefaultOrigin,
379 kDefaultDistance, 379 kDefaultDistance,
380 kDefaultIterations); 380 kDefaultIterations);
381 } 381 }
382 382
383 } // namespace content 383 } // namespace content
OLDNEW
« no previous file with comments | « components/test_runner/event_sender.cc ('k') | content/browser/renderer_host/input/motion_event_web.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698