| 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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 EXPECT_EQ(0, client.touchActionSetCount()); | 363 EXPECT_EQ(0, client.touchActionSetCount()); |
| 364 } | 364 } |
| 365 } | 365 } |
| 366 } | 366 } |
| 367 void TouchActionTest::sendTouchEvent(WebView* webView, | 367 void TouchActionTest::sendTouchEvent(WebView* webView, |
| 368 WebInputEvent::Type type, | 368 WebInputEvent::Type type, |
| 369 IntPoint clientPoint) { | 369 IntPoint clientPoint) { |
| 370 ASSERT_TRUE(type == WebInputEvent::TouchStart || | 370 ASSERT_TRUE(type == WebInputEvent::TouchStart || |
| 371 type == WebInputEvent::TouchCancel); | 371 type == WebInputEvent::TouchCancel); |
| 372 | 372 |
| 373 WebTouchEvent webTouchEvent; | 373 WebTouchEvent webTouchEvent(type, WebInputEvent::NoModifiers, |
| 374 webTouchEvent.type = type; | 374 WebInputEvent::TimeStampForTesting); |
| 375 if (type == WebInputEvent::TouchCancel) | 375 if (type == WebInputEvent::TouchCancel) |
| 376 webTouchEvent.dispatchType = WebInputEvent::EventNonBlocking; | 376 webTouchEvent.dispatchType = WebInputEvent::EventNonBlocking; |
| 377 webTouchEvent.touchesLength = 1; | 377 webTouchEvent.touchesLength = 1; |
| 378 webTouchEvent.touches[0].state = | 378 webTouchEvent.touches[0].state = |
| 379 (type == WebInputEvent::TouchStart ? WebTouchPoint::StatePressed | 379 (type == WebInputEvent::TouchStart ? WebTouchPoint::StatePressed |
| 380 : WebTouchPoint::StateCancelled); | 380 : WebTouchPoint::StateCancelled); |
| 381 webTouchEvent.touches[0].id = kfakeTouchId; | 381 webTouchEvent.touches[0].id = kfakeTouchId; |
| 382 webTouchEvent.touches[0].screenPosition.x = clientPoint.x(); | 382 webTouchEvent.touches[0].screenPosition.x = clientPoint.x(); |
| 383 webTouchEvent.touches[0].screenPosition.y = clientPoint.y(); | 383 webTouchEvent.touches[0].screenPosition.y = clientPoint.y(); |
| 384 webTouchEvent.touches[0].position.x = clientPoint.x(); | 384 webTouchEvent.touches[0].position.x = clientPoint.x(); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 406 | 406 |
| 407 TEST_F(TouchActionTest, ShadowDOM) { | 407 TEST_F(TouchActionTest, ShadowDOM) { |
| 408 runShadowDOMTest("touch-action-shadow-dom.html"); | 408 runShadowDOMTest("touch-action-shadow-dom.html"); |
| 409 } | 409 } |
| 410 | 410 |
| 411 TEST_F(TouchActionTest, Pan) { | 411 TEST_F(TouchActionTest, Pan) { |
| 412 runTouchActionTest("touch-action-pan.html"); | 412 runTouchActionTest("touch-action-pan.html"); |
| 413 } | 413 } |
| 414 | 414 |
| 415 } // namespace blink | 415 } // namespace blink |
| OLD | NEW |