summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-10-29 14:44:11 +0100
committerSven Gothel <[email protected]>2012-10-29 14:44:11 +0100
commit3c8a814d7fb536f298507413f290309ed7c0f24e (patch)
treee57d6eb793bb3d04ac87c3e48378d2cec727d84e /src
parent6936c2e99ab767a96dce0e1fe386481611ea2a18 (diff)
TestNewtKeyEventAutoRepeatAWT: Wait for 'some' KeyEvents and check count; TestNewtKeyPressReleaseUnmaskRepeatAWT: Enable NewtCanvasAWT test
Diffstat (limited to 'src')
-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);