=== modified file 'components.api'
--- components.api	2014-03-14 16:11:00 +0000
+++ components.api	2014-04-08 16:54:23 +0000
@@ -592,6 +592,8 @@
     function findChild(obj,objectName)
     function findInvisibleChild(obj,objectName)
     function mouseMoveSlowly(item,x,y,dx,dy,steps,stepdelay)
+    function flick(item, x, y, dx, dy, pressTimeout, steps, button, modifiers, delay)
+    function mouseLongPress(item, x, y, button, modifiers, delay)
     function tryCompareFunction(func, expectedResult, timeout)
 plugins.qmltypes
     name: "InverseMouseAreaType"

=== modified file 'modules/Ubuntu/Test/UbuntuTestCase.qml'
--- modules/Ubuntu/Test/UbuntuTestCase.qml	2014-02-25 12:36:27 +0000
+++ modules/Ubuntu/Test/UbuntuTestCase.qml	2014-04-08 16:54:23 +0000
@@ -87,7 +87,75 @@
 		}
 	}
 
-	/*!
+    /*!
+      \qmlmethod UbuntuTestCase::flick(item, x, y, dx, dy, pressTimeout = -1, steps = -1, button = Qt.LeftButton, modifiers = Qt.NoModifiers, delay = -1)
+
+      The function produces a flick event when executed on Flickables. When used
+      on other components it provides the same functionality as \l mouseDrag()
+      function. The optional \a pressTimeout parameter can be used to introduce
+      a small delay between the mouse press and the first mouse move.
+
+      The default flick velocity is built up using 5 move points. This can be altered
+      by setting a positive value to \a steps parameter. The bigger the number the
+      longer the flick will be.
+
+      \note The function can be used to select a text in a TextField or TextArea by
+      specifying at least 400 millisecods to \a pressTimeout.
+      */
+    function flick(item, x, y, dx, dy, pressTimeout, steps, button, modifiers, delay) {
+        if (item === undefined || item.x === undefined || item.y === undefined)
+            return
+        if (button === undefined)
+            button = Qt.LeftButton
+        if (modifiers === undefined)
+            modifiers = Qt.NoModifier
+        var from = Qt.point(x, y);
+        var to = Qt.point(x + dx, y + dy);
+        if (steps === undefined || steps <= 0)
+            steps = 4;
+        // make sure we have at least two move steps so the flick will be sensed
+        steps += 1;
+        if (delay === undefined)
+            delay = -1;
+
+        var ddx = (to.x - from.x) / steps;
+        var ddy = (to.y - from.y) / steps;
+
+        mousePress(item, from.x, from.y, button, modifiers, delay);
+        if (pressTimeout !== undefined && pressTimeout > 0) {
+            wait(pressTimeout);
+        }
+        for (var i = 1; i <= steps; i++) {
+            // mouse moves are all processed immediately, without delay in between events
+            mouseMove(item, from.x + i * ddx, from.y + i * ddy, -1, button);
+        }
+        mouseRelease(item, to.x, to.y, button, modifiers, delay);
+        // empty event buffer
+        wait(200);
+    }
+
+    /*!
+        \qmlmethod UbuntuTestCase::mouseLongPress(item, x, y, button = Qt.LeftButton, modifiers = Qt.NoModifiers, delay = -1)
+
+        Simulates a long press on a mouse \a button with an optional \a modifier
+        on an \a item. The position is defined by \a x and \a y. If \a delay is
+        specified, the test will wait the specified amount of milliseconds before
+        the press.
+
+        The position given by \a x and \a y is transformed from the co-ordinate
+        system of \a item into window co-ordinates and then delivered.
+        If \a item is obscured by another item, or a child of \a item occupies
+        that position, then the event will be delivered to the other item instead.
+
+        \sa mouseRelease(), mouseClick(), mouseDoubleClick(), mouseMove(), mouseDrag(), mouseWheel()
+      */
+    function mouseLongPress(item, x, y, button, modifiers, delay) {
+        mousePress(item, x, y, button, modifiers, delay);
+        // the delay is taken from QQuickMouseArea
+        wait(800);
+    }
+
+    /*!
 		Keeps executing a given parameter-less function until it returns the given
 		expected result or the timemout is reached (in which case a test failure
 		is generated)

=== modified file 'modules/Ubuntu/Test/deployment.pri'
--- modules/Ubuntu/Test/deployment.pri	2014-01-17 12:30:05 +0000
+++ modules/Ubuntu/Test/deployment.pri	2014-04-08 16:54:23 +0000
@@ -7,9 +7,14 @@
 # make found deployables visible in Qt Creator
 OTHER_FILES += $$QMLDIR_FILE
 
+QML_FILES = $$system(ls *.qml)
+JS_FILES = $$system(ls *.js)
+
 # define deployment for found deployables
 qmldir_file.path = $$installPath
 qmldir_file.files = $$QMLDIR_FILE
+qml_files.path = $$installPath
+qml_files.files = $$QML_FILES
 js_files.path = $$installPath
 js_files.files = $$JS_FILES
 
@@ -20,4 +25,4 @@
 # https://bugreports.qt-project.org/browse/QTBUG-36243
 plugins_qmltypes.extra = $$[QT_INSTALL_BINS]/qmlplugindump -notrelocatable Ubuntu.Test 0.1 ../../ 2>/dev/null > $(INSTALL_ROOT)/$$installPath/plugins.qmltypes
 
-INSTALLS += qmldir_file plugins_qmltypes
+INSTALLS += qmldir_file plugins_qmltypes qml_files js_files

=== modified file 'tests/unit/runtest.sh'
--- tests/unit/runtest.sh	2014-03-31 18:26:46 +0000
+++ tests/unit/runtest.sh	2014-04-08 16:54:23 +0000
@@ -33,7 +33,7 @@
   if [ $_TARGET != $_TESTFILE ]; then
       _CMD="$_CMD -input $_TESTFILE"
   fi
-  _CMD="$_CMD -maxwarnings 4"
+  _CMD="$_CMD -maxwarnings 40"
 }
 
 function execute_test_cmd {

=== modified file 'tests/unit_x11/tst_test/tst_ubuntutestcase.qml'
--- tests/unit_x11/tst_test/tst_ubuntutestcase.qml	2014-02-13 10:27:14 +0000
+++ tests/unit_x11/tst_test/tst_ubuntutestcase.qml	2014-04-08 16:54:23 +0000
@@ -23,30 +23,57 @@
  width: 800
  height: 600
 
- MouseArea {
-    id: mouseArea
-    objectName: "myMouseArea"
- 	anchors.fill: parent
- 	hoverEnabled: true
-	property int testX : 0
-	property int testY : 0
-	property int steps : 0
+ Column {
+     anchors.fill: parent
+     MouseArea {
+        id: mouseArea
+        objectName: "myMouseArea"
+        width: parent.width
+        height: 300
+        hoverEnabled: true
+        acceptedButtons: Qt.LeftButton | Qt.MiddleButton | Qt.RightButton
+        property int testX : 0
+        property int testY : 0
+        property int steps : 0
 
- 	onPositionChanged: {
- 	   testX = mouseX;
-	   testY = mouseY;
-	   steps++;
- 	}
+        onPositionChanged: {
+           testX = mouseX;
+           testY = mouseY;
+           steps++;
+        }
+     }
+     Flickable {
+         id: flicker
+         width: parent.width
+         height: 400
+         contentWidth: rect.width
+         contentHeight: rect.height
+         clip: true
+         Rectangle {
+             id: rect
+             color: "blue"
+             width: 1000
+             height: 1000
+         }
+     }
  }
  
  UbuntuTestCase {
     name: "TestTheUbuntuTestCase"
     when: windowShown
 
+    function init() {
+        mouseArea.steps = 0;
+    }
+    function cleanup() {
+        movementSpy.clear();
+        longPressSpy.clear();
+    }
+
     function test_mouseMoveSlowly() {
-       mouseMoveSlowly(root,0,0,800,600,10,100);
+       mouseMoveSlowly(root,0,0,800,300,10,100);
        compare(mouseArea.testX,800);
-       compare(mouseArea.testY,600);
+       compare(mouseArea.testY,300);
        compare(mouseArea.steps,10);
     }
 
@@ -58,5 +85,66 @@
         child = findChild(root,"NoSuchChildHere");
         compare(child===null,true,"When there is no child, function should return null");
     }
+
+    SignalSpy {
+        id: longPressSpy
+        target: mouseArea
+        signalName: "onPressAndHold"
+    }
+
+    function test_longPress_left() {
+        longPressSpy.clear();
+        mouseLongPress(mouseArea, mouseArea.width / 2, mouseArea.height / 2);
+        longPressSpy.wait();
+        // cleanup
+        mouseRelease(mouseArea, mouseArea.width / 2, mouseArea.height / 2);
+    }
+
+    function test_longPress_right() {
+        longPressSpy.clear();
+        mouseLongPress(mouseArea, mouseArea.width / 2, mouseArea.height / 2, Qt.RightButton);
+        longPressSpy.wait();
+        // cleanup
+        mouseRelease(mouseArea, mouseArea.width / 2, mouseArea.height / 2, Qt.RightButton);
+    }
+
+    function test_longPress_middle() {
+        longPressSpy.clear();
+        mouseLongPress(mouseArea, mouseArea.width / 2, mouseArea.height / 2, Qt.MiddleButton);
+        longPressSpy.wait();
+        // cleanup
+        mouseRelease(mouseArea, mouseArea.width / 2, mouseArea.height / 2, Qt.MiddleButton);
+    }
+
+    SignalSpy {
+        id: movementSpy
+        target: flicker
+        signalName: "onMovementEnded"
+    }
+
+    function test_flick_default() {
+        flick(flicker, 0, 0, flicker.width, flicker.height);
+        movementSpy.wait();
+    }
+    function test_flick_long() {
+        flick(flicker, 0, 0, flicker.width, flicker.height, -1, 10);
+        movementSpy.wait();
+    }
+    function test_flick_short() {
+        flick(flicker, 0, 0, flicker.width, flicker.height, -1, 1);
+        movementSpy.wait();
+    }
+    function test_flick_pressTimeout() {
+        flick(flicker, 0, 0, flicker.width, flicker.height, 400);
+        movementSpy.wait();
+    }
+    function test_flick_pressTimeout_short() {
+        flick(flicker, flicker.width, flicker.height, -flicker.width, -flicker.height, 400, 1);
+        movementSpy.wait();
+    }
+    function test_flick_pressTimeout_long() {
+        flick(flicker, flicker.width, flicker.height, -flicker.width, -flicker.height, 400, 100);
+        movementSpy.wait();
+    }
  }
 }

