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/common/input/input_param_traits.h" | 5 #include "content/common/input/input_param_traits.h" |
6 | 6 |
7 #include "content/common/input/input_event.h" | 7 #include "content/common/input/input_event.h" |
8 #include "content/common/input/synthetic_gesture_params.h" | 8 #include "content/common/input/synthetic_gesture_params.h" |
9 #include "content/common/input/synthetic_pinch_gesture_params.h" | 9 #include "content/common/input/synthetic_pinch_gesture_params.h" |
10 #include "content/common/input/synthetic_smooth_drag_gesture_params.h" | 10 #include "content/common/input/synthetic_smooth_drag_gesture_params.h" |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 events.push_back(new InputEvent(mouse_event, latency, false)); | 178 events.push_back(new InputEvent(mouse_event, latency, false)); |
179 | 179 |
180 blink::WebGestureEvent gesture_event; | 180 blink::WebGestureEvent gesture_event; |
181 gesture_event.type = blink::WebInputEvent::GestureScrollBegin; | 181 gesture_event.type = blink::WebInputEvent::GestureScrollBegin; |
182 gesture_event.x = -1; | 182 gesture_event.x = -1; |
183 events.push_back(new InputEvent(gesture_event, latency, false)); | 183 events.push_back(new InputEvent(gesture_event, latency, false)); |
184 | 184 |
185 blink::WebTouchEvent touch_event; | 185 blink::WebTouchEvent touch_event; |
186 touch_event.type = blink::WebInputEvent::TouchStart; | 186 touch_event.type = blink::WebInputEvent::TouchStart; |
187 touch_event.touchesLength = 1; | 187 touch_event.touchesLength = 1; |
188 touch_event.touches[0].radiusX = 1; | 188 touch_event.touches[0].width = 1; |
189 events.push_back(new InputEvent(touch_event, latency, false)); | 189 events.push_back(new InputEvent(touch_event, latency, false)); |
190 | 190 |
191 Verify(events); | 191 Verify(events); |
192 } | 192 } |
193 | 193 |
194 TEST_F(InputParamTraitsTest, InvalidSyntheticGestureParams) { | 194 TEST_F(InputParamTraitsTest, InvalidSyntheticGestureParams) { |
195 IPC::Message msg; | 195 IPC::Message msg; |
196 // Write invalid value for SyntheticGestureParams::GestureType. | 196 // Write invalid value for SyntheticGestureParams::GestureType. |
197 WriteParam(&msg, -3); | 197 WriteParam(&msg, -3); |
198 | 198 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 ASSERT_EQ(SyntheticGestureParams::TAP_GESTURE, | 243 ASSERT_EQ(SyntheticGestureParams::TAP_GESTURE, |
244 gesture_params->GetGestureType()); | 244 gesture_params->GetGestureType()); |
245 SyntheticGesturePacket packet_in; | 245 SyntheticGesturePacket packet_in; |
246 packet_in.set_gesture_params(gesture_params.Pass()); | 246 packet_in.set_gesture_params(gesture_params.Pass()); |
247 | 247 |
248 Verify(packet_in); | 248 Verify(packet_in); |
249 } | 249 } |
250 | 250 |
251 } // namespace | 251 } // namespace |
252 } // namespace content | 252 } // namespace content |
OLD | NEW |