@@ -459,7 +459,14 @@ Item {
459459 waitUntilLauncherDisappears();
460460 }
461461
462− function test_dragndrop_cancel() {
462+ function test_dragndrop_cancel_data() {
463+ return [
464+ {tag: "by mouse", mouse: true},
465+ {tag: "by touch", mouse: false}
466+ ]
467+ }
468+
469+ function test_dragndrop_cancel(data) {
463470 dragLauncherIntoView();
464471 var draggedItem = findChild(launcher, "launcherDelegate4")
465472 var item0 = findChild(launcher, "launcherDelegate0")
@@ -468,22 +475,37 @@ Item {
468475 // Doing longpress
469476 var currentMouseX = draggedItem.width / 2
470477 var currentMouseY = draggedItem.height / 2
471− mousePress(draggedItem, currentMouseX, currentMouseY)
478+
479+ if(data.mouse) {
480+ mousePress(draggedItem, currentMouseX, currentMouseY)
481+ } else {
482+ touchPress(draggedItem, currentMouseX, currentMouseY)
483+ }
484+
472485 // DraggedItem needs to hide and fakeDragItem become visible
473486 tryCompare(draggedItem, "itemOpacity", 0)
474487 tryCompare(fakeDragItem, "visible", true)
475488
476489 // Dragging
477490 currentMouseX -= units.gu(20)
478− mouseMove(draggedItem, currentMouseX, currentMouseY)
491+
492+ if(data.mouse) {
493+ mouseMove(draggedItem, currentMouseX, currentMouseY)
494+ } else {
495+ touchMove(draggedItem, currentMouseX, currentMouseY)
496+ }
479497
480498 // Make sure we're in the dragging state
481499 var dndArea = findChild(launcher, "dndArea");
482500 tryCompare(draggedItem, "dragging", true)
483501 tryCompare(dndArea, "draggedIndex", 4)
484502
485− // Tap somewhere in the middle of the screen to close/hide the launcher
486− tap(root)
503+ // Click/Tap somewhere in the middle of the screen to close/hide the launcher
504+ if(data.mouse) {
505+ mouseClick(root)
506+ } else {
507+ tap(root)
508+ }
487509
488510 // Make sure the dnd operation has been stopped
489511 tryCompare(draggedItem, "dragging", false)