diff options
Diffstat (limited to 'src/test/com')
-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()); |