summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-03-01 02:11:59 +0100
committerSven Gothel <[email protected]>2011-03-01 02:11:59 +0100
commit40bc27c7199a747ff082b784b8e2871d36b763f5 (patch)
tree2fa5f0ed850e773d0f26d8dfb96478fe61c15098
parent83570ff52f67d8f0f7fe978e178bf7825041bee3 (diff)
Fix TestSharedContextListAWT: Use in-thread simple frame construction, which somehow solves the problem on Windows having no height
-rw-r--r--make/scripts/junit-singletest-x64.bat1
-rw-r--r--make/scripts/junit-singletest-x64.sh1
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListAWT.java15
-rw-r--r--src/test/com/jogamp/opengl/test/junit/util/AWTRobotUtil.java6
4 files changed, 13 insertions, 10 deletions
diff --git a/make/scripts/junit-singletest-x64.bat b/make/scripts/junit-singletest-x64.bat
new file mode 100644
index 000000000..78aff8be3
--- /dev/null
+++ b/make/scripts/junit-singletest-x64.bat
@@ -0,0 +1 @@
+scripts\make.jogl.all.win64.bat -Dtestclass=com.jogamp.opengl.test.junit.jogl.acore.TestSharedContextListAWT -f build-test.xml junit.run.awt.singletest
diff --git a/make/scripts/junit-singletest-x64.sh b/make/scripts/junit-singletest-x64.sh
new file mode 100644
index 000000000..4cc51be00
--- /dev/null
+++ b/make/scripts/junit-singletest-x64.sh
@@ -0,0 +1 @@
+scripts/make.jogl.all.linux-x86_64.sh -Dtestclass=com.jogamp.opengl.test.junit.jogl.acore.TestSharedContextListAWT -f build-test.xml junit.run.awt.singletest
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListAWT.java
index 63f54e267..bf4c493bc 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListAWT.java
@@ -85,8 +85,12 @@ public class TestSharedContextListAWT extends UITestCase {
protected GLCanvas runTestGL(final Frame frame, final Animator animator, final int x, final int y, final boolean useShared)
throws InterruptedException
{
- final GLCanvas glCanvas = new GLCanvas(caps, useShared ? sharedDrawable.getContext() : null);
+ final GLCanvas glCanvas = new GLCanvas(caps, useShared ? sharedDrawable.getContext() : null);
Assert.assertNotNull(glCanvas);
+ frame.add(glCanvas);
+ frame.setLocation(x, y);
+ frame.setSize(width, height);
+
Gears gears = new Gears();
if(useShared) {
gears.setGears(sharedGears.getGear1(), sharedGears.getGear2(), sharedGears.getGear3());
@@ -95,14 +99,7 @@ public class TestSharedContextListAWT extends UITestCase {
animator.add(glCanvas);
- SwingUtilities.invokeLater(new Runnable() {
- public void run() {
- frame.add(glCanvas);
- frame.setLocation(x, y);
- frame.setSize(width, height);
- frame.pack();
- frame.setVisible(true);
- } });
+ frame.setVisible(true);
Assert.assertEquals(true, AWTRobotUtil.waitForRealized(glCanvas, true));
return glCanvas;
diff --git a/src/test/com/jogamp/opengl/test/junit/util/AWTRobotUtil.java b/src/test/com/jogamp/opengl/test/junit/util/AWTRobotUtil.java
index bbd53db9b..d0f9172bc 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/AWTRobotUtil.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/AWTRobotUtil.java
@@ -367,11 +367,15 @@ public class AWTRobotUtil {
}
if(wait>=POLL_DIVIDER) {
// for some reason GLCanvas hasn't been painted yet, force it!
- System.err.println("XXX: FORCE REPAINT - canvas: "+glcanvas);
+ System.err.println("XXX: FORCE REPAINT PRE - canvas: "+glcanvas);
glcanvas.repaint();
for (wait=0; wait<POLL_DIVIDER && realized != glcanvas.isRealized(); wait++) {
Thread.sleep(TIME_OUT/POLL_DIVIDER);
}
+ System.err.println("XXX: FORCE REPAINT POST - canvas: "+glcanvas);
+ }
+ for (wait=0; wait<POLL_DIVIDER && realized != glcanvas.isRealized(); wait++) {
+ Thread.sleep(TIME_OUT/POLL_DIVIDER);
}
}
} else if(obj instanceof com.jogamp.newt.Window) {