aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-01-19 20:05:48 +0100
committerSven Gothel <[email protected]>2013-01-19 20:05:48 +0100
commitc27f0b37024b8a991512ad8d0856821804bb3692 (patch)
tree31c17fc676cf1e6d2a9142cd7425c2d0bb078b61
parentc59f78a4c3dbe9bb63119d1ece781d8f732b58e4 (diff)
TestSwingAWTRobotUsageBeforeJOGLInitBug411: Fix 'chicken egg' init problem w/ AWTRobot, i.e. NativeWindow not yet initialized.
Regression since: 50f997557b91a2f014ef0c2ea848c5c326d0cfb2
-rwxr-xr-xmake/scripts/tests.sh4
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/newt/TestSwingAWTRobotUsageBeforeJOGLInitBug411.java13
2 files changed, 14 insertions, 3 deletions
diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh
index 8f8d67c13..80e418056 100755
--- a/make/scripts/tests.sh
+++ b/make/scripts/tests.sh
@@ -399,7 +399,7 @@ function testawtswt() {
#
# newt.awt (testawt)
#
-#testawt com.jogamp.opengl.test.junit.jogl.newt.TestSwingAWTRobotUsageBeforeJOGLInitBug411 $*
+testawt com.jogamp.opengl.test.junit.jogl.newt.TestSwingAWTRobotUsageBeforeJOGLInitBug411 $*
#testawt com.jogamp.opengl.test.junit.jogl.demos.gl2.newt.TestGearsNewtAWTWrapper $*
#testawt com.jogamp.opengl.test.junit.newt.TestEventSourceNotAWTBug
#testawt com.jogamp.opengl.test.junit.newt.TestFocus01SwingAWTRobot $*
@@ -492,7 +492,7 @@ function testawtswt() {
#
#testnoawt com.jogamp.opengl.test.junit.graph.TestTextRendererNEWT10 $*
#testnoawt com.jogamp.opengl.test.junit.graph.TestTextRendererNEWT00 $*
-testnoawt com.jogamp.opengl.test.junit.graph.TestRegionRendererNEWT01 $*
+#testnoawt com.jogamp.opengl.test.junit.graph.TestRegionRendererNEWT01 $*
#testnoawt com.jogamp.opengl.test.junit.graph.TestTextRendererNEWT01 $*
#testnoawt com.jogamp.opengl.test.junit.graph.demos.ui.UINewtDemo01 $*
#testnoawt com.jogamp.opengl.test.junit.graph.demos.GPUTextNewtDemo01 $*
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/newt/TestSwingAWTRobotUsageBeforeJOGLInitBug411.java b/src/test/com/jogamp/opengl/test/junit/jogl/newt/TestSwingAWTRobotUsageBeforeJOGLInitBug411.java
index b165a9693..0e9b6cd88 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/newt/TestSwingAWTRobotUsageBeforeJOGLInitBug411.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/newt/TestSwingAWTRobotUsageBeforeJOGLInitBug411.java
@@ -33,6 +33,8 @@ import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
import com.jogamp.opengl.test.junit.util.*;
import java.lang.reflect.InvocationTargetException;
+
+import javax.media.nativewindow.NativeWindowFactory;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLProfile;
import javax.media.opengl.GLCapabilities;
@@ -157,7 +159,16 @@ public class TestSwingAWTRobotUsageBeforeJOGLInitBug411 extends UITestCase {
robot = new Robot();
robot.setAutoWaitForIdle(true);
- Assert.assertEquals(true, AWTRobotUtil.waitForVisible(frame, true));
+ // NativeWindow/JOGL is not initialized yet ..
+ for (int wait=0; wait<AWTRobotUtil.POLL_DIVIDER && !frame.isVisible(); wait++) {
+ Thread.sleep(AWTRobotUtil.TIME_SLICE);
+ }
+ Assert.assertEquals(true, frame.isVisible());
+
+ System.err.println("TestSwingAWTRobotUsageBeforeJOGLInitBug411.setup(): Before NativeWindow init");
+
+ NativeWindowFactory.initSingleton();
+
AWTRobotUtil.clearAWTFocus(robot);
AWTRobotUtil.toFrontAndRequestFocus(robot, frame);
AWTRobotUtil.requestFocus(robot, button);