diff options
author | Sven Gothel <[email protected]> | 2013-07-04 19:40:03 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-07-04 19:40:03 +0200 |
commit | 3981d4c6a7b038a3260de22b6a7a032ba3df0f2c (patch) | |
tree | ca5b873bfceff83e04df79c0b2a97c5574771fac /src/test/com | |
parent | 9d2946e60b1c44bb6ac5de8b6b37a630db3ac78f (diff) |
TestScreenMode*: At destruction, properly wait until Window and Screen (after mode change) has been destroyed - avoiding conflicts w/ other tests (off thread destruction)
Diffstat (limited to 'src/test/com')
6 files changed, 30 insertions, 14 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01aNEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01aNEWT.java index d756957d7..41d110759 100644 --- a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01aNEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01aNEWT.java @@ -96,9 +96,10 @@ public class TestScreenMode01aNEWT extends UITestCase { return window; } - static void destroyWindow(Window window) { + static void destroyWindow(Window window) throws InterruptedException { if(null!=window) { window.destroy(); + Assert.assertTrue(AWTRobotUtil.waitForRealized(window, false)); } } @@ -185,7 +186,6 @@ public class TestScreenMode01aNEWT extends UITestCase { // Auto reset by destruction! destroyWindow(window0); - Assert.assertTrue(AWTRobotUtil.waitForRealized(window0, false)); Assert.assertEquals(false,window0.isVisible()); Assert.assertEquals(false,window0.isNativeValid()); diff --git a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01bNEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01bNEWT.java index 2d70b42bb..8ebcf320c 100644 --- a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01bNEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01bNEWT.java @@ -93,9 +93,10 @@ public class TestScreenMode01bNEWT extends UITestCase { return window; } - static void destroyWindow(Window window) { + static void destroyWindow(Window window) throws InterruptedException { if(null!=window) { window.destroy(); + Assert.assertTrue(AWTRobotUtil.waitForRealized(window, false)); } } @@ -111,6 +112,7 @@ public class TestScreenMode01bNEWT extends UITestCase { testScreenModeChangeImpl(screen, monitorVp.getX(), monitorVp.getY()); } finally { screen.removeReference(); + Assert.assertTrue(AWTRobotUtil.waitForRealized(screen, false)); } } @@ -130,6 +132,7 @@ public class TestScreenMode01bNEWT extends UITestCase { testScreenModeChangeImpl(screen, monitorVp.getX(), monitorVp.getY()); } finally { screen.removeReference(); + Assert.assertTrue(AWTRobotUtil.waitForRealized(screen, false)); } } @@ -240,7 +243,6 @@ public class TestScreenMode01bNEWT extends UITestCase { Thread.sleep(duration); anim.stop(); destroyWindow(window0); - Assert.assertTrue(AWTRobotUtil.waitForRealized(window0, false)); Assert.assertEquals(false,window0.isVisible()); Assert.assertEquals(false,window0.isNativeValid()); diff --git a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01cNEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01cNEWT.java index ee4d3dde1..07f9dc0ab 100644 --- a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01cNEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01cNEWT.java @@ -45,6 +45,7 @@ import com.jogamp.newt.Window; import com.jogamp.newt.MonitorMode; import com.jogamp.newt.opengl.GLWindow; import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2; +import com.jogamp.opengl.test.junit.util.AWTRobotUtil; import com.jogamp.opengl.test.junit.util.MiscUtils; import com.jogamp.opengl.test.junit.util.UITestCase; import com.jogamp.opengl.util.Animator; @@ -92,9 +93,10 @@ public class TestScreenMode01cNEWT extends UITestCase { return window; } - static void destroyWindow(Window window) { + static void destroyWindow(Window window) throws InterruptedException { if(null!=window) { window.destroy(); + Assert.assertTrue(AWTRobotUtil.waitForRealized(window, false)); } } @@ -110,6 +112,7 @@ public class TestScreenMode01cNEWT extends UITestCase { testScreenFullscreenImpl(screen, monitorVp.getX(), monitorVp.getY(), false, null); } finally { screen.removeReference(); + Assert.assertTrue(AWTRobotUtil.waitForRealized(screen, false)); } } @@ -129,6 +132,7 @@ public class TestScreenMode01cNEWT extends UITestCase { testScreenFullscreenImpl(screen, monitorVp.getX(), monitorVp.getY(), false, null); } finally { screen.removeReference(); + Assert.assertTrue(AWTRobotUtil.waitForRealized(screen, false)); } } @@ -152,6 +156,7 @@ public class TestScreenMode01cNEWT extends UITestCase { testScreenFullscreenImpl(screen, monitorVp.getX()+50, monitorVp.getY()+50, true, monitors); } finally { screen.removeReference(); + Assert.assertTrue(AWTRobotUtil.waitForRealized(screen, false)); } } @@ -171,6 +176,7 @@ public class TestScreenMode01cNEWT extends UITestCase { testScreenFullscreenImpl(screen, monitorVp.getX()-50, monitorVp.getY()+50, true, null); } finally { screen.removeReference(); + Assert.assertTrue(AWTRobotUtil.waitForRealized(screen, false)); } } diff --git a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01dNEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01dNEWT.java index 31829135b..14fe7b5d5 100644 --- a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01dNEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01dNEWT.java @@ -136,9 +136,10 @@ public class TestScreenMode01dNEWT extends UITestCase { return window; } - static void destroyWindow(Window window) { + static void destroyWindow(Window window) throws InterruptedException { if(null!=window) { window.destroy(); + Assert.assertTrue(AWTRobotUtil.waitForRealized(window, false)); } } @@ -181,9 +182,13 @@ public class TestScreenMode01dNEWT extends UITestCase { Assert.assertEquals(false, animator.isStarted()); destroyWindow(window); - Assert.assertTrue(AWTRobotUtil.waitForRealized(window, false)); - Assert.assertEquals(false, window.isRealized()); - Assert.assertEquals(false, window.isNativeValid()); + + Assert.assertEquals(false,window.isVisible()); + Assert.assertEquals(false,window.isRealized()); + Assert.assertEquals(false,window.isNativeValid()); + Assert.assertTrue(AWTRobotUtil.waitForRealized(screen, false)); + Assert.assertEquals(false,screen.isNativeValid()); + Assert.assertEquals(false,display.isNativeValid()); cleanupGL(); } @@ -267,7 +272,6 @@ public class TestScreenMode01dNEWT extends UITestCase { Assert.assertEquals(false, animator.isStarted()); destroyWindow(window); - Assert.assertTrue(AWTRobotUtil.waitForRealized(window, false)); Assert.assertEquals(false,window.isVisible()); Assert.assertEquals(false,window.isRealized()); @@ -375,7 +379,6 @@ public class TestScreenMode01dNEWT extends UITestCase { Assert.assertEquals(false, animator.isStarted()); destroyWindow(window); - Assert.assertTrue(AWTRobotUtil.waitForRealized(window, false)); Assert.assertEquals(false,window.isVisible()); Assert.assertEquals(false,window.isRealized()); diff --git a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode02aNEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode02aNEWT.java index ceb732fda..15cc87ca7 100644 --- a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode02aNEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode02aNEWT.java @@ -85,9 +85,10 @@ public class TestScreenMode02aNEWT extends UITestCase { return window; } - static void destroyWindow(Window window) { + static void destroyWindow(Window window) throws InterruptedException { if(null!=window) { window.destroy(); + Assert.assertTrue(AWTRobotUtil.waitForRealized(window, false)); } } @@ -230,7 +231,7 @@ public class TestScreenMode02aNEWT extends UITestCase { animator.stop(); destroyWindow(window); - + Assert.assertEquals(false,window.isVisible()); Assert.assertEquals(false,window.isNativeValid()); Assert.assertTrue(AWTRobotUtil.waitForRealized(screen, false)); diff --git a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode02bNEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode02bNEWT.java index f2098ab7a..7f4a8683f 100644 --- a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode02bNEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode02bNEWT.java @@ -47,6 +47,7 @@ import com.jogamp.newt.MonitorMode; import com.jogamp.newt.opengl.GLWindow; import com.jogamp.newt.util.MonitorModeUtil; import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2; +import com.jogamp.opengl.test.junit.util.AWTRobotUtil; import com.jogamp.opengl.test.junit.util.UITestCase; import com.jogamp.opengl.util.Animator; @@ -98,9 +99,10 @@ public class TestScreenMode02bNEWT extends UITestCase { return window; } - static void destroyWindow(Window window) { + static void destroyWindow(Window window) throws InterruptedException { if(null!=window) { window.destroy(); + Assert.assertTrue(AWTRobotUtil.waitForRealized(window, false)); } } @@ -195,6 +197,7 @@ public class TestScreenMode02bNEWT extends UITestCase { if( !smOk ) { System.err.println("ERROR: Full MonitorMode w/ rotation failure - Expected on some platforms (NV driver) - Tolerated for now."); destroyWindow(window); + Assert.assertTrue(AWTRobotUtil.waitForRealized(screen, false)); return; } Assert.assertTrue(monitor.isModeChangedByUs()); @@ -241,6 +244,7 @@ public class TestScreenMode02bNEWT extends UITestCase { Assert.assertEquals(false,window.isVisible()); Assert.assertEquals(false,window.isNativeValid()); + Assert.assertTrue(AWTRobotUtil.waitForRealized(screen, false)); Assert.assertEquals(false,screen.isNativeValid()); Assert.assertEquals(false,display.isNativeValid()); } |