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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
7 #include "base/time/time.h" | 7 #include "base/time/time.h" |
8 #include "content/browser/renderer_host/input/synthetic_gesture.h" | 8 #include "content/browser/renderer_host/input/synthetic_gesture.h" |
9 #include "content/browser/renderer_host/input/synthetic_gesture_controller.h" | 9 #include "content/browser/renderer_host/input/synthetic_gesture_controller.h" |
10 #include "content/browser/renderer_host/input/synthetic_gesture_target.h" | 10 #include "content/browser/renderer_host/input/synthetic_gesture_target.h" |
11 #include "content/browser/renderer_host/input/synthetic_pinch_gesture.h" | |
12 #include "content/browser/renderer_host/input/synthetic_smooth_drag_gesture.h" | 11 #include "content/browser/renderer_host/input/synthetic_smooth_drag_gesture.h" |
13 #include "content/browser/renderer_host/input/synthetic_smooth_move_gesture.h" | 12 #include "content/browser/renderer_host/input/synthetic_smooth_move_gesture.h" |
14 #include "content/browser/renderer_host/input/synthetic_smooth_scroll_gesture.h" | 13 #include "content/browser/renderer_host/input/synthetic_smooth_scroll_gesture.h" |
15 #include "content/browser/renderer_host/input/synthetic_tap_gesture.h" | 14 #include "content/browser/renderer_host/input/synthetic_tap_gesture.h" |
| 15 #include "content/browser/renderer_host/input/synthetic_touchpad_pinch_gesture.h
" |
| 16 #include "content/browser/renderer_host/input/synthetic_touchscreen_pinch_gestur
e.h" |
16 #include "content/browser/renderer_host/render_widget_host_delegate.h" | 17 #include "content/browser/renderer_host/render_widget_host_delegate.h" |
17 #include "content/common/input/synthetic_pinch_gesture_params.h" | 18 #include "content/common/input/synthetic_pinch_gesture_params.h" |
18 #include "content/common/input/synthetic_smooth_drag_gesture_params.h" | 19 #include "content/common/input/synthetic_smooth_drag_gesture_params.h" |
19 #include "content/common/input/synthetic_smooth_scroll_gesture_params.h" | 20 #include "content/common/input/synthetic_smooth_scroll_gesture_params.h" |
20 #include "content/common/input/synthetic_tap_gesture_params.h" | 21 #include "content/common/input/synthetic_tap_gesture_params.h" |
21 #include "content/public/test/mock_render_process_host.h" | 22 #include "content/public/test/mock_render_process_host.h" |
22 #include "content/public/test/test_browser_context.h" | 23 #include "content/public/test/test_browser_context.h" |
23 #include "content/test/test_render_view_host.h" | 24 #include "content/test/test_render_view_host.h" |
24 #include "testing/gtest/include/gtest/gtest.h" | 25 #include "testing/gtest/include/gtest/gtest.h" |
25 #include "third_party/WebKit/public/web/WebInputEvent.h" | 26 #include "third_party/WebKit/public/web/WebInputEvent.h" |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 start_to_end_distance_ = mouse_point - start_; | 212 start_to_end_distance_ = mouse_point - start_; |
212 last_mouse_point_ = mouse_point; | 213 last_mouse_point_ = mouse_point; |
213 } | 214 } |
214 } | 215 } |
215 | 216 |
216 private: | 217 private: |
217 bool started_; | 218 bool started_; |
218 gfx::PointF start_, last_mouse_point_; | 219 gfx::PointF start_, last_mouse_point_; |
219 }; | 220 }; |
220 | 221 |
221 class MockSyntheticPinchTouchTarget : public MockSyntheticGestureTarget { | 222 class MockSyntheticTouchscreenPinchTouchTarget |
| 223 : public MockSyntheticGestureTarget { |
222 public: | 224 public: |
223 enum ZoomDirection { | 225 enum ZoomDirection { |
224 ZOOM_DIRECTION_UNKNOWN, | 226 ZOOM_DIRECTION_UNKNOWN, |
225 ZOOM_IN, | 227 ZOOM_IN, |
226 ZOOM_OUT | 228 ZOOM_OUT |
227 }; | 229 }; |
228 | 230 |
229 MockSyntheticPinchTouchTarget() | 231 MockSyntheticTouchscreenPinchTouchTarget() |
230 : initial_pointer_distance_(0), | 232 : initial_pointer_distance_(0), |
231 last_pointer_distance_(0), | 233 last_pointer_distance_(0), |
232 zoom_direction_(ZOOM_DIRECTION_UNKNOWN), | 234 zoom_direction_(ZOOM_DIRECTION_UNKNOWN), |
233 started_(false) {} | 235 started_(false) {} |
234 ~MockSyntheticPinchTouchTarget() override {} | 236 ~MockSyntheticTouchscreenPinchTouchTarget() override {} |
235 | 237 |
236 void DispatchInputEventToPlatform(const WebInputEvent& event) override { | 238 void DispatchInputEventToPlatform(const WebInputEvent& event) override { |
237 ASSERT_TRUE(WebInputEvent::isTouchEventType(event.type)); | 239 ASSERT_TRUE(WebInputEvent::isTouchEventType(event.type)); |
238 const WebTouchEvent& touch_event = static_cast<const WebTouchEvent&>(event); | 240 const WebTouchEvent& touch_event = static_cast<const WebTouchEvent&>(event); |
239 ASSERT_EQ(touch_event.touchesLength, 2U); | 241 ASSERT_EQ(touch_event.touchesLength, 2U); |
240 | 242 |
241 if (!started_) { | 243 if (!started_) { |
242 ASSERT_EQ(touch_event.type, WebInputEvent::TouchStart); | 244 ASSERT_EQ(touch_event.type, WebInputEvent::TouchStart); |
243 | 245 |
244 start_0_ = gfx::PointF(touch_event.touches[0].position); | 246 start_0_ = gfx::PointF(touch_event.touches[0].position); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 } | 300 } |
299 | 301 |
300 float initial_pointer_distance_; | 302 float initial_pointer_distance_; |
301 float last_pointer_distance_; | 303 float last_pointer_distance_; |
302 ZoomDirection zoom_direction_; | 304 ZoomDirection zoom_direction_; |
303 gfx::PointF start_0_; | 305 gfx::PointF start_0_; |
304 gfx::PointF start_1_; | 306 gfx::PointF start_1_; |
305 bool started_; | 307 bool started_; |
306 }; | 308 }; |
307 | 309 |
| 310 class MockSyntheticTouchpadPinchTouchTarget |
| 311 : public MockSyntheticGestureTarget { |
| 312 public: |
| 313 enum ZoomDirection { ZOOM_DIRECTION_UNKNOWN, ZOOM_IN, ZOOM_OUT }; |
| 314 |
| 315 MockSyntheticTouchpadPinchTouchTarget() |
| 316 : zoom_direction_(ZOOM_DIRECTION_UNKNOWN), |
| 317 started_(false), |
| 318 ended_(false), |
| 319 scale_factor_(1.0f) {} |
| 320 ~MockSyntheticTouchpadPinchTouchTarget() override {} |
| 321 |
| 322 void DispatchInputEventToPlatform(const WebInputEvent& event) override { |
| 323 EXPECT_TRUE(WebInputEvent::isGestureEventType(event.type)); |
| 324 const blink::WebGestureEvent& gesture_event = |
| 325 static_cast<const blink::WebGestureEvent&>(event); |
| 326 |
| 327 if (gesture_event.type == WebInputEvent::GesturePinchBegin) { |
| 328 EXPECT_FALSE(started_); |
| 329 EXPECT_FALSE(ended_); |
| 330 started_ = true; |
| 331 } else if (gesture_event.type == WebInputEvent::GesturePinchEnd) { |
| 332 EXPECT_TRUE(started_); |
| 333 EXPECT_FALSE(ended_); |
| 334 ended_ = true; |
| 335 } else { |
| 336 EXPECT_EQ(WebInputEvent::GesturePinchUpdate, gesture_event.type); |
| 337 EXPECT_TRUE(started_); |
| 338 EXPECT_FALSE(ended_); |
| 339 const float scale = gesture_event.data.pinchUpdate.scale; |
| 340 if (scale != 1.0f) { |
| 341 if (zoom_direction_ == ZOOM_DIRECTION_UNKNOWN) { |
| 342 zoom_direction_ = scale > 1.0f ? ZOOM_IN : ZOOM_OUT; |
| 343 } else if (zoom_direction_ == ZOOM_IN) { |
| 344 EXPECT_GT(scale, 1.0f); |
| 345 } else { |
| 346 EXPECT_EQ(ZOOM_OUT, zoom_direction_); |
| 347 EXPECT_LT(scale, 1.0f); |
| 348 } |
| 349 |
| 350 scale_factor_ *= scale; |
| 351 } |
| 352 } |
| 353 } |
| 354 |
| 355 ZoomDirection zoom_direction() const { return zoom_direction_; } |
| 356 |
| 357 float scale_factor() const { return scale_factor_; } |
| 358 |
| 359 private: |
| 360 ZoomDirection zoom_direction_; |
| 361 bool started_; |
| 362 bool ended_; |
| 363 float scale_factor_; |
| 364 }; |
| 365 |
308 class MockSyntheticTapGestureTarget : public MockSyntheticGestureTarget { | 366 class MockSyntheticTapGestureTarget : public MockSyntheticGestureTarget { |
309 public: | 367 public: |
310 MockSyntheticTapGestureTarget() : state_(NOT_STARTED) {} | 368 MockSyntheticTapGestureTarget() : state_(NOT_STARTED) {} |
311 ~MockSyntheticTapGestureTarget() override {} | 369 ~MockSyntheticTapGestureTarget() override {} |
312 | 370 |
313 bool GestureFinished() const { return state_ == FINISHED; } | 371 bool GestureFinished() const { return state_ == FINISHED; } |
314 gfx::PointF position() const { return position_; } | 372 gfx::PointF position() const { return position_; } |
315 base::TimeDelta GetDuration() const { return stop_time_ - start_time_; } | 373 base::TimeDelta GetDuration() const { return stop_time_ - start_time_; } |
316 | 374 |
317 protected: | 375 protected: |
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1093 params.anchor.SetPoint(432, 89); | 1151 params.anchor.SetPoint(432, 89); |
1094 params.distances.push_back(gfx::Vector2d(0, -234)); | 1152 params.distances.push_back(gfx::Vector2d(0, -234)); |
1095 params.speed_in_pixels_s = 800; | 1153 params.speed_in_pixels_s = 800; |
1096 | 1154 |
1097 scoped_ptr<SyntheticSmoothScrollGesture> gesture( | 1155 scoped_ptr<SyntheticSmoothScrollGesture> gesture( |
1098 new SyntheticSmoothScrollGesture(params)); | 1156 new SyntheticSmoothScrollGesture(params)); |
1099 const base::TimeTicks timestamp; | 1157 const base::TimeTicks timestamp; |
1100 gesture->ForwardInputEvents(timestamp, target_); | 1158 gesture->ForwardInputEvents(timestamp, target_); |
1101 } | 1159 } |
1102 | 1160 |
1103 TEST_F(SyntheticGestureControllerTest, PinchGestureTouchZoomIn) { | 1161 TEST_F(SyntheticGestureControllerTest, |
1104 CreateControllerAndTarget<MockSyntheticPinchTouchTarget>(); | 1162 TouchscreenTouchpadPinchGestureTouchZoomIn) { |
| 1163 CreateControllerAndTarget<MockSyntheticTouchscreenPinchTouchTarget>(); |
1105 | 1164 |
1106 SyntheticPinchGestureParams params; | 1165 SyntheticPinchGestureParams params; |
1107 params.gesture_source_type = SyntheticGestureParams::TOUCH_INPUT; | 1166 params.gesture_source_type = SyntheticGestureParams::TOUCH_INPUT; |
1108 params.scale_factor = 2.3f; | 1167 params.scale_factor = 2.3f; |
1109 params.anchor.SetPoint(54, 89); | 1168 params.anchor.SetPoint(54, 89); |
1110 | 1169 |
1111 scoped_ptr<SyntheticPinchGesture> gesture(new SyntheticPinchGesture(params)); | 1170 scoped_ptr<SyntheticTouchscreenPinchGesture> gesture( |
| 1171 new SyntheticTouchscreenPinchGesture(params)); |
1112 QueueSyntheticGesture(gesture.Pass()); | 1172 QueueSyntheticGesture(gesture.Pass()); |
1113 FlushInputUntilComplete(); | 1173 FlushInputUntilComplete(); |
1114 | 1174 |
1115 MockSyntheticPinchTouchTarget* pinch_target = | 1175 MockSyntheticTouchscreenPinchTouchTarget* pinch_target = |
1116 static_cast<MockSyntheticPinchTouchTarget*>(target_); | 1176 static_cast<MockSyntheticTouchscreenPinchTouchTarget*>(target_); |
1117 EXPECT_EQ(1, num_success_); | 1177 EXPECT_EQ(1, num_success_); |
1118 EXPECT_EQ(0, num_failure_); | 1178 EXPECT_EQ(0, num_failure_); |
1119 EXPECT_EQ(pinch_target->zoom_direction(), | 1179 EXPECT_EQ(pinch_target->zoom_direction(), |
1120 MockSyntheticPinchTouchTarget::ZOOM_IN); | 1180 MockSyntheticTouchscreenPinchTouchTarget::ZOOM_IN); |
1121 EXPECT_FLOAT_EQ(params.scale_factor, pinch_target->ComputeScaleFactor()); | 1181 EXPECT_FLOAT_EQ(params.scale_factor, pinch_target->ComputeScaleFactor()); |
1122 } | 1182 } |
1123 | 1183 |
1124 TEST_F(SyntheticGestureControllerTest, PinchGestureTouchZoomOut) { | 1184 TEST_F(SyntheticGestureControllerTest, |
1125 CreateControllerAndTarget<MockSyntheticPinchTouchTarget>(); | 1185 TouchscreenTouchpadPinchGestureTouchZoomOut) { |
| 1186 CreateControllerAndTarget<MockSyntheticTouchscreenPinchTouchTarget>(); |
1126 | 1187 |
1127 SyntheticPinchGestureParams params; | 1188 SyntheticPinchGestureParams params; |
1128 params.gesture_source_type = SyntheticGestureParams::TOUCH_INPUT; | 1189 params.gesture_source_type = SyntheticGestureParams::TOUCH_INPUT; |
1129 params.scale_factor = 0.4f; | 1190 params.scale_factor = 0.4f; |
1130 params.anchor.SetPoint(-12, 93); | 1191 params.anchor.SetPoint(-12, 93); |
1131 | 1192 |
1132 scoped_ptr<SyntheticPinchGesture> gesture(new SyntheticPinchGesture(params)); | 1193 scoped_ptr<SyntheticTouchscreenPinchGesture> gesture( |
| 1194 new SyntheticTouchscreenPinchGesture(params)); |
1133 QueueSyntheticGesture(gesture.Pass()); | 1195 QueueSyntheticGesture(gesture.Pass()); |
1134 FlushInputUntilComplete(); | 1196 FlushInputUntilComplete(); |
1135 | 1197 |
1136 MockSyntheticPinchTouchTarget* pinch_target = | 1198 MockSyntheticTouchscreenPinchTouchTarget* pinch_target = |
1137 static_cast<MockSyntheticPinchTouchTarget*>(target_); | 1199 static_cast<MockSyntheticTouchscreenPinchTouchTarget*>(target_); |
1138 EXPECT_EQ(1, num_success_); | 1200 EXPECT_EQ(1, num_success_); |
1139 EXPECT_EQ(0, num_failure_); | 1201 EXPECT_EQ(0, num_failure_); |
1140 EXPECT_EQ(pinch_target->zoom_direction(), | 1202 EXPECT_EQ(pinch_target->zoom_direction(), |
1141 MockSyntheticPinchTouchTarget::ZOOM_OUT); | 1203 MockSyntheticTouchscreenPinchTouchTarget::ZOOM_OUT); |
1142 EXPECT_FLOAT_EQ(params.scale_factor, pinch_target->ComputeScaleFactor()); | 1204 EXPECT_FLOAT_EQ(params.scale_factor, pinch_target->ComputeScaleFactor()); |
1143 } | 1205 } |
1144 | 1206 |
1145 TEST_F(SyntheticGestureControllerTest, PinchGestureTouchNoScaling) { | 1207 TEST_F(SyntheticGestureControllerTest, |
1146 CreateControllerAndTarget<MockSyntheticPinchTouchTarget>(); | 1208 TouchscreenTouchpadPinchGestureTouchNoScaling) { |
| 1209 CreateControllerAndTarget<MockSyntheticTouchscreenPinchTouchTarget>(); |
1147 | 1210 |
1148 SyntheticPinchGestureParams params; | 1211 SyntheticPinchGestureParams params; |
1149 params.gesture_source_type = SyntheticGestureParams::TOUCH_INPUT; | 1212 params.gesture_source_type = SyntheticGestureParams::TOUCH_INPUT; |
1150 params.scale_factor = 1.0f; | 1213 params.scale_factor = 1.0f; |
1151 | 1214 |
1152 scoped_ptr<SyntheticPinchGesture> gesture(new SyntheticPinchGesture(params)); | 1215 scoped_ptr<SyntheticTouchscreenPinchGesture> gesture( |
| 1216 new SyntheticTouchscreenPinchGesture(params)); |
1153 QueueSyntheticGesture(gesture.Pass()); | 1217 QueueSyntheticGesture(gesture.Pass()); |
1154 FlushInputUntilComplete(); | 1218 FlushInputUntilComplete(); |
1155 | 1219 |
1156 MockSyntheticPinchTouchTarget* pinch_target = | 1220 MockSyntheticTouchscreenPinchTouchTarget* pinch_target = |
1157 static_cast<MockSyntheticPinchTouchTarget*>(target_); | 1221 static_cast<MockSyntheticTouchscreenPinchTouchTarget*>(target_); |
1158 EXPECT_EQ(1, num_success_); | 1222 EXPECT_EQ(1, num_success_); |
1159 EXPECT_EQ(0, num_failure_); | 1223 EXPECT_EQ(0, num_failure_); |
1160 EXPECT_EQ(pinch_target->zoom_direction(), | 1224 EXPECT_EQ(pinch_target->zoom_direction(), |
1161 MockSyntheticPinchTouchTarget::ZOOM_DIRECTION_UNKNOWN); | 1225 MockSyntheticTouchscreenPinchTouchTarget::ZOOM_DIRECTION_UNKNOWN); |
1162 EXPECT_EQ(params.scale_factor, pinch_target->ComputeScaleFactor()); | 1226 EXPECT_EQ(params.scale_factor, pinch_target->ComputeScaleFactor()); |
1163 } | 1227 } |
1164 | 1228 |
| 1229 TEST_F(SyntheticGestureControllerTest, TouchpadPinchGestureTouchZoomIn) { |
| 1230 CreateControllerAndTarget<MockSyntheticTouchpadPinchTouchTarget>(); |
| 1231 |
| 1232 SyntheticPinchGestureParams params; |
| 1233 params.gesture_source_type = SyntheticGestureParams::MOUSE_INPUT; |
| 1234 params.scale_factor = 2.3f; |
| 1235 params.anchor.SetPoint(54, 89); |
| 1236 |
| 1237 scoped_ptr<SyntheticTouchpadPinchGesture> gesture( |
| 1238 new SyntheticTouchpadPinchGesture(params)); |
| 1239 QueueSyntheticGesture(gesture.Pass()); |
| 1240 FlushInputUntilComplete(); |
| 1241 |
| 1242 MockSyntheticTouchpadPinchTouchTarget* pinch_target = |
| 1243 static_cast<MockSyntheticTouchpadPinchTouchTarget*>(target_); |
| 1244 EXPECT_EQ(1, num_success_); |
| 1245 EXPECT_EQ(0, num_failure_); |
| 1246 EXPECT_EQ(pinch_target->zoom_direction(), |
| 1247 MockSyntheticTouchpadPinchTouchTarget::ZOOM_IN); |
| 1248 EXPECT_FLOAT_EQ(params.scale_factor, pinch_target->scale_factor()); |
| 1249 } |
| 1250 |
| 1251 TEST_F(SyntheticGestureControllerTest, TouchpadPinchGestureTouchZoomOut) { |
| 1252 CreateControllerAndTarget<MockSyntheticTouchpadPinchTouchTarget>(); |
| 1253 |
| 1254 SyntheticPinchGestureParams params; |
| 1255 params.gesture_source_type = SyntheticGestureParams::MOUSE_INPUT; |
| 1256 params.scale_factor = 0.4f; |
| 1257 params.anchor.SetPoint(-12, 93); |
| 1258 |
| 1259 scoped_ptr<SyntheticTouchpadPinchGesture> gesture( |
| 1260 new SyntheticTouchpadPinchGesture(params)); |
| 1261 QueueSyntheticGesture(gesture.Pass()); |
| 1262 FlushInputUntilComplete(); |
| 1263 |
| 1264 MockSyntheticTouchpadPinchTouchTarget* pinch_target = |
| 1265 static_cast<MockSyntheticTouchpadPinchTouchTarget*>(target_); |
| 1266 EXPECT_EQ(1, num_success_); |
| 1267 EXPECT_EQ(0, num_failure_); |
| 1268 EXPECT_EQ(pinch_target->zoom_direction(), |
| 1269 MockSyntheticTouchpadPinchTouchTarget::ZOOM_OUT); |
| 1270 EXPECT_FLOAT_EQ(params.scale_factor, pinch_target->scale_factor()); |
| 1271 } |
| 1272 |
| 1273 TEST_F(SyntheticGestureControllerTest, TouchpadPinchGestureTouchNoScaling) { |
| 1274 CreateControllerAndTarget<MockSyntheticTouchpadPinchTouchTarget>(); |
| 1275 |
| 1276 SyntheticPinchGestureParams params; |
| 1277 params.gesture_source_type = SyntheticGestureParams::MOUSE_INPUT; |
| 1278 params.scale_factor = 1.0f; |
| 1279 |
| 1280 scoped_ptr<SyntheticTouchpadPinchGesture> gesture( |
| 1281 new SyntheticTouchpadPinchGesture(params)); |
| 1282 QueueSyntheticGesture(gesture.Pass()); |
| 1283 FlushInputUntilComplete(); |
| 1284 |
| 1285 MockSyntheticTouchpadPinchTouchTarget* pinch_target = |
| 1286 static_cast<MockSyntheticTouchpadPinchTouchTarget*>(target_); |
| 1287 EXPECT_EQ(1, num_success_); |
| 1288 EXPECT_EQ(0, num_failure_); |
| 1289 EXPECT_EQ(pinch_target->zoom_direction(), |
| 1290 MockSyntheticTouchpadPinchTouchTarget::ZOOM_DIRECTION_UNKNOWN); |
| 1291 EXPECT_EQ(params.scale_factor, pinch_target->scale_factor()); |
| 1292 } |
| 1293 |
1165 TEST_F(SyntheticGestureControllerTest, TapGestureTouch) { | 1294 TEST_F(SyntheticGestureControllerTest, TapGestureTouch) { |
1166 CreateControllerAndTarget<MockSyntheticTapTouchTarget>(); | 1295 CreateControllerAndTarget<MockSyntheticTapTouchTarget>(); |
1167 | 1296 |
1168 SyntheticTapGestureParams params; | 1297 SyntheticTapGestureParams params; |
1169 params.gesture_source_type = SyntheticGestureParams::TOUCH_INPUT; | 1298 params.gesture_source_type = SyntheticGestureParams::TOUCH_INPUT; |
1170 params.duration_ms = 123; | 1299 params.duration_ms = 123; |
1171 params.position.SetPoint(87, -124); | 1300 params.position.SetPoint(87, -124); |
1172 | 1301 |
1173 scoped_ptr<SyntheticTapGesture> gesture(new SyntheticTapGesture(params)); | 1302 scoped_ptr<SyntheticTapGesture> gesture(new SyntheticTapGesture(params)); |
1174 QueueSyntheticGesture(gesture.Pass()); | 1303 QueueSyntheticGesture(gesture.Pass()); |
(...skipping 29 matching lines...) Expand all Loading... |
1204 EXPECT_TRUE(tap_target->GestureFinished()); | 1333 EXPECT_TRUE(tap_target->GestureFinished()); |
1205 EXPECT_EQ(tap_target->position(), params.position); | 1334 EXPECT_EQ(tap_target->position(), params.position); |
1206 EXPECT_EQ(tap_target->GetDuration().InMilliseconds(), params.duration_ms); | 1335 EXPECT_EQ(tap_target->GetDuration().InMilliseconds(), params.duration_ms); |
1207 EXPECT_GE(GetTotalTime(), | 1336 EXPECT_GE(GetTotalTime(), |
1208 base::TimeDelta::FromMilliseconds(params.duration_ms)); | 1337 base::TimeDelta::FromMilliseconds(params.duration_ms)); |
1209 } | 1338 } |
1210 | 1339 |
1211 } // namespace | 1340 } // namespace |
1212 | 1341 |
1213 } // namespace content | 1342 } // namespace content |
OLD | NEW |