Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: third_party/WebKit/Source/web/tests/TouchActionTest.cpp

Issue 1888163003: Articulate the cancel behavior in the WebTouchEvent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and non-const ref passed back Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 } 322 }
323 } 323 }
324 } 324 }
325 void TouchActionTest::sendTouchEvent(WebView* webView, WebInputEvent::Type type, IntPoint clientPoint) 325 void TouchActionTest::sendTouchEvent(WebView* webView, WebInputEvent::Type type, IntPoint clientPoint)
326 { 326 {
327 ASSERT_TRUE(type == WebInputEvent::TouchStart || type == WebInputEvent::Touc hCancel); 327 ASSERT_TRUE(type == WebInputEvent::TouchStart || type == WebInputEvent::Touc hCancel);
328 328
329 WebTouchEvent webTouchEvent; 329 WebTouchEvent webTouchEvent;
330 webTouchEvent.type = type; 330 webTouchEvent.type = type;
331 if (type == WebInputEvent::TouchCancel) 331 if (type == WebInputEvent::TouchCancel)
332 webTouchEvent.cancelable = false; 332 webTouchEvent.dispatchType = WebInputEvent::EventNonBlocking;
333 webTouchEvent.touchesLength = 1; 333 webTouchEvent.touchesLength = 1;
334 webTouchEvent.touches[0].state = (type == WebInputEvent::TouchStart ? 334 webTouchEvent.touches[0].state = (type == WebInputEvent::TouchStart ?
335 WebTouchPoint::StatePressed : 335 WebTouchPoint::StatePressed :
336 WebTouchPoint::StateCancelled); 336 WebTouchPoint::StateCancelled);
337 webTouchEvent.touches[0].id = kfakeTouchId; 337 webTouchEvent.touches[0].id = kfakeTouchId;
338 webTouchEvent.touches[0].screenPosition.x = clientPoint.x(); 338 webTouchEvent.touches[0].screenPosition.x = clientPoint.x();
339 webTouchEvent.touches[0].screenPosition.y = clientPoint.y(); 339 webTouchEvent.touches[0].screenPosition.y = clientPoint.y();
340 webTouchEvent.touches[0].position.x = clientPoint.x(); 340 webTouchEvent.touches[0].position.x = clientPoint.x();
341 webTouchEvent.touches[0].position.y = clientPoint.y(); 341 webTouchEvent.touches[0].position.y = clientPoint.y();
342 webTouchEvent.touches[0].radiusX = 10; 342 webTouchEvent.touches[0].radiusX = 10;
(...skipping 24 matching lines...) Expand all
367 { 367 {
368 runShadowDOMTest("touch-action-shadow-dom.html"); 368 runShadowDOMTest("touch-action-shadow-dom.html");
369 } 369 }
370 370
371 TEST_F(TouchActionTest, Pan) 371 TEST_F(TouchActionTest, Pan)
372 { 372 {
373 runTouchActionTest("touch-action-pan.html"); 373 runTouchActionTest("touch-action-pan.html");
374 } 374 }
375 375
376 } // namespace blink 376 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698