changeset 7161:9425ba418764 8u20-b16

Linux Input Tests: Adding test ChangeSceneDuringTap
author Elina Kleyman <elina.kleyman@oracle.com>
date Sun, 25 May 2014 16:59:23 +0300
parents ada2f87fd6d8
children e0a88803a3eb ce2ebc11d5c4 0b5c3b2de3a1
files tests/system/src/test/java/com/sun/glass/ui/monocle/input/SingleTouchTest.java
diffstat 1 files changed, 28 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/tests/system/src/test/java/com/sun/glass/ui/monocle/input/SingleTouchTest.java	Sun May 25 15:03:48 2014 +0300
+++ b/tests/system/src/test/java/com/sun/glass/ui/monocle/input/SingleTouchTest.java	Sun May 25 16:59:23 2014 +0300
@@ -27,9 +27,13 @@
 
 import com.sun.glass.ui.monocle.input.devices.TestTouchDevice;
 import com.sun.glass.ui.monocle.input.devices.TestTouchDevices;
+import javafx.scene.Group;
+import javafx.scene.Scene;
+import javafx.scene.shape.Rectangle;
 import org.junit.Assert;
 import org.junit.Assume;
 import org.junit.Test;
+import org.junit.Ignore;
 import org.junit.runners.Parameterized;
 
 import java.util.Collection;
@@ -230,6 +234,28 @@
                             .filter(s -> s.startsWith("Touch point count"))
                             .filter(s -> !s.startsWith("Touch point count: 1")).count());
     }
-
-
+	
+    /**
+     * Touch down, change scene, release finger.
+     */
+    @Ignore("RT-36008")
+    @Test
+    public void testChangeSceneDuringTap() throws Exception {
+        final int x1 = (int) Math.round(width * 0.3);
+        final int y1 = (int) Math.round(height * 0.3);
+        int p1 = device.addPoint(x1, y1);
+        device.sync();
+        TestLog.waitForLog("Touch pressed: %d, %d", x1, y1);
+        TestRunnable.invokeAndWait(() ->
+        {
+            Rectangle r = new Rectangle(0, 0, width, height);
+            Group g = new Group();
+            g.getChildren().add(r);
+            Scene scene = new Scene(g);
+            TestApplication.getStage().setScene(scene);
+        });
+        device.removePoint(p1);
+        device.sync();
+        Assert.assertEquals(1, TestLog.countLogContaining("Mouse clicked: " + x1 +", " + y1));
+    }
 }