@@ -520,7 +520,14 @@ Item {
520520 waitUntilLauncherDisappears();
521521 }
522522
523− function test_dragndrop_cancel() {
523+ function test_dragndrop_cancel_data() {
524+ return [
525+ {tag: "by mouse", mouse: true},
526+ {tag: "by touch", mouse: false}
527+ ]
528+ }
529+
530+ function test_dragndrop_cancel(data) {
524531 dragLauncherIntoView();
525532 var draggedItem = findChild(launcher, "launcherDelegate4")
526533 var item0 = findChild(launcher, "launcherDelegate0")
@@ -529,22 +536,37 @@ Item {
529536 // Doing longpress
530537 var currentMouseX = draggedItem.width / 2
531538 var currentMouseY = draggedItem.height / 2
532− mousePress(draggedItem, currentMouseX, currentMouseY)
539+
540+ if(data.mouse) {
541+ mousePress(draggedItem, currentMouseX, currentMouseY)
542+ } else {
543+ touchPress(draggedItem, currentMouseX, currentMouseY)
544+ }
545+
533546 // DraggedItem needs to hide and fakeDragItem become visible
534547 tryCompare(draggedItem, "itemOpacity", 0)
535548 tryCompare(fakeDragItem, "visible", true)
536549
537550 // Dragging
538551 currentMouseX -= units.gu(20)
539− mouseMove(draggedItem, currentMouseX, currentMouseY)
552+
553+ if(data.mouse) {
554+ mouseMove(draggedItem, currentMouseX, currentMouseY)
555+ } else {
556+ touchMove(draggedItem, currentMouseX, currentMouseY)
557+ }
540558
541559 // Make sure we're in the dragging state
542560 var dndArea = findChild(launcher, "dndArea");
543561 tryCompare(draggedItem, "dragging", true)
544562 tryCompare(dndArea, "draggedIndex", 4)
545563
546− // Tap somewhere in the middle of the screen to close/hide the launcher
547− tap(root)
564+ // Click/Tap somewhere in the middle of the screen to close/hide the launcher
565+ if(data.mouse) {
566+ mouseClick(root)
567+ } else {
568+ tap(root)
569+ }
548570
549571 // Make sure the dnd operation has been stopped
550572 tryCompare(draggedItem, "dragging", false)