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

Side by Side Diff: content/browser/renderer_host/input/touch_emulator_unittest.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 <vector> 5 #include <vector>
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 return SendTouchEvent( 200 return SendTouchEvent(
201 WebInputEvent::TouchEnd, WebTouchPoint::StateReleased, x, y, ack); 201 WebInputEvent::TouchEnd, WebTouchPoint::StateReleased, x, y, ack);
202 } 202 }
203 203
204 WebTouchEvent MakeTouchEvent(WebInputEvent::Type type, 204 WebTouchEvent MakeTouchEvent(WebInputEvent::Type type,
205 WebTouchPoint::State state, int x, int y) { 205 WebTouchPoint::State state, int x, int y) {
206 WebTouchEvent event; 206 WebTouchEvent event;
207 event.type = type; 207 event.type = type;
208 event.timeStampSeconds = GetNextEventTimeSeconds(); 208 event.timeStampSeconds = GetNextEventTimeSeconds();
209 event.touchesLength = 1; 209 event.touchesLength = 1;
210 event.touches[0].id = 0; 210 event.touches[0].pointerId = 0;
211 event.touches[0].state = state; 211 event.touches[0].state = state;
212 event.touches[0].position.x = x; 212 event.touches[0].position.x = x;
213 event.touches[0].position.y = y; 213 event.touches[0].position.y = y;
214 event.touches[0].screenPosition.x = x; 214 event.touches[0].screenPosition.x = x;
215 event.touches[0].screenPosition.y = y; 215 event.touches[0].screenPosition.y = y;
216 return event; 216 return event;
217 } 217 }
218 218
219 bool SendTouchEvent(WebInputEvent::Type type, WebTouchPoint::State state, 219 bool SendTouchEvent(WebInputEvent::Type type, WebTouchPoint::State state,
220 int x, int y, bool ack) { 220 int x, int y, bool ack) {
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 569
570 TEST_F(TouchEmulatorTest, CancelAfterDisableDoesNotCrash) { 570 TEST_F(TouchEmulatorTest, CancelAfterDisableDoesNotCrash) {
571 DisableSynchronousTouchAck(); 571 DisableSynchronousTouchAck();
572 MouseDown(100, 200); 572 MouseDown(100, 200);
573 emulator()->Disable(); 573 emulator()->Disable();
574 EXPECT_EQ("TouchStart TouchCancel", ExpectedEvents()); 574 EXPECT_EQ("TouchStart TouchCancel", ExpectedEvents());
575 emulator()->CancelTouch(); 575 emulator()->CancelTouch();
576 } 576 }
577 577
578 } // namespace content 578 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/input/touch_emulator.cc ('k') | content/browser/renderer_host/input/touch_event_queue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698