diff options
author | Sven Gothel <[email protected]> | 2019-04-10 00:16:10 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2019-04-10 00:16:10 +0200 |
commit | b865c4bcd1a89632ea49b7be56ac230a5aa2da63 (patch) | |
tree | 46c2b088490c466ecd94b3f958210b46ae9fda08 | |
parent | 6df8cd254d2a82910477f9e5d9bf7a742157de7a (diff) |
Cleanup AWTRobotUtil ..: Add 'Runnable waitAction' also to waitForFocus and closeWindow, etc ..
32 files changed, 207 insertions, 163 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOAutoDrawableFactoryNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOAutoDrawableFactoryNEWT.java index dfe6fca67..05aea5ac7 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOAutoDrawableFactoryNEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOAutoDrawableFactoryNEWT.java @@ -339,7 +339,7 @@ public class TestFBOAutoDrawableFactoryNEWT extends UITestCase { szStep = 1; glad.setSurfaceSize(widthStep*szStep, heightStep*szStep); // SWAP_EVEN Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - GLTestUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); + GLTestUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep, null)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); // - SWAP_ODD glad.display(); // - SWAP_EVEN @@ -387,7 +387,7 @@ public class TestFBOAutoDrawableFactoryNEWT extends UITestCase { szStep = 4; glad.setSurfaceSize(widthStep*szStep, heightStep*szStep); // SWAP_ODD Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - GLTestUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); + GLTestUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep, null)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); // - SWAP_EVEN glad.display(); // - SWAP_ODD @@ -446,7 +446,7 @@ public class TestFBOAutoDrawableFactoryNEWT extends UITestCase { szStep = 3; glad.setSurfaceSize(widthStep*szStep, heightStep*szStep); Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - GLTestUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); + GLTestUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep, null)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableDelegateOnOffscrnCapsNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableDelegateOnOffscrnCapsNEWT.java index 844788c8a..4f666920a 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableDelegateOnOffscrnCapsNEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableDelegateOnOffscrnCapsNEWT.java @@ -200,7 +200,7 @@ public class TestGLAutoDrawableDelegateOnOffscrnCapsNEWT extends UITestCase { // 1 - szStep = 2 final int[] expSurfaceSize = glad.getNativeSurface().convertToPixelUnits(new int[] { widthStep*szStep, heightStep*szStep }); Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - GLTestUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1])); + GLTestUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1], null)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); @@ -211,7 +211,7 @@ public class TestGLAutoDrawableDelegateOnOffscrnCapsNEWT extends UITestCase { expSurfaceSize[1] = heightStep*szStep; glad.getNativeSurface().convertToPixelUnits(expSurfaceSize); Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - GLTestUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1])); + GLTestUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1], null)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); @@ -222,7 +222,7 @@ public class TestGLAutoDrawableDelegateOnOffscrnCapsNEWT extends UITestCase { expSurfaceSize[1] = heightStep*szStep; glad.getNativeSurface().convertToPixelUnits(expSurfaceSize); Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - GLTestUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1])); + GLTestUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1], null)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryES2OffscrnCapsNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryES2OffscrnCapsNEWT.java index 81dfe7b73..7cef9e448 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryES2OffscrnCapsNEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryES2OffscrnCapsNEWT.java @@ -128,7 +128,7 @@ public class TestGLAutoDrawableFactoryES2OffscrnCapsNEWT extends UITestCase { // 1 - szStep = 2 Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - GLTestUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); + GLTestUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep, null)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); @@ -136,7 +136,7 @@ public class TestGLAutoDrawableFactoryES2OffscrnCapsNEWT extends UITestCase { szStep = 1; glad.setSurfaceSize(widthStep*szStep, heightStep*szStep); Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - GLTestUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); + GLTestUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep, null)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); @@ -144,7 +144,7 @@ public class TestGLAutoDrawableFactoryES2OffscrnCapsNEWT extends UITestCase { szStep = 4; glad.setSurfaceSize(widthStep*szStep, heightStep*szStep); Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - GLTestUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); + GLTestUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep, null)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGL2OffscrnCapsNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGL2OffscrnCapsNEWT.java index d8e3c8c6e..a23e81d69 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGL2OffscrnCapsNEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGL2OffscrnCapsNEWT.java @@ -128,7 +128,7 @@ public class TestGLAutoDrawableFactoryGL2OffscrnCapsNEWT extends UITestCase { // 1 - szStep = 2 Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - GLTestUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); + GLTestUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep, null)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); @@ -136,7 +136,7 @@ public class TestGLAutoDrawableFactoryGL2OffscrnCapsNEWT extends UITestCase { szStep = 1; glad.setSurfaceSize(widthStep*szStep, heightStep*szStep); Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - GLTestUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); + GLTestUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep, null)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); @@ -144,7 +144,7 @@ public class TestGLAutoDrawableFactoryGL2OffscrnCapsNEWT extends UITestCase { szStep = 4; glad.setSurfaceSize(widthStep*szStep, heightStep*szStep); Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - GLTestUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); + GLTestUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep, null)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGLProfileDeviceNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGLProfileDeviceNEWT.java index 4ab7c5a2e..9934ae862 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGLProfileDeviceNEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGLProfileDeviceNEWT.java @@ -104,14 +104,14 @@ public class TestGLAutoDrawableFactoryGLProfileDeviceNEWT extends UITestCase { // 1 - szStep = 2 Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - GLTestUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); + GLTestUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep, null)); glad.display(); // 2, 3 (resize + display) szStep = 1; glad.setSurfaceSize(widthStep*szStep, heightStep*szStep); Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - GLTestUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); + GLTestUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep, null)); glad.display(); Thread.sleep(50); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGLnBitmapCapsNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGLnBitmapCapsNEWT.java index 0936732bc..6a7b09be1 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGLnBitmapCapsNEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGLnBitmapCapsNEWT.java @@ -120,7 +120,7 @@ public class TestGLAutoDrawableFactoryGLnBitmapCapsNEWT extends UITestCase { // 1 - szStep = 2 Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - GLTestUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); + GLTestUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep, null)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); @@ -128,7 +128,7 @@ public class TestGLAutoDrawableFactoryGLnBitmapCapsNEWT extends UITestCase { szStep = 1; glad.setSurfaceSize(widthStep*szStep, heightStep*szStep); Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - GLTestUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); + GLTestUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep, null)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); @@ -136,7 +136,7 @@ public class TestGLAutoDrawableFactoryGLnBitmapCapsNEWT extends UITestCase { szStep = 4; glad.setSurfaceSize(widthStep*szStep, heightStep*szStep); Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - GLTestUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); + GLTestUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep, null)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT.java index 06041cc37..6138ce6ee 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT.java @@ -200,7 +200,7 @@ public class TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT extends UITestCase { // 1 - szStep = 2 final int[] expSurfaceSize = glad.getNativeSurface().convertToPixelUnits(new int[] { widthStep*szStep, heightStep*szStep }); Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - GLTestUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1])); + GLTestUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1], null)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); @@ -211,7 +211,7 @@ public class TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT extends UITestCase { expSurfaceSize[1] = heightStep*szStep; glad.getNativeSurface().convertToPixelUnits(expSurfaceSize); Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - GLTestUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1])); + GLTestUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1], null)); glad.display(); snapshotGLEventListener.setMakeSnapshot(); glad.display(); @@ -223,7 +223,7 @@ public class TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT extends UITestCase { expSurfaceSize[1] = heightStep*szStep; glad.getNativeSurface().convertToPixelUnits(expSurfaceSize); Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - GLTestUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1])); + GLTestUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1], null)); glad.display(); snapshotGLEventListener.setMakeSnapshot(); glad.display(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT.java index 9c429873a..34148501d 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT.java @@ -155,7 +155,7 @@ public class TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT extends UITestCase { // 1 - szStep = 2 final int[] expSurfaceSize = glad.getNativeSurface().convertToPixelUnits(new int[] { widthStep*szStep, heightStep*szStep }); Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - GLTestUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1])); + GLTestUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1], null)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); @@ -166,7 +166,7 @@ public class TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT extends UITestCase { expSurfaceSize[1] = heightStep*szStep; glad.getNativeSurface().convertToPixelUnits(expSurfaceSize); Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - GLTestUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1])); + GLTestUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1], null)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); @@ -177,7 +177,7 @@ public class TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT extends UITestCase { expSurfaceSize[1] = heightStep*szStep; glad.getNativeSurface().convertToPixelUnits(expSurfaceSize); Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - GLTestUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1])); + GLTestUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1], null)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT.java index 9909d7dd0..ce968751e 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT.java @@ -211,7 +211,7 @@ public class TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT extends UITestCase // 1 - szStep = 2 final int[] expSurfaceSize = glad.getNativeSurface().convertToPixelUnits(new int[] { widthStep*szStep, heightStep*szStep }); Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - GLTestUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1])); + GLTestUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1], null)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); @@ -222,7 +222,7 @@ public class TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT extends UITestCase expSurfaceSize[1] = heightStep*szStep; glad.getNativeSurface().convertToPixelUnits(expSurfaceSize); Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - GLTestUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1])); + GLTestUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1], null)); glad.display(); snapshotGLEventListener.setMakeSnapshot(); glad.display(); @@ -234,7 +234,7 @@ public class TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT extends UITestCase expSurfaceSize[1] = heightStep*szStep; glad.getNativeSurface().convertToPixelUnits(expSurfaceSize); Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - GLTestUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1])); + GLTestUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1], null)); glad.display(); snapshotGLEventListener.setMakeSnapshot(); glad.display(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextNewtAWTBug523.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextNewtAWTBug523.java index cd1cfaced..7a1d48cf0 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextNewtAWTBug523.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextNewtAWTBug523.java @@ -752,7 +752,7 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase { while(animator.isAnimating() && animator.getTotalFPSDuration() < durationPerTest) { Thread.sleep(100); } - AWTRobotUtil.closeWindow(frame, true, awtClosingListener); + AWTRobotUtil.closeWindow(frame, true, awtClosingListener, null); final boolean windowClosed = closingSemaphore.tryAcquire(5000, TimeUnit.MILLISECONDS); Assert.assertEquals(true, windowClosed); } catch (final InterruptedException e) { diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES1NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES1NEWT.java index 356c639d9..a6406d4a0 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES1NEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES1NEWT.java @@ -106,7 +106,7 @@ public class TestSharedContextVBOES1NEWT extends UITestCase { // init and render one frame, which will setup the Gears display lists sharedDrawable.display(); final GLContext ctxM = sharedDrawable.getContext(); - Assert.assertTrue("Master ctx not created", GLTestUtil.waitForContextCreated(sharedDrawable, true)); + Assert.assertTrue("Master ctx not created", GLTestUtil.waitForContextCreated(sharedDrawable, true, null)); Assert.assertTrue("Master Ctx is shared before shared creation", !ctxM.isShared()); Assert.assertTrue("Master Gears is shared", !sharedGears.usesSharedGears()); } @@ -138,7 +138,7 @@ public class TestSharedContextVBOES1NEWT extends UITestCase { glWindow.setVisible(true); Assert.assertTrue(NewtTestUtil.waitForRealized(glWindow, true, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(glWindow, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(glWindow, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(glWindow, true, null)); MiscUtils.dumpSharedGLContext("Master Context", sharedDrawable.getContext()); MiscUtils.dumpSharedGLContext("New Context", glWindow.getContext()); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3.java index 2a14b9a78..16c53564c 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3.java @@ -139,17 +139,17 @@ public class TestSharedContextVBOES2AWT3 extends UITestCase { Assert.assertTrue(GLTestUtil.waitForRealized(c1, true, null)); Assert.assertTrue(AWTRobotUtil.waitForVisible(c1, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(c1, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c1, true, null)); Assert.assertTrue("Gears1 not initialized", g1.waitForInit(true)); Assert.assertTrue(GLTestUtil.waitForRealized(c2, true, null)); Assert.assertTrue(AWTRobotUtil.waitForVisible(c2, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(c2, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c2, true, null)); Assert.assertTrue("Gears2 not initialized", g2.waitForInit(true)); Assert.assertTrue(GLTestUtil.waitForRealized(c3, true, null)); Assert.assertTrue(AWTRobotUtil.waitForVisible(c3, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(c3, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c3, true, null)); Assert.assertTrue("Gears3 not initialized", g3.waitForInit(true)); final GLContext ctx1 = c1.getContext(); @@ -286,17 +286,17 @@ public class TestSharedContextVBOES2AWT3 extends UITestCase { Assert.assertTrue(GLTestUtil.waitForRealized(c1, true, null)); Assert.assertTrue(AWTRobotUtil.waitForVisible(c1, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(c1, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c1, true, null)); Assert.assertTrue("Gears1 not initialized", g1.waitForInit(true)); Assert.assertTrue(GLTestUtil.waitForRealized(c2, true, null)); Assert.assertTrue(AWTRobotUtil.waitForVisible(c2, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(c2, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c2, true, null)); Assert.assertTrue("Gears2 not initialized", g2.waitForInit(true)); Assert.assertTrue(GLTestUtil.waitForRealized(c3, true, null)); Assert.assertTrue(AWTRobotUtil.waitForVisible(c3, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(c3, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c3, true, null)); Assert.assertTrue("Gears3 not initialized", g3.waitForInit(true)); final GLContext ctx1 = c1.getContext(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3b.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3b.java index 4ee11e465..f6eb479fa 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3b.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3b.java @@ -129,17 +129,17 @@ public class TestSharedContextVBOES2AWT3b extends UITestCase { Assert.assertTrue(AWTRobotUtil.waitForRealized(c1, true, null)); Assert.assertTrue(AWTRobotUtil.waitForVisible(c1, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(c1, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c1, true, null)); Assert.assertTrue("Gears1 not initialized", g1.waitForInit(true)); Assert.assertTrue(AWTRobotUtil.waitForRealized(c2, true, null)); Assert.assertTrue(AWTRobotUtil.waitForVisible(c2, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(c2, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c2, true, null)); Assert.assertTrue("Gears2 not initialized", g2.waitForInit(true)); Assert.assertTrue(AWTRobotUtil.waitForRealized(c3, true, null)); Assert.assertTrue(AWTRobotUtil.waitForVisible(c3, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(c3, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c3, true, null)); Assert.assertTrue("Gears3 not initialized", g3.waitForInit(true)); final GLContext ctx1 = c1.getContext(); @@ -238,17 +238,17 @@ public class TestSharedContextVBOES2AWT3b extends UITestCase { Assert.assertTrue(AWTRobotUtil.waitForRealized(c1, true, null)); Assert.assertTrue(AWTRobotUtil.waitForVisible(c1, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(c1, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c1, true, null)); Assert.assertTrue("Gears1 not initialized", g1.waitForInit(true)); Assert.assertTrue(AWTRobotUtil.waitForRealized(c2, true, null)); Assert.assertTrue(AWTRobotUtil.waitForVisible(c2, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(c2, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c2, true, null)); Assert.assertTrue("Gears2 not initialized", g2.waitForInit(true)); Assert.assertTrue(AWTRobotUtil.waitForRealized(c3, true, null)); Assert.assertTrue(AWTRobotUtil.waitForVisible(c3, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(c3, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c3, true, null)); Assert.assertTrue("Gears3 not initialized", g3.waitForInit(true)); final GLContext ctx1 = c1.getContext(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT0.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT0.java index 721139a41..88099f578 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT0.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT0.java @@ -95,7 +95,7 @@ public class TestSharedContextVBOES2NEWT0 extends UITestCase { Assert.assertTrue(NewtTestUtil.waitForRealized(glWindow, true, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(glWindow, true, null)); glWindow.display(); - Assert.assertTrue(GLTestUtil.waitForContextCreated(glWindow, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(glWindow, true, null)); Assert.assertTrue("Gears not initialized", gears.waitForInit(true)); return glWindow; @@ -187,7 +187,7 @@ public class TestSharedContextVBOES2NEWT0 extends UITestCase { f3.destroy(); Assert.assertTrue(NewtTestUtil.waitForVisible(f3, false, null)); Assert.assertTrue(NewtTestUtil.waitForRealized(f3, false, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(f3, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f3, false, null)); { final List<GLContext> ctx1Shares = ctx1.getCreatedShares(); final List<GLContext> ctx2Shares = ctx2.getCreatedShares(); @@ -208,7 +208,7 @@ public class TestSharedContextVBOES2NEWT0 extends UITestCase { f2.destroy(); Assert.assertTrue(NewtTestUtil.waitForVisible(f2, false, null)); Assert.assertTrue(NewtTestUtil.waitForRealized(f2, false, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, false, null)); { final List<GLContext> ctx1Shares = ctx1.getCreatedShares(); final List<GLContext> ctx2Shares = ctx2.getCreatedShares(); @@ -229,7 +229,7 @@ public class TestSharedContextVBOES2NEWT0 extends UITestCase { f1.destroy(); Assert.assertTrue(NewtTestUtil.waitForVisible(f1, false, null)); Assert.assertTrue(NewtTestUtil.waitForRealized(f1, false, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, false, null)); { final List<GLContext> ctx1Shares = ctx1.getCreatedShares(); final List<GLContext> ctx2Shares = ctx2.getCreatedShares(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT1.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT1.java index 710345e49..7b06fcc5d 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT1.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT1.java @@ -118,7 +118,7 @@ public class TestSharedContextVBOES2NEWT1 extends UITestCase { // init and render one frame, which will setup the Gears display lists sharedDrawable.display(); final GLContext ctxM = sharedDrawable.getContext(); - Assert.assertTrue("Master ctx not created", GLTestUtil.waitForContextCreated(sharedDrawable, true)); + Assert.assertTrue("Master ctx not created", GLTestUtil.waitForContextCreated(sharedDrawable, true, null)); Assert.assertTrue("Master Ctx is shared before shared creation", !ctxM.isShared()); Assert.assertTrue("Master Gears not initialized", sharedGears.waitForInit(true)); System.err.println("Master Gears Init done: "+sharedGears); @@ -153,7 +153,7 @@ public class TestSharedContextVBOES2NEWT1 extends UITestCase { glWindow.setVisible(true); Assert.assertTrue(NewtTestUtil.waitForRealized(glWindow, true, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(glWindow, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(glWindow, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(glWindow, true, null)); final GLContext sharedMasterContext = sharedDrawable.getContext(); MiscUtils.dumpSharedGLContext("Master Context", sharedMasterContext); @@ -195,13 +195,13 @@ public class TestSharedContextVBOES2NEWT1 extends UITestCase { f3.destroy(); Assert.assertTrue(NewtTestUtil.waitForVisible(f1, false, null)); Assert.assertTrue(NewtTestUtil.waitForRealized(f1, false, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, false, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(f2, false, null)); Assert.assertTrue(NewtTestUtil.waitForRealized(f2, false, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, false, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(f3, false, null)); Assert.assertTrue(NewtTestUtil.waitForRealized(f3, false, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(f3, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f3, false, null)); releaseShared(); } @@ -233,13 +233,13 @@ public class TestSharedContextVBOES2NEWT1 extends UITestCase { f3.destroy(); Assert.assertTrue(NewtTestUtil.waitForVisible(f1, false, null)); Assert.assertTrue(NewtTestUtil.waitForRealized(f1, false, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, false, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(f2, false, null)); Assert.assertTrue(NewtTestUtil.waitForRealized(f2, false, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, false, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(f3, false, null)); Assert.assertTrue(NewtTestUtil.waitForRealized(f3, false, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(f3, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f3, false, null)); releaseShared(); } @@ -266,13 +266,13 @@ public class TestSharedContextVBOES2NEWT1 extends UITestCase { f3.destroy(); Assert.assertTrue(NewtTestUtil.waitForVisible(f1, false, null)); Assert.assertTrue(NewtTestUtil.waitForRealized(f1, false, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, false, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(f2, false, null)); Assert.assertTrue(NewtTestUtil.waitForRealized(f2, false, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, false, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(f3, false, null)); Assert.assertTrue(NewtTestUtil.waitForRealized(f3, false, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(f3, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f3, false, null)); releaseShared(); } @@ -304,13 +304,13 @@ public class TestSharedContextVBOES2NEWT1 extends UITestCase { f3.destroy(); Assert.assertTrue(NewtTestUtil.waitForVisible(f1, false, null)); Assert.assertTrue(NewtTestUtil.waitForRealized(f1, false, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, false, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(f2, false, null)); Assert.assertTrue(NewtTestUtil.waitForRealized(f2, false, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, false, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(f3, false, null)); Assert.assertTrue(NewtTestUtil.waitForRealized(f3, false, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(f3, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f3, false, null)); releaseShared(); } diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT2.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT2.java index c87835af8..05ee9bab4 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT2.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT2.java @@ -131,31 +131,31 @@ public class TestSharedContextVBOES2NEWT2 extends UITestCase { Assert.assertTrue(NewtTestUtil.waitForRealized(f1, false, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(f1, false, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, false, null)); Assert.assertTrue(NewtTestUtil.waitForRealized(f2, true, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(f2, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, false, null)); Assert.assertTrue(NewtTestUtil.waitForRealized(f3, true, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(f3, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(f3, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f3, false, null)); f1.setVisible(true); // kick off f1 GLContext .. and hence allow f2 + f3 creation Assert.assertTrue(NewtTestUtil.waitForRealized(f1, true, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(f1, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, true, null)); Assert.assertTrue("Gears1 not initialized", g1.waitForInit(true)); Assert.assertTrue(NewtTestUtil.waitForRealized(f2, true, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(f2, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, true, null)); Assert.assertTrue("Gears2 not initialized", g2.waitForInit(true)); Assert.assertTrue(NewtTestUtil.waitForRealized(f3, true, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(f3, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(f3, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f3, true, null)); Assert.assertTrue("Gears3 not initialized", g3.waitForInit(true)); final GLContext ctx1 = f1.getContext(); @@ -253,30 +253,30 @@ public class TestSharedContextVBOES2NEWT2 extends UITestCase { Assert.assertTrue(NewtTestUtil.waitForRealized(f1, false, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(f1, false, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, false, null)); Assert.assertTrue(NewtTestUtil.waitForRealized(f2, true, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(f2, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, false, null)); Assert.assertTrue(NewtTestUtil.waitForRealized(f3, true, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(f3, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(f3, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f3, false, null)); f1.setVisible(true); // kicks off f1 GLContext .. and hence gears of f2 + f3 completion Assert.assertTrue(NewtTestUtil.waitForRealized(f1, true, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(f1, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, true, null)); Assert.assertTrue("Gears1 not initialized", g1.waitForInit(true)); Assert.assertTrue(NewtTestUtil.waitForRealized(f2, true, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(f2, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, true, null)); Assert.assertTrue("Gears2 not initialized", g2.waitForInit(true)); Assert.assertTrue(NewtTestUtil.waitForRealized(f3, true, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(f3, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(f3, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f3, true, null)); Assert.assertTrue("Gears3 not initialized", g3.waitForInit(true)); final GLContext ctx1 = f1.getContext(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT3.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT3.java index 959dcbf82..bac5784ac 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT3.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT3.java @@ -132,22 +132,22 @@ public class TestSharedContextVBOES2NEWT3 extends UITestCase { Assert.assertTrue(NewtTestUtil.waitForRealized(f1, false, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(f1, false, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, false, null)); Assert.assertTrue(NewtTestUtil.waitForRealized(f2, true, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(f2, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, false, null)); f1.setVisible(true); // kicks off f1 GLContext .. and hence gears of f2 + f3 completion Assert.assertTrue(NewtTestUtil.waitForRealized(f1, true, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(f1, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, true, null)); Assert.assertTrue("Gears1 not initialized", g1.waitForInit(true)); Assert.assertTrue(NewtTestUtil.waitForRealized(f2, true, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(f2, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, true, null)); Assert.assertTrue("Gears2 not initialized", g2.waitForInit(true)); final GearsES2 g3 = new GearsES2(0); @@ -160,7 +160,7 @@ public class TestSharedContextVBOES2NEWT3 extends UITestCase { Assert.assertTrue(NewtTestUtil.waitForRealized(f3, true, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(f3, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(f3, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f3, true, null)); Assert.assertTrue("Gears3 not initialized", g3.waitForInit(true)); final GLContext ctx1 = f1.getContext(); @@ -270,22 +270,22 @@ public class TestSharedContextVBOES2NEWT3 extends UITestCase { Assert.assertTrue(NewtTestUtil.waitForRealized(f1, false, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(f1, false, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, false, null)); Assert.assertTrue(NewtTestUtil.waitForRealized(f2, true, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(f2, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, false, null)); f1.setVisible(true); // test pending creation of f2 Assert.assertTrue(NewtTestUtil.waitForRealized(f1, true, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(f1, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, true, null)); Assert.assertTrue("Gears1 not initialized", g1.waitForInit(true)); Assert.assertTrue(NewtTestUtil.waitForRealized(f2, true, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(f2, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, true, null)); Assert.assertTrue("Gears2 not initialized", g2.waitForInit(true)); final Animator a3 = new Animator(); @@ -300,7 +300,7 @@ public class TestSharedContextVBOES2NEWT3 extends UITestCase { Assert.assertTrue(NewtTestUtil.waitForRealized(f3, true, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(f3, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(f3, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f3, true, null)); Assert.assertTrue("Gears3 not initialized", g3.waitForInit(true)); final GLContext ctx1 = f1.getContext(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT4.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT4.java index 6748f28fa..19d20b978 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT4.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT4.java @@ -135,31 +135,31 @@ public class TestSharedContextVBOES2NEWT4 extends UITestCase { Assert.assertTrue(NewtTestUtil.waitForRealized(f1, false, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(f1, false, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, false, null)); Assert.assertTrue(NewtTestUtil.waitForRealized(f2, true, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(f2, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, false, null)); Assert.assertTrue(NewtTestUtil.waitForRealized(f3, true, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(f3, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(f3, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f3, false, null)); f1.setVisible(true); // kick off f1 GLContext .. and hence allow f2 + f3 creation Assert.assertTrue(NewtTestUtil.waitForRealized(f1, true, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(f1, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, true, null)); Assert.assertTrue("Gears1 not initialized", g1.waitForInit(true)); Assert.assertTrue(NewtTestUtil.waitForRealized(f2, true, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(f2, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, true, null)); Assert.assertTrue("Gears2 not initialized", g2.waitForInit(true)); Assert.assertTrue(NewtTestUtil.waitForRealized(f3, true, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(f3, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(f3, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f3, true, null)); Assert.assertTrue("Gears3 not initialized", g3.waitForInit(true)); Assert.assertFalse("Unexpected exception (animator) caught", gotAnimException.get()); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAnimatorGLJPanel01AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAnimatorGLJPanel01AWT.java index 86f3e345e..bec3fe2ef 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAnimatorGLJPanel01AWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAnimatorGLJPanel01AWT.java @@ -119,17 +119,17 @@ public class TestAnimatorGLJPanel01AWT extends UITestCase { Assert.assertTrue(AWTRobotUtil.waitForRealized(c1, true, null)); Assert.assertTrue(AWTRobotUtil.waitForVisible(c1, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(c1, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c1, true, null)); Assert.assertTrue("Gears1 not initialized", g1.waitForInit(true)); Assert.assertTrue(AWTRobotUtil.waitForRealized(c2, true, null)); Assert.assertTrue(AWTRobotUtil.waitForVisible(c2, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(c2, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c2, true, null)); Assert.assertTrue("Gears2 not initialized", g2.waitForInit(true)); Assert.assertTrue(AWTRobotUtil.waitForRealized(c3, true, null)); Assert.assertTrue(AWTRobotUtil.waitForVisible(c3, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(c3, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c3, true, null)); Assert.assertTrue("Gears3 not initialized", g3.waitForInit(true)); try { @@ -221,17 +221,17 @@ public class TestAnimatorGLJPanel01AWT extends UITestCase { Assert.assertTrue(AWTRobotUtil.waitForRealized(c1, true, null)); Assert.assertTrue(AWTRobotUtil.waitForVisible(c1, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(c1, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c1, true, null)); Assert.assertTrue("Gears1 not initialized", g1.waitForInit(true)); Assert.assertTrue(AWTRobotUtil.waitForRealized(c2, true, null)); Assert.assertTrue(AWTRobotUtil.waitForVisible(c2, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(c2, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c2, true, null)); Assert.assertTrue("Gears2 not initialized", g2.waitForInit(true)); Assert.assertTrue(AWTRobotUtil.waitForRealized(c3, true, null)); Assert.assertTrue(AWTRobotUtil.waitForVisible(c3, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(c3, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c3, true, null)); Assert.assertTrue("Gears3 not initialized", g3.waitForInit(true)); try { diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAnimatorGLWindow01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAnimatorGLWindow01NEWT.java index cb0b0d43d..3eeea1690 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAnimatorGLWindow01NEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAnimatorGLWindow01NEWT.java @@ -111,17 +111,17 @@ public class TestAnimatorGLWindow01NEWT extends UITestCase { Assert.assertTrue(NewtTestUtil.waitForRealized(c1, true, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(c1, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(c1, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c1, true, null)); Assert.assertTrue("Gears1 not initialized", g1.waitForInit(true)); Assert.assertTrue(NewtTestUtil.waitForRealized(c2, true, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(c2, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(c2, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c2, true, null)); Assert.assertTrue("Gears2 not initialized", g2.waitForInit(true)); Assert.assertTrue(NewtTestUtil.waitForRealized(c3, true, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(c3, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(c3, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c3, true, null)); Assert.assertTrue("Gears3 not initialized", g3.waitForInit(true)); try { @@ -194,17 +194,17 @@ public class TestAnimatorGLWindow01NEWT extends UITestCase { Assert.assertTrue(NewtTestUtil.waitForRealized(c1, true, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(c1, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(c1, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c1, true, null)); Assert.assertTrue("Gears1 not initialized", g1.waitForInit(true)); Assert.assertTrue(NewtTestUtil.waitForRealized(c2, true, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(c2, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(c2, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c2, true, null)); Assert.assertTrue("Gears2 not initialized", g2.waitForInit(true)); Assert.assertTrue(NewtTestUtil.waitForRealized(c3, true, null)); Assert.assertTrue(NewtTestUtil.waitForVisible(c3, true, null)); - Assert.assertTrue(GLTestUtil.waitForContextCreated(c3, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c3, true, null)); Assert.assertTrue("Gears3 not initialized", g3.waitForInit(true)); try { diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestGearsNewtAWTWrapper.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestGearsNewtAWTWrapper.java index e29e7cfd9..6b789a152 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestGearsNewtAWTWrapper.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestGearsNewtAWTWrapper.java @@ -96,7 +96,7 @@ public class TestGearsNewtAWTWrapper extends UITestCase { glWindow.display(); final int[] expSurfaceSize = glWindow.getNativeSurface().convertToPixelUnits(new int[] { width/div, height/div }); Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight(), - GLTestUtil.waitForSize(glWindow, expSurfaceSize[0], expSurfaceSize[1])); + GLTestUtil.waitForSize(glWindow, expSurfaceSize[0], expSurfaceSize[1], null)); Thread.sleep(600); div = 2; @@ -106,7 +106,7 @@ public class TestGearsNewtAWTWrapper extends UITestCase { expSurfaceSize[1] = height/div; glWindow.getNativeSurface().convertToPixelUnits(expSurfaceSize); Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight(), - GLTestUtil.waitForSize(glWindow, expSurfaceSize[0], expSurfaceSize[1])); + GLTestUtil.waitForSize(glWindow, expSurfaceSize[0], expSurfaceSize[1], null)); Thread.sleep(600); div = 1; @@ -116,7 +116,7 @@ public class TestGearsNewtAWTWrapper extends UITestCase { expSurfaceSize[1] = height/div; glWindow.getNativeSurface().convertToPixelUnits(expSurfaceSize); Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight(), - GLTestUtil.waitForSize(glWindow, expSurfaceSize[0], expSurfaceSize[1])); + GLTestUtil.waitForSize(glWindow, expSurfaceSize[0], expSurfaceSize[1], null)); Thread.sleep(600); } diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestCloseNewtAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestCloseNewtAWT.java index ac8b3f730..5efc54585 100644 --- a/src/test/com/jogamp/opengl/test/junit/newt/TestCloseNewtAWT.java +++ b/src/test/com/jogamp/opengl/test/junit/newt/TestCloseNewtAWT.java @@ -118,7 +118,7 @@ public class TestCloseNewtAWT extends UITestCase { Assert.assertEquals(true, AWTRobotUtil.waitForRealized(obj, true, null)); final TestUtil.WindowClosingListener closingListener = AWTRobotUtil.addClosingListener(frame); - Assert.assertEquals(true, AWTRobotUtil.closeWindow(frame, true, closingListener)); + Assert.assertEquals(true, AWTRobotUtil.closeWindow(frame, true, closingListener, null)); } public static void main(final String[] args) { diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol01AWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol01AWT.java index f21ef9725..8cf7c500e 100644 --- a/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol01AWT.java +++ b/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol01AWT.java @@ -78,7 +78,7 @@ public class TestWindowClosingProtocol01AWT extends UITestCase { WindowClosingMode op = glCanvas.getDefaultCloseOperation(); Assert.assertEquals(WindowClosingMode.DO_NOTHING_ON_CLOSE, op); - Assert.assertEquals(true, AWTRobotUtil.closeWindow(frame, false, closingListener)); // nop + Assert.assertEquals(true, AWTRobotUtil.closeWindow(frame, false, closingListener, null)); // nop Thread.sleep(100); Assert.assertEquals(true, frame.isDisplayable()); Assert.assertEquals(true, frame.isVisible()); @@ -96,7 +96,7 @@ public class TestWindowClosingProtocol01AWT extends UITestCase { Thread.sleep(300); - Assert.assertEquals(true, AWTRobotUtil.closeWindow(frame, false, closingListener)); // no frame close, but GLCanvas's GL resources will be destroyed + Assert.assertEquals(true, AWTRobotUtil.closeWindow(frame, false, closingListener, null)); // no frame close, but GLCanvas's GL resources will be destroyed Thread.sleep(100); Assert.assertEquals(true, frame.isDisplayable()); Assert.assertEquals(true, frame.isVisible()); @@ -142,7 +142,7 @@ public class TestWindowClosingProtocol01AWT extends UITestCase { Thread.sleep(300); - Assert.assertEquals(true, AWTRobotUtil.closeWindow(frame, false, closingListener)); // hide + Assert.assertEquals(true, AWTRobotUtil.closeWindow(frame, false, closingListener, null)); // hide Assert.assertEquals(true, AWTRobotUtil.waitForVisible(frame, false, null)); // hide -> invisible Assert.assertEquals(true, frame.isDisplayable()); Assert.assertEquals(false, frame.isVisible()); @@ -166,7 +166,7 @@ public class TestWindowClosingProtocol01AWT extends UITestCase { op = glCanvas.getDefaultCloseOperation(); Assert.assertEquals(WindowClosingMode.DISPOSE_ON_CLOSE, op); - Assert.assertEquals(true, AWTRobotUtil.closeWindow(frame, true, closingListener)); + Assert.assertEquals(true, AWTRobotUtil.closeWindow(frame, true, closingListener, null)); Assert.assertEquals(true, AWTRobotUtil.waitForRealized(glCanvas, false, null)); Assert.assertEquals(false, frame.isDisplayable()); Assert.assertEquals(false, glCanvas.isValid()); diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol02NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol02NEWT.java index 313a1dfb9..b7a112c23 100644 --- a/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol02NEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol02NEWT.java @@ -76,7 +76,7 @@ public class TestWindowClosingProtocol02NEWT extends UITestCase { Thread.sleep(300); - Assert.assertEquals(true, AWTRobotUtil.closeWindow(glWindow, false, closingListener)); // nop + Assert.assertEquals(true, AWTRobotUtil.closeWindow(glWindow, false, closingListener, null)); // nop Assert.assertEquals(true, glWindow.isNativeValid()); Assert.assertEquals(true, closingListener.isWindowClosing()); closingListener.reset(); @@ -88,7 +88,7 @@ public class TestWindowClosingProtocol02NEWT extends UITestCase { op = glWindow.getDefaultCloseOperation(); Assert.assertEquals(WindowClosingMode.DISPOSE_ON_CLOSE, op); - Assert.assertEquals(true, AWTRobotUtil.closeWindow(glWindow, true, closingListener)); + Assert.assertEquals(true, AWTRobotUtil.closeWindow(glWindow, true, closingListener, null)); Assert.assertEquals(false, glWindow.isNativeValid()); Assert.assertEquals(true, closingListener.isWindowClosing()); } diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol03NewtAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol03NewtAWT.java index 0c8f42769..7a41f09b7 100644 --- a/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol03NewtAWT.java +++ b/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol03NewtAWT.java @@ -95,7 +95,7 @@ public class TestWindowClosingProtocol03NewtAWT extends UITestCase { Thread.sleep(300); - Assert.assertEquals(true, AWTRobotUtil.closeWindow(frame, false, awtClosingListener)); // hide + Assert.assertEquals(true, AWTRobotUtil.closeWindow(frame, false, awtClosingListener, null)); // hide Assert.assertEquals(true, AWTRobotUtil.waitForVisible(frame, false, null)); // hide -> invisible Assert.assertEquals(true, frame.isDisplayable()); Assert.assertEquals(false, frame.isVisible()); @@ -130,7 +130,7 @@ public class TestWindowClosingProtocol03NewtAWT extends UITestCase { Thread.sleep(300); - Assert.assertEquals(true, AWTRobotUtil.closeWindow(frame, true, awtClosingListener)); + Assert.assertEquals(true, AWTRobotUtil.closeWindow(frame, true, awtClosingListener, null)); Assert.assertEquals(true, AWTRobotUtil.waitForRealized(glWindow, false, null)); Assert.assertEquals(false, frame.isDisplayable()); Assert.assertEquals(false, frame.isVisible()); diff --git a/src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus01SwingAWTRobot.java b/src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus01SwingAWTRobot.java index 95ef55080..27f6a7239 100644 --- a/src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus01SwingAWTRobot.java +++ b/src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus01SwingAWTRobot.java @@ -188,7 +188,7 @@ public class TestParentingFocus01SwingAWTRobot extends UITestCase { // Should be OK to have the AWT component assume it also has the focus. // Assert.assertTrue("Focus prev. gained, but NewtCanvasAWT didn't loose it. Gainer: "+glWindow1FA+"; Looser "+newtCanvasAWTFA, // AWTRobotUtil.waitForFocus(glWindow1FA, newtCanvasAWTFA)); - if( !TestUtil.waitForFocus(glWindow1FA, newtCanvasAWTFA) ) { + if( !TestUtil.waitForFocus(glWindow1FA, newtCanvasAWTFA, null) ) { System.err.println("Info: Focus prev. gained, but NewtCanvasAWT didn't loose it. Gainer: "+glWindow1FA+"; Looser "+newtCanvasAWTFA); } System.err.println("FOCUS NEWT Canvas/GLWindow sync"); diff --git a/src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus02SwingAWTRobot.java b/src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus02SwingAWTRobot.java index d62bb7a45..3e1a78c05 100644 --- a/src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus02SwingAWTRobot.java +++ b/src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus02SwingAWTRobot.java @@ -212,7 +212,7 @@ public class TestParentingFocus02SwingAWTRobot extends UITestCase { // Should be OK to have the AWT component assume it also has the focus. // Assert.assertTrue("Focus prev. gained, but NewtCanvasAWT didn't loose it. Gainer: "+glWindow1FA+"; Looser "+newtCanvasAWTFA, // AWTRobotUtil.waitForFocus(glWindow1FA, newtCanvasAWTFA)); - if( !TestUtil.waitForFocus(glWindow1FA, newtCanvasAWTFA) ) { + if( !TestUtil.waitForFocus(glWindow1FA, newtCanvasAWTFA, null) ) { System.err.println("Info: Focus prev. gained, but NewtCanvasAWT didn't loose it. Gainer: "+glWindow1FA+"; Looser "+newtCanvasAWTFA); } Assert.assertEquals(false, buttonNorthInnerFA.focusGained()); @@ -252,7 +252,7 @@ public class TestParentingFocus02SwingAWTRobot extends UITestCase { // Should be OK to have the AWT component assume it also has the focus. // Assert.assertTrue("Focus prev. gained, but NewtCanvasAWT didn't loose it. Gainer: "+glWindow1FA+"; Looser "+newtCanvasAWTFA, // AWTRobotUtil.waitForFocus(glWindow1FA, newtCanvasAWTFA)); - if( !TestUtil.waitForFocus(glWindow1FA, newtCanvasAWTFA) ) { + if( !TestUtil.waitForFocus(glWindow1FA, newtCanvasAWTFA, null) ) { System.err.println("Info: Focus prev. gained, but NewtCanvasAWT didn't loose it. Gainer: "+glWindow1FA+"; Looser "+newtCanvasAWTFA); } diff --git a/src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus03KeyTraversalAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus03KeyTraversalAWT.java index 952c36080..d35ef1797 100644 --- a/src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus03KeyTraversalAWT.java +++ b/src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus03KeyTraversalAWT.java @@ -236,14 +236,14 @@ public class TestParentingFocus03KeyTraversalAWT extends UITestCase { // bWest -> glWin AWTRobotUtil.keyType(0, robot, java.awt.event.KeyEvent.VK_TAB, cWest, null); - Assert.assertTrue("Did not gain focus", AWTRobotUtil.waitForFocus(glWindow1, glWindow1FA, bWestFA)); + Assert.assertTrue("Did not gain focus", AWTRobotUtil.waitForFocus(glWindow1, glWindow1FA, bWestFA, null)); Assert.assertEquals(true, glWindow1FA.focusGained()); Assert.assertEquals(true, bWestFA.focusLost()); Thread.sleep(durationPerTest/numFocus); // glWin -> bEast AWTRobotUtil.keyType(0, robot, java.awt.event.KeyEvent.VK_TAB, glWindow1, null); - Assert.assertTrue("Did not gain focus", AWTRobotUtil.waitForFocus(cEast, bEastFA, glWindow1FA)); + Assert.assertTrue("Did not gain focus", AWTRobotUtil.waitForFocus(cEast, bEastFA, glWindow1FA, null)); Assert.assertEquals(true, bEastFA.focusGained()); Assert.assertEquals(true, glWindow1FA.focusLost()); Thread.sleep(durationPerTest/numFocus); @@ -253,13 +253,13 @@ public class TestParentingFocus03KeyTraversalAWT extends UITestCase { // // bEast -> glWin AWTRobotUtil.keyType(0, robot, java.awt.event.KeyEvent.VK_BACK_SPACE, cEast, null); - Assert.assertTrue("Did not gain focus", AWTRobotUtil.waitForFocus(glWindow1, glWindow1FA, bEastFA)); + Assert.assertTrue("Did not gain focus", AWTRobotUtil.waitForFocus(glWindow1, glWindow1FA, bEastFA, null)); Assert.assertEquals(true, glWindow1FA.focusGained()); Assert.assertEquals(true, bEastFA.focusLost()); Thread.sleep(durationPerTest/numFocus); AWTRobotUtil.keyType(0, robot, java.awt.event.KeyEvent.VK_BACK_SPACE, glWindow1, null); - Assert.assertTrue("Did not gain focus", AWTRobotUtil.waitForFocus(cWest, bWestFA, glWindow1FA)); + Assert.assertTrue("Did not gain focus", AWTRobotUtil.waitForFocus(cWest, bWestFA, glWindow1FA, null)); Assert.assertEquals(true, bWestFA.focusGained()); Assert.assertEquals(true, glWindow1FA.focusLost()); Thread.sleep(durationPerTest/numFocus); @@ -272,7 +272,7 @@ public class TestParentingFocus03KeyTraversalAWT extends UITestCase { } }); } catch (final Exception ex) { ex.printStackTrace(); } - Assert.assertTrue("Did not gain focus", AWTRobotUtil.waitForFocus(glWindow1, glWindow1FA, bWestFA)); + Assert.assertTrue("Did not gain focus", AWTRobotUtil.waitForFocus(glWindow1, glWindow1FA, bWestFA, null)); Assert.assertEquals(true, glWindow1FA.focusGained()); Assert.assertEquals(true, bWestFA.focusLost()); Thread.sleep(durationPerTest/numFocus); @@ -285,7 +285,7 @@ public class TestParentingFocus03KeyTraversalAWT extends UITestCase { } }); } catch (final Exception ex) { ex.printStackTrace(); } - Assert.assertTrue("Did not gain focus", AWTRobotUtil.waitForFocus(cWest, bWestFA, glWindow1FA)); + Assert.assertTrue("Did not gain focus", AWTRobotUtil.waitForFocus(cWest, bWestFA, glWindow1FA, null)); Assert.assertEquals(true, bWestFA.focusGained()); Assert.assertEquals(true, glWindow1FA.focusLost()); Thread.sleep(durationPerTest/numFocus); @@ -295,7 +295,7 @@ public class TestParentingFocus03KeyTraversalAWT extends UITestCase { { // Short: Assert.assertTrue("Did not gain focus", AWTRobotUtil.waitForFocus(glWindow1, glWindow1FA, bWestFA)); // More verbose: - final boolean ok = AWTRobotUtil.waitForFocus(glWindow1, glWindow1FA, bWestFA); + final boolean ok = AWTRobotUtil.waitForFocus(glWindow1, glWindow1FA, bWestFA, null); System.err.println("glWindow hasFocus "+glWindow1.hasFocus()); System.err.println("glWindow1FA "+glWindow1FA); System.err.println("bWestFA "+bWestFA); 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 a7a5a9791..bb35bd81b 100644 --- a/src/test/com/jogamp/opengl/test/junit/util/AWTRobotUtil.java +++ b/src/test/com/jogamp/opengl/test/junit/util/AWTRobotUtil.java @@ -28,7 +28,6 @@ package com.jogamp.opengl.test.junit.util; -import jogamp.newt.WindowImplAccess; import jogamp.newt.awt.event.AWTNewtEventFactory; import java.lang.Thread.UncaughtExceptionHandler; @@ -42,7 +41,6 @@ import java.awt.Robot; import com.jogamp.nativewindow.NativeWindow; import com.jogamp.nativewindow.NativeWindowFactory; -import com.jogamp.newt.Window; import com.jogamp.opengl.GLAutoDrawable; import org.junit.Assert; @@ -358,37 +356,40 @@ public class AWTRobotUtil extends TestUtil { /** * + * @param waitAction if not null, Runnable shall wait {@link #TIME_SLICE} ms, if appropriate * @return True if the Window became the global focused Window within TIME_OUT */ - public static boolean waitForFocus(final Object obj) throws InterruptedException { - int wait; + public static boolean waitForFocus(final Object obj, final Runnable waitAction) throws InterruptedException { if(obj instanceof com.jogamp.newt.Window) { - final com.jogamp.newt.Window win = (com.jogamp.newt.Window) obj; - for (wait=0; wait<POLL_DIVIDER && !win.hasFocus(); wait++) { - Thread.sleep(TIME_SLICE); - } + return NewtTestUtil.waitForFocus((com.jogamp.newt.Window) obj, waitAction); } else if(NativeWindowFactory.isAWTAvailable() && obj instanceof java.awt.Component) { + int wait; final java.awt.Component comp = (java.awt.Component) obj; final java.awt.KeyboardFocusManager kfm = java.awt.KeyboardFocusManager.getCurrentKeyboardFocusManager(); for (wait=0; wait<POLL_DIVIDER && comp != kfm.getPermanentFocusOwner(); wait++) { - Thread.sleep(TIME_SLICE); + if( null != waitAction ) { + waitAction.run(); + } else { + Thread.sleep(TIME_SLICE); + } } + return wait<POLL_DIVIDER; } else { throw new RuntimeException("Neither AWT nor NEWT: "+obj); } - return wait<POLL_DIVIDER; } /** * + * @param waitAction if not null, Runnable shall wait {@link #TIME_SLICE} ms, if appropriate * @return True if the Window became the global focused Window within TIME_OUT */ public static boolean waitForFocus(final Object obj, final FocusEventCountAdapter gain, - final FocusEventCountAdapter lost) throws InterruptedException { - if(!waitForFocus(obj)) { + final FocusEventCountAdapter lost, final Runnable waitAction) throws InterruptedException { + if(!waitForFocus(obj, waitAction)) { return false; } - return TestUtil.waitForFocus(gain, lost); + return TestUtil.waitForFocus(gain, lost, waitAction); } public static void assertRequestFocusAndWait(final Robot robot, final Object requestFocus, final Object waitForFocus, @@ -400,7 +401,7 @@ public class AWTRobotUtil extends TestUtil { for(i=0; i < RETRY_NUMBER && !hasFocus; i++) { requestFocus(robot, requestFocus); - hasFocus = waitForFocus(waitForFocus, gain, lost); + hasFocus = waitForFocus(waitForFocus, gain, lost, null); } if(!hasFocus) { System.err.print("*** AWTRobotUtil.assertRequestFocusAndWait() "); @@ -734,13 +735,14 @@ public class AWTRobotUtil extends TestUtil { * * @param obj either an AWT Window (Frame, JFrame) or NEWT Window * @param willClose indicating that the window will close, hence this method waits for the window to be closed + * @param waitAction if not null, Runnable shall wait {@link #TIME_SLICE} ms, if appropriate * @param wcl the WindowClosingListener to determine whether the AWT or NEWT widget has been closed. It should be attached * to the widget ASAP before any other listener, e.g. via {@link #addClosingListener(Object)}. * The WindowClosingListener will be reset before attempting to close the widget. * @return True if the Window is closing and closed (if willClose is true), each within TIME_OUT * @throws InterruptedException */ - public static boolean closeWindow(final Object obj, final boolean willClose, final TestUtil.WindowClosingListener closingListener) throws InterruptedException { + public static boolean closeWindow(final Object obj, final boolean willClose, final TestUtil.WindowClosingListener closingListener, final Runnable waitAction) throws InterruptedException { if(obj instanceof java.awt.Window) { closingListener.reset(); final java.awt.Window win = (java.awt.Window) obj; @@ -750,9 +752,9 @@ public class AWTRobotUtil extends TestUtil { public void run() { evtQ.postEvent(new java.awt.event.WindowEvent(win, java.awt.event.WindowEvent.WINDOW_CLOSING)); } }); - return waitUntilClosed(willClose, closingListener); + return waitUntilClosed(willClose, closingListener, waitAction); } else if(obj instanceof com.jogamp.newt.Window) { - return NewtTestUtil.closeWindow((com.jogamp.newt.Window) obj, willClose, closingListener); + return NewtTestUtil.closeWindow((com.jogamp.newt.Window) obj, willClose, closingListener, waitAction); } else { throw new RuntimeException("Neither AWT nor NEWT: "+obj); } diff --git a/src/test/com/jogamp/opengl/test/junit/util/GLTestUtil.java b/src/test/com/jogamp/opengl/test/junit/util/GLTestUtil.java index f9085b98e..792dfa831 100644 --- a/src/test/com/jogamp/opengl/test/junit/util/GLTestUtil.java +++ b/src/test/com/jogamp/opengl/test/junit/util/GLTestUtil.java @@ -36,9 +36,10 @@ import com.jogamp.opengl.GLDrawable; public class GLTestUtil extends TestUtil { /** + * @param waitAction if not null, Runnable shall wait {@link #TIME_SLICE} ms, if appropriate * @return True if the GLContext becomes created or not within TIME_OUT */ - public static boolean waitForContextCreated(final GLAutoDrawable autoDrawable, final boolean created) throws InterruptedException { + public static boolean waitForContextCreated(final GLAutoDrawable autoDrawable, final boolean created, final Runnable waitAction) throws InterruptedException { if( null == autoDrawable ) { return !created; } @@ -54,19 +55,28 @@ public class GLTestUtil extends TestUtil { break; } } - Thread.sleep(TIME_SLICE); + if( null != waitAction ) { + waitAction.run(); + } else { + Thread.sleep(TIME_SLICE); + } } return wait<POLL_DIVIDER; } /** * - * @return True if the GLDrawable receives the expected size within TIME_OUT + * @param waitAction if not null, Runnable shall wait {@link #TIME_SLICE} ms, if appropriate + * @return True if the GLDrawable receives the expected surface size within TIME_OUT */ - public static boolean waitForSize(final GLDrawable drawable, final int width, final int height) throws InterruptedException { + public static boolean waitForSize(final GLDrawable drawable, final int width, final int height, final Runnable waitAction) throws InterruptedException { int wait; for (wait=0; wait<POLL_DIVIDER && ( width != drawable.getSurfaceWidth() || height != drawable.getSurfaceHeight() ) ; wait++) { - Thread.sleep(TIME_SLICE); + if( null != waitAction ) { + waitAction.run(); + } else { + Thread.sleep(TIME_SLICE); + } } return wait<POLL_DIVIDER; } diff --git a/src/test/com/jogamp/opengl/test/junit/util/NewtTestUtil.java b/src/test/com/jogamp/opengl/test/junit/util/NewtTestUtil.java index 003d861a7..295690f8a 100644 --- a/src/test/com/jogamp/opengl/test/junit/util/NewtTestUtil.java +++ b/src/test/com/jogamp/opengl/test/junit/util/NewtTestUtil.java @@ -31,11 +31,9 @@ package com.jogamp.opengl.test.junit.util; import java.util.concurrent.atomic.AtomicInteger; -import com.jogamp.common.util.awt.AWTEDTExecutor; import com.jogamp.newt.Screen; import com.jogamp.newt.Window; import com.jogamp.newt.event.WindowEvent; -import com.jogamp.opengl.test.junit.util.AWTRobotUtil.AWTWindowClosingAdapter; import jogamp.newt.WindowImplAccess; @@ -76,26 +74,49 @@ public class NewtTestUtil extends TestUtil { } /** * + * @param waitAction if not null, Runnable shall wait {@link #TIME_SLICE} ms, if appropriate * @return True if the Window became the global focused Window within TIME_OUT */ - public static boolean waitForFocus(final Window win) throws InterruptedException { + public static boolean waitForFocus(final Window win, final Runnable waitAction) throws InterruptedException { int wait; for (wait=0; wait<POLL_DIVIDER && !win.hasFocus(); wait++) { - Thread.sleep(TIME_SLICE); + if( null != waitAction ) { + waitAction.run(); + } else { + Thread.sleep(TIME_SLICE); + } } return wait<POLL_DIVIDER; } /** * + * @param waitAction if not null, Runnable shall wait {@link #TIME_SLICE} ms, if appropriate * @return True if the Window became the global focused Window within TIME_OUT */ public static boolean waitForFocus(final Window win, final FocusEventCountAdapter gain, - final FocusEventCountAdapter lost) throws InterruptedException { - if(!waitForFocus(win)) { + final FocusEventCountAdapter lost, final Runnable waitAction) throws InterruptedException { + if(!waitForFocus(win, waitAction)) { return false; } - return TestUtil.waitForFocus(gain, lost); + return TestUtil.waitForFocus(gain, lost, waitAction); + } + + /** + * + * @param waitAction if not null, Runnable shall wait {@link #TIME_SLICE} ms, if appropriate + * @return True if the Window receives the expected surface size within TIME_OUT + */ + public static boolean waitForSize(final Window window, final int width, final int height, final Runnable waitAction) throws InterruptedException { + int wait; + for (wait=0; wait<POLL_DIVIDER && ( width != window.getSurfaceWidth() || height != window.getSurfaceHeight() ) ; wait++) { + if( null != waitAction ) { + waitAction.run(); + } else { + Thread.sleep(TIME_SLICE); + } + } + return wait<POLL_DIVIDER; } /** @@ -164,19 +185,20 @@ public class NewtTestUtil extends TestUtil { /** * Programmatically issue windowClosing on AWT or NEWT. * Wait until the window is closing within TIME_OUT. - * - * @param obj either an AWT Window (Frame, JFrame) or NEWT Window * @param willClose indicating that the window will close, hence this method waits for the window to be closed + * @param waitAction if not null, Runnable shall wait {@link #TIME_SLICE} ms, if appropriate + * @param obj either an AWT Window (Frame, JFrame) or NEWT Window * @param wcl the WindowClosingListener to determine whether the AWT or NEWT widget has been closed. It should be attached * to the widget ASAP before any other listener, e.g. via {@link #addClosingListener(Object)}. * The WindowClosingListener will be reset before attempting to close the widget. + * * @return True if the Window is closing and closed (if willClose is true), each within TIME_OUT * @throws InterruptedException */ - public static boolean closeWindow(final Window win, final boolean willClose, final TestUtil.WindowClosingListener closingListener) throws InterruptedException { + public static boolean closeWindow(final Window win, final boolean willClose, final TestUtil.WindowClosingListener closingListener, final Runnable waitAction) throws InterruptedException { closingListener.reset(); WindowImplAccess.windowDestroyNotify(win); - return waitUntilClosed(willClose, closingListener); + return waitUntilClosed(willClose, closingListener, waitAction); } } diff --git a/src/test/com/jogamp/opengl/test/junit/util/TestUtil.java b/src/test/com/jogamp/opengl/test/junit/util/TestUtil.java index c4b95f06c..835fe81a4 100644 --- a/src/test/com/jogamp/opengl/test/junit/util/TestUtil.java +++ b/src/test/com/jogamp/opengl/test/junit/util/TestUtil.java @@ -29,10 +29,6 @@ package com.jogamp.opengl.test.junit.util; -import com.jogamp.newt.Window; - -import jogamp.newt.WindowImplAccess; - public abstract class TestUtil { public static interface WindowClosingListener { void reset(); @@ -48,16 +44,21 @@ public abstract class TestUtil { /** * + * @param waitAction if not null, Runnable shall wait {@link #TIME_SLICE} ms, if appropriate * @return True if the Window became the global focused Window within TIME_OUT */ public static boolean waitForFocus(final FocusEventCountAdapter gain, - final FocusEventCountAdapter lost) throws InterruptedException { + final FocusEventCountAdapter lost, final Runnable waitAction) throws InterruptedException { int wait; for (wait=0; wait<POLL_DIVIDER; wait++) { if( ( null == lost || lost.focusLost() ) && ( null == gain || gain.focusGained() ) ) { return true; } - Thread.sleep(TIME_SLICE); + if( null != waitAction ) { + waitAction.run(); + } else { + Thread.sleep(TIME_SLICE); + } } return false; } @@ -66,20 +67,29 @@ public abstract class TestUtil { * Wait until the window is closing within TIME_OUT. * * @param willClose indicating that the window will close, hence this method waits for the window to be closed + * @param waitAction if not null, Runnable shall wait {@link #TIME_SLICE} ms, if appropriate * @param wcl the WindowClosingListener to determine whether the AWT or NEWT widget has been closed. It should be attached * to the widget ASAP before any other listener, e.g. via {@link #addClosingListener(Object)}. * The WindowClosingListener will be reset before attempting to close the widget. * @return True if the Window is closing and closed (if willClose is true), each within TIME_OUT * @throws InterruptedException */ - public static boolean waitUntilClosed(final boolean willClose, final TestUtil.WindowClosingListener closingListener) throws InterruptedException { + public static boolean waitUntilClosed(final boolean willClose, final TestUtil.WindowClosingListener closingListener, final Runnable waitAction) throws InterruptedException { int wait; for (wait=0; wait<POLL_DIVIDER && !closingListener.isWindowClosing(); wait++) { - Thread.sleep(TIME_SLICE); + if( null != waitAction ) { + waitAction.run(); + } else { + Thread.sleep(TIME_SLICE); + } } if(wait<POLL_DIVIDER && willClose) { for (wait=0; wait<POLL_DIVIDER && !closingListener.isWindowClosed(); wait++) { - Thread.sleep(TIME_SLICE); + if( null != waitAction ) { + waitAction.run(); + } else { + Thread.sleep(TIME_SLICE); + } } } return wait<POLL_DIVIDER; |