| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 EXPECT_EQ(0, client.touchActionSetCount()); | 287 EXPECT_EQ(0, client.touchActionSetCount()); |
| 288 } | 288 } |
| 289 } | 289 } |
| 290 } | 290 } |
| 291 void TouchActionTest::sendTouchEvent(WebView* webView, WebInputEvent::Type type,
WebCore::IntPoint clientPoint) | 291 void TouchActionTest::sendTouchEvent(WebView* webView, WebInputEvent::Type type,
WebCore::IntPoint clientPoint) |
| 292 { | 292 { |
| 293 ASSERT_TRUE(type == WebInputEvent::TouchStart || type == WebInputEvent::Touc
hCancel); | 293 ASSERT_TRUE(type == WebInputEvent::TouchStart || type == WebInputEvent::Touc
hCancel); |
| 294 | 294 |
| 295 WebTouchEvent webTouchEvent; | 295 WebTouchEvent webTouchEvent; |
| 296 webTouchEvent.type = type; | 296 webTouchEvent.type = type; |
| 297 if (type == WebInputEvent::TouchCancel) |
| 298 webTouchEvent.cancelable = false; |
| 297 webTouchEvent.touchesLength = 1; | 299 webTouchEvent.touchesLength = 1; |
| 298 webTouchEvent.touches[0].state = (type == WebInputEvent::TouchStart ? | 300 webTouchEvent.touches[0].state = (type == WebInputEvent::TouchStart ? |
| 299 WebTouchPoint::StatePressed : | 301 WebTouchPoint::StatePressed : |
| 300 WebTouchPoint::StateCancelled); | 302 WebTouchPoint::StateCancelled); |
| 301 webTouchEvent.touches[0].id = kfakeTouchId; | 303 webTouchEvent.touches[0].id = kfakeTouchId; |
| 302 webTouchEvent.touches[0].screenPosition.x = clientPoint.x(); | 304 webTouchEvent.touches[0].screenPosition.x = clientPoint.x(); |
| 303 webTouchEvent.touches[0].screenPosition.y = clientPoint.y(); | 305 webTouchEvent.touches[0].screenPosition.y = clientPoint.y(); |
| 304 webTouchEvent.touches[0].position.x = clientPoint.x(); | 306 webTouchEvent.touches[0].position.x = clientPoint.x(); |
| 305 webTouchEvent.touches[0].position.y = clientPoint.y(); | 307 webTouchEvent.touches[0].position.y = clientPoint.y(); |
| 306 webTouchEvent.touches[0].radiusX = 10; | 308 webTouchEvent.touches[0].radiusX = 10; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 324 { | 326 { |
| 325 runShadowDOMTest("touch-action-shadow-dom.html"); | 327 runShadowDOMTest("touch-action-shadow-dom.html"); |
| 326 } | 328 } |
| 327 | 329 |
| 328 TEST_F(TouchActionTest, Pan) | 330 TEST_F(TouchActionTest, Pan) |
| 329 { | 331 { |
| 330 runTouchActionTest("touch-action-pan.html"); | 332 runTouchActionTest("touch-action-pan.html"); |
| 331 } | 333 } |
| 332 | 334 |
| 333 } | 335 } |
| OLD | NEW |