diff options
author | Sven Gothel <[email protected]> | 2011-03-01 02:11:59 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-03-01 02:11:59 +0100 |
commit | 40bc27c7199a747ff082b784b8e2871d36b763f5 (patch) | |
tree | 2fa5f0ed850e773d0f26d8dfb96478fe61c15098 /src/test/com/jogamp | |
parent | 83570ff52f67d8f0f7fe978e178bf7825041bee3 (diff) |
Fix TestSharedContextListAWT: Use in-thread simple frame construction, which somehow solves the problem on Windows having no height
Diffstat (limited to 'src/test/com/jogamp')
-rw-r--r-- | src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListAWT.java | 15 | ||||
-rw-r--r-- | src/test/com/jogamp/opengl/test/junit/util/AWTRobotUtil.java | 6 |
2 files changed, 11 insertions, 10 deletions
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) { |