changeset 7080:1000cd96bf56

RT-36418: Adding unit tests for scroll gesture recognizer
author Elina Kleyman <elina.kleyman@oracle.com>
date Tue, 20 May 2014 17:50:10 +0300
parents 7a1db976a80b
children c4fedef42f45
files tests/system/src/test/java/com/sun/glass/ui/monocle/input/ScrollTest.java tests/system/src/test/java/com/sun/glass/ui/monocle/input/ScrollTestBase.java tests/system/src/test/java/com/sun/glass/ui/monocle/input/TestApplication.java tests/system/src/test/java/com/sun/glass/ui/monocle/input/devices/TestTouchDevice.java
diffstat 4 files changed, 700 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/system/src/test/java/com/sun/glass/ui/monocle/input/ScrollTest.java	Tue May 20 17:50:10 2014 +0300
@@ -0,0 +1,256 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.glass.ui.monocle.input;
+
+import com.sun.glass.ui.monocle.input.devices.TestTouchDevice;
+import org.junit.*;
+
+/**
+ * Scroll tests generated by one and more touch points.
+ *  */
+public class ScrollTest extends ScrollTestBase {
+
+    public ScrollTest(TestTouchDevice device) {
+        super(device);
+    }
+
+    private int getDelta() throws Exception {
+        int max = Math.max(getScrollThreshold(), device.getTapRadius());
+        return Math.max(max, 30) + 1;
+    }
+
+    /**
+     * Tap one finger, drag it up few times in order to scroll
+     */
+    @Test
+    public void testScrollUp() throws Exception {
+        pressFirstFinger();
+        moveOneFinger(0, -getDelta(), 3, true);
+        releaseFirstFinger();
+    }
+
+    /**
+     * Tap one finger, drag it to the right few times in order to scroll
+     */
+    @Test
+    public void testScrollRight() throws Exception {
+        pressFirstFinger();
+        moveOneFinger(getDelta(), 0, 2, true);
+        releaseFirstFinger();
+    }
+
+    /**
+     * Tap one finger, drag it down few times in order to scroll
+     */
+    @Test
+    public void testScrollDown() throws Exception {
+        pressFirstFinger();
+        moveOneFinger(0, getDelta(), 5, true);
+        releaseFirstFinger();
+    }
+
+    /**
+     * Tap one finger, drag it to the left few times in order to scroll
+     */
+    @Test
+    public void testScrollLeft() throws Exception {
+        pressFirstFinger();
+        moveOneFinger(-getDelta() * 2, 0, 4, true);
+        releaseFirstFinger();
+    }
+
+    /**
+     * Tap one finger, drag it up & right few times in order to scroll
+     */
+    @Test
+    public void testScrollUpAndRight() throws Exception {
+        pressFirstFinger();
+        moveOneFinger(getDelta(), -getDelta(), 3, true);
+        releaseFirstFinger();
+    }
+
+    /**
+     * Tap one finger, drag it down & right few times in order to scroll
+     */
+    @Test
+    public void testScrollDownAndRight() throws Exception {
+        pressFirstFinger();
+        moveOneFinger(getDelta(), getDelta(), 2, true);
+        releaseFirstFinger();
+    }
+
+    /**
+     * Tap one finger, drag it left & down few times in order to scroll
+     */
+    @Test
+    public void testScrollDownAndLeft() throws Exception {
+        pressFirstFinger();
+        moveOneFinger(-getDelta(), getDelta(), 5, true);
+        releaseFirstFinger();
+    }
+
+    /**
+     * Tap one finger, drag it left & up few times in order to scroll
+     */
+    @Test
+    public void testScrollUpAndLeft() throws Exception {
+        pressFirstFinger();
+        moveOneFinger(-getDelta(), -getDelta() * 2, 4, true);
+        releaseFirstFinger();
+    }
+
+    /**
+     * Tap two fingers, scroll up
+     */
+    @Test
+    public void testTwoFingersScrollUp() throws Exception {
+        Assume.assumeTrue(device.getPointCount() >= 2);
+        pressFirstFinger();
+        pressSecondFinger();
+        moveTwoFingers(0, -getDelta(), 3, true, false);
+        releaseAllFingers();
+    }
+
+    /**
+     * Tap two fingers, scroll up, scroll down
+     */
+    @Test
+    public void testTwoFingersScrollTwice() throws Exception {
+        Assume.assumeTrue(device.getPointCount() >= 2);
+        pressFirstFinger();
+        pressSecondFinger();
+        moveTwoFingers(0, -getDelta(), 1, true, false);
+        moveTwoFingers(0, getDelta() * 2, 1, false, false);
+        releaseAllFingers();
+    }
+
+    /**
+     * Tap one finger, scroll down, add second finger, continue scrolling down
+     */
+    @Test
+    public void testTwoFingersScroll1() throws Exception {
+        Assume.assumeTrue(device.getPointCount() >= 2);
+        pressFirstFinger();
+        moveOneFinger(0, getDelta(), 2, true);
+        pressSecondFinger();
+        moveTwoFingers(0, getDelta(), 3, false, true);
+        releaseAllFingers();
+    }
+
+
+    /**
+     * Tap two fingers, scroll down, release one finger, continue scrolling down
+     */
+    @Test
+    public void testTwoFingersScroll2()
+            throws Exception {
+        Assume.assumeTrue(device.getPointCount() >= 2);
+        pressFirstFinger();
+        pressSecondFinger();
+        moveTwoFingers(0, getDelta(), 1, true, false);
+        releaseSecondFinger();
+        moveOneFinger(0, getDelta(), 2, false);
+        releaseFirstFinger();
+    }
+
+    /**
+     * Tap one finger, scroll down,
+     * add second finger, continue scrolling down,
+     * remove second finger, continue scrolling down.
+     */
+    @Test
+    public void testTwoFingersScroll3()
+            throws Exception {
+        Assume.assumeTrue(device.getPointCount() >= 2);
+        pressFirstFinger();
+        moveOneFinger(0, getDelta(), 2, true);
+        pressSecondFinger();
+        moveTwoFingers(0, -getDelta() * 2, 2, false, true);
+        releaseSecondFinger();
+        moveOneFinger(0, getDelta(), 2, false);
+        releaseFirstFinger();
+    }
+
+    /**
+     * Tap two fingers, scroll them down asymmetrically: first finger's location
+     * changed by delta, second finger's location changed by (delta * 2)
+     */
+    @Test
+    public void testTwoFingersAsymmetricScroll() throws Exception {
+        Assume.assumeTrue(device.getPointCount() >= 2);
+        int deltaY1 = getDelta() + 1;
+        int deltaY2 = deltaY1 * 2;
+        int numOfIterations = 4;
+        Assert.assertTrue(paramsValid(0, deltaY1, numOfIterations,
+                point1X, point1Y) &&
+                paramsValid(0, deltaY2, numOfIterations,
+                        point2X, point2Y));
+        TestLog.reset();
+        p1 = device.addPoint(point1X, point1Y);
+        p2 = device.addPoint(point2X, point2Y);
+        device.sync();
+        //verify fingers pressed
+        TestLog.waitForLogContaining("TouchPoint: PRESSED %d, %d", point1X, point1Y);
+        TestLog.waitForLogContaining("TouchPoint: PRESSED %d, %d", point2X, point2Y);
+        point1Y += deltaY1;
+        point2Y += deltaY2;
+        int avgDelta = (deltaY1 + deltaY2) / 2;
+        //scroll fingers
+        TestLog.reset();
+        device.setPoint(p1, point1X, point1Y);
+        device.setPoint(p2, point2X, point2Y);
+        device.sync();
+        TestLog.waitForLogContaining("TouchPoint: MOVED %d, %d", point1X, point1Y);
+        TestLog.waitForLogContaining("TouchPoint: MOVED %d, %d", point2X, point2Y);
+        totalDeltaY = avgDelta;
+        TestLog.waitForLogContaining("Scroll started, DeltaX: " + 0
+                + ", DeltaY: " + 0
+                + ", totalDeltaX: " + 0
+                + ", totalDeltaY: " + 0);
+        TestLog.waitForLogContaining("Scroll, DeltaX: " + 0
+                + ", DeltaY: " + avgDelta
+                + ", totalDeltaX: " + 0
+                + ", totalDeltaY: " + totalDeltaY
+                + ", touch points: " + 2);
+        String expectedLog;
+        for (int i = 2; i <= numOfIterations; i++) {
+            point1Y += deltaY1;
+            point2Y += deltaY2;
+            TestLog.reset();
+            device.setPoint(p1, point1X, point1Y);
+            device.setPoint(p2, point2X, point2Y);
+            device.sync();
+            TestLog.waitForLogContaining("TouchPoint: MOVED %d, %d", point1X, point1Y);
+            TestLog.waitForLogContaining("TouchPoint: MOVED %d, %d", point2X, point2Y);
+            totalDeltaY = avgDelta * i;
+            expectedLog = "Scroll, DeltaX: " + 0 + ", DeltaY: " + avgDelta
+                    + ", totalDeltaX: " + 0
+                    + ", totalDeltaY: " + totalDeltaY;
+            TestLog.waitForLogContaining(expectedLog);
+        }
+        releaseAllFingers();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/system/src/test/java/com/sun/glass/ui/monocle/input/ScrollTestBase.java	Tue May 20 17:50:10 2014 +0300
@@ -0,0 +1,400 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.glass.ui.monocle.input;
+
+import com.sun.glass.ui.monocle.input.devices.TestTouchDevice;
+import com.sun.glass.ui.monocle.input.devices.TestTouchDevices;
+import org.junit.*;
+import org.junit.runners.Parameterized;
+import java.util.Collection;
+
+/**
+ * Base class, intended for extending and creation of different types of scroll tests
+ *  */
+public class ScrollTestBase extends ParameterizedTestBase {
+
+    protected int point1X;
+    protected int point1Y;
+    protected int point2X;
+    protected int point2Y;
+    protected int p1;
+    protected int p2;
+    protected int totalDeltaX = 0;
+    protected int totalDeltaY = 0;
+
+    public ScrollTestBase(TestTouchDevice device) {
+        super(device);
+    }
+
+    @Parameterized.Parameters
+    public static Collection<Object[]> data() {
+        return TestTouchDevices.getTouchDeviceParameters(1);
+    }
+
+    @Before
+    public void init() {
+        Assume.assumeTrue(TestApplication.isMonocle());
+        //Scroll tests should be running only on platforms that support current feature
+        Assume.assumeTrue(Boolean.getBoolean("com.sun.javafx.gestures.scroll"));
+        point1X = (int) Math.round(width * 0.5);
+        point1Y = (int) Math.round(height * 0.5);
+        point2X = point1X + 40;
+        point2Y = point1Y;
+    }
+
+    @After
+    public void releaseAll() throws Exception {
+        if (device.getPressedPoints() == 1) {
+            releaseFirstFinger();
+        } else if (device.getPressedPoints() == 2){
+            releaseAllFingers();
+        }
+    }
+
+    protected int getScrollThreshold() {
+        String s = System.getProperty("com.sun.javafx.gestures.scroll.threshold");
+        if (s != null) {
+            return Integer.valueOf(s);
+        } else {
+            return 10;
+        }
+    }
+
+    protected boolean paramsValid(int dX, int dY, int num, int x, int y) {
+        if ((0 < x + (dX * num))
+           && (x + (dX * num) < (int) Math.round(width))
+           && (0 < y + (dY * num))
+           && (y + (dY * num) < (int) Math.round(height))) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    protected void pressFirstFinger() throws Exception {
+        Assert.assertEquals(0, device.getPressedPoints());
+        TestLog.reset();
+        p1 = device.addPoint(point1X, point1Y);
+        device.sync();
+        TestLog.waitForLogContaining("TouchPoint: PRESSED %d, %d", point1X, point1Y);
+    }
+
+    protected void pressSecondFinger() throws Exception {
+        Assert.assertEquals(1, device.getPressedPoints());
+        TestLog.reset();
+        point2X = point1X + 40;
+        point2Y = point1Y;
+        p2 = device.addPoint(point2X, point2Y);
+        device.sync();
+        //verify fingers pressed
+        TestLog.waitForLogContaining("TouchPoint: STATIONARY %d, %d",
+                point1X, point1Y);
+        TestLog.waitForLogContaining("TouchPoint: PRESSED %d, %d",
+                point2X, point2Y);
+    }
+
+    /**
+     * The method drags one finger
+     * @param firstMove - reflects if it's the first action in the drag sequence.
+     */
+    protected void moveOneFinger(int deltaX, int deltaY, int numOfIterations,
+                               boolean firstMove) throws Exception {
+        TestLog.reset();
+        Assert.assertEquals(1, device.getPressedPoints());
+        Assert.assertTrue(paramsValid(deltaX, deltaY, numOfIterations,
+                point1X, point1Y));
+        point1X += deltaX;
+        point1Y += deltaY;
+        device.setPoint(p1, point1X, point1Y);
+        device.sync();
+        TestLog.waitForLogContaining("TouchPoint: MOVED %d, %d", point1X, 
+                point1Y);
+        if (firstMove) {
+            totalDeltaX = deltaX;
+            totalDeltaY = deltaY;
+            if (Math.abs(deltaX) > getScrollThreshold()
+                    || Math.abs(deltaY) > getScrollThreshold()) {
+                TestLog.waitForLogContaining("Scroll started, DeltaX: " + 0
+                        + ", DeltaY: " + 0
+                        + ", totalDeltaX: " + 0
+                        + ", totalDeltaY: " + 0
+                        + ", touch points: " + 1
+                        + ", inertia value: false");
+                TestLog.waitForLogContaining("Scroll, DeltaX: " + deltaX
+                        + ", DeltaY: " + deltaY
+                        + ", totalDeltaX: " + totalDeltaX
+                        + ", totalDeltaY: " + totalDeltaY
+                        + ", touch points: " + 1
+                        + ", inertia value: false");
+            } else {
+                Assert.assertEquals(0, TestLog.countLogContaining("Scroll started"));
+                Assert.assertEquals(0, TestLog.countLogContaining("Scroll, DeltaX:"));
+            }
+        } else {
+            totalDeltaX += deltaX;
+            totalDeltaY += deltaY;
+            TestLog.waitForLogContaining("Scroll, DeltaX: " + deltaX
+                    + ", DeltaY: " + deltaY
+                    + ", totalDeltaX: " + totalDeltaX
+                    + ", totalDeltaY: " + totalDeltaY
+                    + ", touch points: " + 1
+                    + ", inertia value: false");
+        }
+        String expectedLog;
+        boolean passedTheThreshold =false;
+        if (numOfIterations >= 2) {
+            for (int i = 2; i <= numOfIterations; i++) {
+                point1X += deltaX;
+                point1Y += deltaY;
+                TestLog.reset();
+                device.setPoint(p1, point1X, point1Y);
+                device.sync();
+                TestLog.waitForLogContaining("TouchPoint: MOVED %d, %d",
+                        point1X, point1Y);
+                totalDeltaX += deltaX;
+                totalDeltaY += deltaY;
+                expectedLog = "Scroll, DeltaX: " + deltaX + ", DeltaY: " + deltaY
+                        + ", totalDeltaX: " + totalDeltaX
+                        + ", totalDeltaY: " + totalDeltaY
+                        + ", touch points: " + 1
+                        + ", inertia value: false";
+                if (Math.abs(deltaX) < getScrollThreshold()
+                        && Math.abs(deltaY) < getScrollThreshold()) {
+                    if(Math.abs(totalDeltaX) > getScrollThreshold()
+                            || Math.abs(totalDeltaY) > getScrollThreshold()) {
+                        if (!passedTheThreshold) {
+                            expectedLog = "Scroll, DeltaX: " + totalDeltaX
+                                    + ", DeltaY: " + totalDeltaY
+                                    + ", totalDeltaX: " + totalDeltaX
+                                    + ", totalDeltaY: " + totalDeltaY
+                                    + ", touch points: " + 1
+                                    + ", inertia value: false";
+                            passedTheThreshold = true;
+                        }
+                    } else {
+                        expectedLog = "sync";
+                    }
+                }
+                TestLog.waitForLogContaining(expectedLog);
+            }
+        }
+    }
+
+    /**
+     * The method drags two-fingers
+     * @param firstMove - reflects if it's the first action in the drag sequence.
+     * @param fingersChanged - reflects if previous move/drag action used
+     *                       different number of touch-points
+     */
+    protected void moveTwoFingers(int deltaX, int deltaY, int numOfIterations,
+                                boolean firstMove, boolean fingersChanged)
+                                throws Exception {
+        TestLog.reset();
+        Assert.assertEquals(2, device.getPressedPoints());
+        Assert.assertTrue(paramsValid(deltaX, deltaY, numOfIterations,
+                point1X, point1Y) && paramsValid(deltaX, deltaY, numOfIterations,
+                point2X, point2Y));
+        point1X += deltaX;
+        point1Y += deltaY;
+        point2X += deltaX;
+        point2Y += deltaY;
+        device.setPoint(p1, point1X, point1Y);
+        device.setPoint(p2, point2X, point2Y);
+        device.sync();
+        TestLog.waitForLogContaining("TouchPoint: MOVED %d, %d", point1X, point1Y);
+        TestLog.waitForLogContaining("TouchPoint: MOVED %d, %d", point2X, point2Y);
+        boolean passedTheThreshold = false;
+        if (firstMove) {
+            totalDeltaX = deltaX;
+            totalDeltaY = deltaY;
+            if (Math.abs(deltaX) > getScrollThreshold()
+                    || Math.abs(deltaY) > getScrollThreshold()) {
+                TestLog.waitForLogContaining("Scroll started, DeltaX: " + 0
+                            + ", DeltaY: " + 0
+                            + ", totalDeltaX: " + 0
+                            + ", totalDeltaY: " + 0
+                            + ", touch points: " + 2
+                            + ", inertia value: false");
+                TestLog.waitForLogContaining("Scroll, DeltaX: " + deltaX
+                        + ", DeltaY: " + deltaY
+                        + ", totalDeltaX: " + totalDeltaX
+                        + ", totalDeltaY: " + totalDeltaY
+                        + ", touch points: " + 2
+                        + ", inertia value: false");
+            } else {
+                Assert.assertEquals(0, TestLog.countLogContaining("Scroll " +
+                        "started"));
+                Assert.assertEquals(0, TestLog.countLogContaining("Scroll, DeltaX:"));
+            }
+        } else {
+            if (fingersChanged) {
+                totalDeltaX = deltaX;
+                totalDeltaY = deltaY;
+            } else {
+                totalDeltaX += deltaX;
+                totalDeltaY += deltaY;
+            }
+            TestLog.waitForLogContaining("Scroll, DeltaX: " + deltaX
+                    + ", DeltaY: " + deltaY
+                    + ", totalDeltaX: " + totalDeltaX
+                    + ", totalDeltaY: " + totalDeltaY
+                    + ", touch points: " + 2
+                    + ", inertia value: false");
+            passedTheThreshold = true;
+        }
+        String expectedLog;
+        if (numOfIterations >= 2) {
+            for (int i = 2; i <= numOfIterations; i++) {
+                point1X += deltaX;
+                point1Y += deltaY;
+                point2X += deltaX;
+                point2Y += deltaY;
+                TestLog.reset();
+                device.setPoint(p1, point1X, point1Y);
+                device.setPoint(p2, point2X, point2Y);
+                device.sync();
+                TestLog.waitForLogContaining("TouchPoint: MOVED %d, %d",
+                        point1X, point1Y);
+                TestLog.waitForLogContaining("TouchPoint: MOVED %d, %d",
+                        point2X, point2Y);
+                totalDeltaX += deltaX;
+                totalDeltaY += deltaY;
+                expectedLog = "Scroll, DeltaX: " + deltaX + ", DeltaY: " + deltaY
+                        + ", totalDeltaX: " + totalDeltaX
+                        + ", totalDeltaY: " + totalDeltaY
+                        + ", touch points: " + 2
+                        + ", inertia value: false";
+                if (firstMove && Math.abs(deltaX) < getScrollThreshold()
+                        && Math.abs(deltaY) < getScrollThreshold()) {
+                    if(Math.abs(totalDeltaX) > getScrollThreshold()
+                            || Math.abs(totalDeltaY) > getScrollThreshold()) {
+                        if (!passedTheThreshold) {
+                            expectedLog = "Scroll, DeltaX: " + totalDeltaX
+                                    + ", DeltaY: " + totalDeltaY
+                                    + ", totalDeltaX: " + totalDeltaX
+                                    + ", totalDeltaY: " + totalDeltaY
+                                    + ", touch points: " + 2
+                                    + ", inertia value: false";
+                            passedTheThreshold = true;
+                        }
+                    } else {
+                        expectedLog = "sync";
+                    }
+                }
+                TestLog.waitForLogContaining(expectedLog);
+            }
+        }
+    }
+
+    /**
+     * The method releases one finger that is currently pressing on the screen
+     */
+    protected void releaseFirstFinger() throws Exception {
+        Assert.assertEquals(1, device.getPressedPoints());
+        String expectedLog;
+        TestLog.reset();
+        device.removePoint(p1);
+        device.sync();
+        //verify finger release
+        int expectedValue = 0;
+        expectedLog = "Scroll finished, DeltaX: " + 0
+                + ", DeltaY: " + 0
+                + ", totalDeltaX: " + totalDeltaX
+                + ", totalDeltaY: " + totalDeltaY
+                + ", touch points: " + 1
+                + ", inertia value: false";
+        TestLog.waitForLogContaining("TouchPoint: RELEASED %d, %d",
+                point1X, point1Y);
+        if (Math.abs(totalDeltaX) > getScrollThreshold()
+                || Math.abs(totalDeltaY) > getScrollThreshold()) {
+            expectedValue = 1;
+            TestLog.waitForLogContaining(expectedLog);
+        }
+        totalDeltaX = 0;
+        totalDeltaY = 0;
+        Assert.assertEquals(expectedValue, TestLog.countLogContaining(expectedLog));
+    }
+
+    /**
+     * The method releases second of two fingers that are currently
+     * pressing on the screen
+     */
+    protected void releaseSecondFinger() throws Exception {
+        Assert.assertEquals(2, device.getPressedPoints());
+        String expectedLog;
+        TestLog.reset();
+        device.removePoint(p2);
+        device.sync();
+        //verify finger release
+        int expectedValue = 0;
+        expectedLog = "Scroll finished, DeltaX: " + 0
+                + ", DeltaY: " + 0
+                + ", totalDeltaX: " + totalDeltaX
+                + ", totalDeltaY: " + totalDeltaY
+                + ", touch points: " + 2
+                + ", inertia value: false";
+        TestLog.waitForLogContaining("TouchPoint: RELEASED %d, %d",
+                point2X, point2Y);
+        if (Math.abs(totalDeltaX) > getScrollThreshold()
+                || Math.abs(totalDeltaY) > getScrollThreshold()) {
+            expectedValue = 1;
+            TestLog.waitForLogContaining(expectedLog);
+        }
+        totalDeltaX = 0;
+        totalDeltaY = 0;
+        Assert.assertEquals(expectedValue, TestLog.countLogContaining(expectedLog));
+    }
+
+    /**
+     * The method releases two fingers that are currently pressing on the screen
+     */
+    protected void releaseAllFingers() throws Exception {
+        Assert.assertEquals(2, device.getPressedPoints());
+        String expectedLog;
+        TestLog.reset();
+        device.removePoint(p1);
+        device.removePoint(p2);
+        device.sync();
+        //verify finger release
+        int expectedValue = 0;
+        expectedLog = "Scroll finished, DeltaX: " + 0
+                + ", DeltaY: " + 0
+                + ", totalDeltaX: " + totalDeltaX
+                + ", totalDeltaY: " + totalDeltaY
+                + ", touch points: " + 2
+                + ", inertia value: false";
+        TestLog.waitForLogContaining("TouchPoint: RELEASED %d, %d", point1X, point1Y);
+        TestLog.waitForLogContaining("TouchPoint: RELEASED %d, %d", point2X, point2Y);
+        if (Math.abs(totalDeltaX) > getScrollThreshold() ||
+                Math.abs(totalDeltaY) > getScrollThreshold()) {
+            expectedValue = 1;
+            TestLog.waitForLogContaining(expectedLog);
+        }
+        totalDeltaX = 0;
+        totalDeltaY = 0;
+        Assert.assertEquals(expectedValue, TestLog.countLogContaining(expectedLog));
+    }
+}
--- a/tests/system/src/test/java/com/sun/glass/ui/monocle/input/TestApplication.java	Tue May 20 11:20:45 2014 +0200
+++ b/tests/system/src/test/java/com/sun/glass/ui/monocle/input/TestApplication.java	Tue May 20 17:50:10 2014 +0300
@@ -281,33 +281,67 @@
         //Zoom
         getStage().getScene().setOnZoom((e) -> {
             TestLog.log("Zoom, factor: " + e.getZoomFactor()
-                    + ", total factor: " + e.getTotalZoomFactor());
+                    + ", total factor: " + e.getTotalZoomFactor()
+                    + ", inertia value: " + e.isInertia());
         });
 
         getStage().getScene().setOnZoomStarted((e) -> {
             TestLog.log("Zoom started, factor: " + e.getZoomFactor()
-                    + ", total factor: " + e.getTotalZoomFactor());
+                    + ", total factor: " + e.getTotalZoomFactor()
+                    + ", inertia value: " + e.isInertia());
         });
 
         getStage().getScene().setOnZoomFinished((e) -> {
             TestLog.log("Zoom finished, factor: " + e.getZoomFactor()
-                    + ", total factor: " + e.getTotalZoomFactor());
+                    + ", total factor: " + e.getTotalZoomFactor()
+                    + ", inertia value: " + e.isInertia());
         });
 
         //Rotate
         getStage().getScene().setOnRotate((e) -> {
             TestLog.log("Rotation, angle: " + Math.round(e.getAngle())
-                    + ", total angle: " + Math.round(e.getTotalAngle()));
+                    + ", total angle: " + Math.round(e.getTotalAngle())
+                    + ", inertia value: " + e.isInertia());
         });
 
         getStage().getScene().setOnRotationStarted((e) -> {
             TestLog.log("Rotation started, angle: " + Math.round(e.getAngle())
-                    + ", total angle: " + Math.round(e.getTotalAngle()));
+                    + ", total angle: " + Math.round(e.getTotalAngle())
+                    + ", inertia value: " + e.isInertia());
         });
 
         getStage().getScene().setOnRotationFinished((e) -> {
             TestLog.log("Rotation finished, angle: " + Math.round(e.getAngle())
-                    + ", total angle: " + Math.round(e.getTotalAngle()));
+                    + ", total angle: " + Math.round(e.getTotalAngle())
+                    + ", inertia value: " + e.isInertia());
+        });
+
+        //Scroll
+        getStage().getScene().setOnScroll((e) -> {
+            TestLog.log("Scroll, DeltaX: " + Math.round(e.getDeltaX())
+                    + ", DeltaY: " + Math.round(e.getDeltaY())
+                    + ", totalDeltaX: " + Math.round(e.getTotalDeltaX())
+                    + ", totalDeltaY: " + Math.round(e.getTotalDeltaY())
+                    + ", touch points: " + e.getTouchCount()
+                    + ", inertia value: " + e.isInertia());
+        });
+
+        getStage().getScene().setOnScrollStarted((e) -> {
+            TestLog.log("Scroll started, DeltaX: " + Math.round(e.getDeltaX())
+                    + ", DeltaY: " + Math.round(e.getDeltaY())
+                    + ", totalDeltaX: " + Math.round(e.getTotalDeltaX())
+                    + ", totalDeltaY: " + Math.round(e.getTotalDeltaY())
+                    + ", touch points: " + e.getTouchCount()
+                    + ", inertia value: " + e.isInertia());
+        });
+
+        getStage().getScene().setOnScrollFinished((e) -> {
+            TestLog.log("Scroll finished, DeltaX: " + Math.round(e.getDeltaX())
+                    + ", DeltaY: " + Math.round(e.getDeltaY())
+                    + ", totalDeltaX: " + Math.round(e.getTotalDeltaX())
+                    + ", totalDeltaY: " + Math.round(e.getTotalDeltaY())
+                    + ", touch points: " + e.getTouchCount()
+                    + ", inertia value: " + e.isInertia());
         });
     }
 
--- a/tests/system/src/test/java/com/sun/glass/ui/monocle/input/devices/TestTouchDevice.java	Tue May 20 11:20:45 2014 +0200
+++ b/tests/system/src/test/java/com/sun/glass/ui/monocle/input/devices/TestTouchDevice.java	Tue May 20 17:50:10 2014 +0300
@@ -56,6 +56,10 @@
         return points.length;
     }
 
+    public int getPressedPoints() {
+        return pressedPoints;
+    }
+
     protected int getID(int p) {
         if (ids.containsKey(p)) {
             return ids.get(p);