| 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 <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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |