aboutsummaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/TestNewtKeyEventAutoRepeatAWT.java11
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/TestNewtKeyPressReleaseUnmaskRepeatAWT.java2
2 files changed, 10 insertions, 3 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestNewtKeyEventAutoRepeatAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestNewtKeyEventAutoRepeatAWT.java
index 51f3cb7c9..d373f1486 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestNewtKeyEventAutoRepeatAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestNewtKeyEventAutoRepeatAWT.java
@@ -165,8 +165,15 @@ public class TestNewtKeyEventAutoRepeatAWT extends UITestCase {
System.err.println("+++ KEY Event Auto-Repeat START Input Loop: "+i);
AWTRobotUtil.keyPress(0, robot, true, java.awt.event.KeyEvent.VK_A, pressDurationMS);
robot.waitForIdle();
- AWTRobotUtil.keyPress(0, robot, false, java.awt.event.KeyEvent.VK_A, 1000); // 1s .. no AR anymore
- robot.waitForIdle();
+ AWTRobotUtil.keyPress(0, robot, false, java.awt.event.KeyEvent.VK_A, 500); // 1s .. no AR anymore
+ robot.waitForIdle();
+ final int minCodeCount = firstIdx + 3;
+ final int desiredCodeCount = firstIdx + 6;
+ for(int j=0; j < 10 && keyEvents.size() < desiredCodeCount; j++) { // wait until events are collected
+ robot.delay(100);
+ }
+ Assert.assertTrue("AR Test didn't collect enough key events: required min "+minCodeCount+", received "+(keyEvents.size()-firstIdx)+", "+keyEvents,
+ keyEvents.size() >= minCodeCount );
first[i][0] = (KeyEvent) keyEvents.get(firstIdx+0);
first[i][1] = (KeyEvent) keyEvents.get(firstIdx+1);
first[i][2] = (KeyEvent) keyEvents.get(firstIdx+2);
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestNewtKeyPressReleaseUnmaskRepeatAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestNewtKeyPressReleaseUnmaskRepeatAWT.java
index e6d75afba..c4dc5a8ad 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestNewtKeyPressReleaseUnmaskRepeatAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestNewtKeyPressReleaseUnmaskRepeatAWT.java
@@ -98,7 +98,7 @@ public class TestNewtKeyPressReleaseUnmaskRepeatAWT extends UITestCase {
glWindow.destroy();
}
- // @Test
+ @Test
public void test02NewtCanvasAWT() throws AWTException, InterruptedException, InvocationTargetException {
GLWindow glWindow = GLWindow.create(glCaps);