From 40bc27c7199a747ff082b784b8e2871d36b763f5 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 1 Mar 2011 02:11:59 +0100 Subject: Fix TestSharedContextListAWT: Use in-thread simple frame construction, which somehow solves the problem on Windows having no height --- .../test/junit/jogl/acore/TestSharedContextListAWT.java | 15 ++++++--------- .../com/jogamp/opengl/test/junit/util/AWTRobotUtil.java | 6 +++++- 2 files changed, 11 insertions(+), 10 deletions(-) (limited to 'src/test/com/jogamp') 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