From 3c8a814d7fb536f298507413f290309ed7c0f24e Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 29 Oct 2012 14:44:11 +0100 Subject: TestNewtKeyEventAutoRepeatAWT: Wait for 'some' KeyEvents and check count; TestNewtKeyPressReleaseUnmaskRepeatAWT: Enable NewtCanvasAWT test --- .../opengl/test/junit/newt/TestNewtKeyEventAutoRepeatAWT.java | 11 +++++++++-- .../junit/newt/TestNewtKeyPressReleaseUnmaskRepeatAWT.java | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'src/test/com/jogamp/opengl') 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); -- cgit v1.2.3