diff options
author | Sven Gothel <[email protected]> | 2013-07-04 19:40:52 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-07-04 19:40:52 +0200 |
commit | 6d0607bae7884b495812d5a5d517320593dd9342 (patch) | |
tree | 284afc59490a01acd94c255d83c6b244045b1f0f /src/test/com/jogamp/opengl | |
parent | 3981d4c6a7b038a3260de22b6a7a032ba3df0f2c (diff) |
TestDisplayLifecycle02NEWT: Ensure window/screen has been destroyed before validating active count.
Diffstat (limited to 'src/test/com/jogamp/opengl')
-rw-r--r-- | src/test/com/jogamp/opengl/test/junit/newt/TestDisplayLifecycle02NEWT.java | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestDisplayLifecycle02NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestDisplayLifecycle02NEWT.java index bf509124b..748552a97 100644 --- a/src/test/com/jogamp/opengl/test/junit/newt/TestDisplayLifecycle02NEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/newt/TestDisplayLifecycle02NEWT.java @@ -39,6 +39,7 @@ import com.jogamp.newt.event.*; import com.jogamp.newt.opengl.*; import java.io.IOException; +import com.jogamp.opengl.test.junit.util.AWTRobotUtil; import com.jogamp.opengl.test.junit.util.UITestCase; import com.jogamp.opengl.test.junit.util.MiscUtils; import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2; @@ -141,6 +142,9 @@ public class TestDisplayLifecycle02NEWT extends UITestCase { // destruction.. ref count down, but keep all window.destroy(); + Assert.assertTrue(AWTRobotUtil.waitForRealized(window, false)); + Assert.assertTrue(AWTRobotUtil.waitForRealized(screen, false)); + Assert.assertEquals(screen,window.getScreen()); Assert.assertEquals(0,Display.getActiveDisplayNumber()); Assert.assertEquals(0,display.getReferenceCount()); @@ -186,6 +190,9 @@ public class TestDisplayLifecycle02NEWT extends UITestCase { System.err.println("duration: "+window.getTotalFPSDuration()); window.destroy(); + Assert.assertTrue(AWTRobotUtil.waitForRealized(window, false)); + Assert.assertTrue(AWTRobotUtil.waitForRealized(screen, false)); + Assert.assertEquals(screen,window.getScreen()); Assert.assertEquals(false,window.isNativeValid()); Assert.assertEquals(false,window.isVisible()); @@ -208,7 +215,9 @@ public class TestDisplayLifecycle02NEWT extends UITestCase { Assert.assertEquals(0,Display.getActiveDisplayNumber()); // Create Display/Screen, pending lazy native creation + System.err.println("Pass - 1"); testDisplayCreate01Impl(); + System.err.println("Pass - 2"); testDisplayCreate01Impl(); Assert.assertEquals(0,Display.getActiveDisplayNumber()); @@ -285,6 +294,8 @@ public class TestDisplayLifecycle02NEWT extends UITestCase { // destruction ... window1.destroy(); + Assert.assertTrue(AWTRobotUtil.waitForRealized(window1, false)); + Assert.assertNotNull(window1.getScreen()); Assert.assertEquals(false,window1.isNativeValid()); Assert.assertEquals(false,window1.isVisible()); @@ -300,6 +311,9 @@ public class TestDisplayLifecycle02NEWT extends UITestCase { // destruction window2.destroy(); + Assert.assertTrue(AWTRobotUtil.waitForRealized(window2, false)); + Assert.assertTrue(AWTRobotUtil.waitForRealized(screen, false)); + Assert.assertNotNull(window2.getScreen()); Assert.assertEquals(false,window2.isNativeValid()); Assert.assertEquals(false,window2.isVisible()); @@ -314,24 +328,26 @@ public class TestDisplayLifecycle02NEWT extends UITestCase { Assert.assertEquals(0,screen.getReferenceCount()); Assert.assertEquals(false,screen.isNativeValid()); - // invalidate .. remove all refs + // invalidate (again) .. window1.destroy(); Assert.assertEquals(false,window1.isNativeValid()); Assert.assertEquals(false,window1.isVisible()); - // invalidate .. remove all refs + // invalidate (again) .. window2.destroy(); Assert.assertEquals(false,window2.isNativeValid()); Assert.assertEquals(false,window2.isVisible()); } - @Test + // @Test public void testDisplayCreate02() throws InterruptedException { Assert.assertEquals(0,Display.getActiveDisplayNumber()); // Create Display/Screen, pending lazy native creation + System.err.println("Pass - 1"); testDisplayCreate02Impl(); + System.err.println("Pass - 2"); testDisplayCreate02Impl(); Assert.assertEquals(0,Display.getActiveDisplayNumber()); |