aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xmake/scripts/tests.sh5
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol01AWT.java10
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol02NEWT.java2
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol03NewtAWT.java4
4 files changed, 17 insertions, 4 deletions
diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh
index ecfdc6fa9..400f3f023 100755
--- a/make/scripts/tests.sh
+++ b/make/scripts/tests.sh
@@ -344,7 +344,6 @@ function testawtswt() {
#testnoawt com.jogamp.opengl.test.junit.newt.TestScreenMode01bNEWT
#testnoawt com.jogamp.opengl.test.junit.newt.TestScreenMode02NEWT
#testnoawt com.jogamp.opengl.test.junit.newt.ManualScreenMode03NEWT
-#testnoawt com.jogamp.opengl.test.junit.newt.TestWindowClosingProtocol02NEWT $*
#testnoawt -Djava.awt.headless=true com.jogamp.opengl.test.junit.newt.TestGLWindows01NEWT
#
@@ -370,7 +369,7 @@ function testawtswt() {
#testawt com.jogamp.opengl.test.junit.jogl.awt.TestAWT02WindowClosing
#testawt com.jogamp.opengl.test.junit.jogl.awt.TestJScrollPaneMixHwLw01AWT $*
#testawt com.jogamp.opengl.test.junit.jogl.awt.TestBug642JSplitPaneMixHwLw01AWT $*
-testawt com.jogamp.opengl.test.junit.jogl.awt.TestBug664GLCanvasSetVisibleSwingAWT $*
+#testawt com.jogamp.opengl.test.junit.jogl.awt.TestBug664GLCanvasSetVisibleSwingAWT $*
#testawt com.jogamp.opengl.test.junit.jogl.awt.TestIsRealizedConcurrency01AWT $*
#testawt com.jogamp.opengl.test.junit.jogl.awt.text.TestAWTTextRendererUseVertexArrayBug464
#testawt com.jogamp.opengl.test.junit.jogl.demos.gl2.awt.TestGearsAWT $*
@@ -435,7 +434,7 @@ testawt com.jogamp.opengl.test.junit.jogl.awt.TestBug664GLCanvasSetVisibleSwingA
#testnoawt com.jogamp.opengl.test.junit.jogl.caps.TestBug605FlippedImageAWT $*
#testawt com.jogamp.opengl.test.junit.jogl.glsl.TestShaderCompilationBug459AWT
-#testawt com.jogamp.opengl.test.junit.newt.TestWindowClosingProtocol01AWT $*
+testawt com.jogamp.opengl.test.junit.newt.TestWindowClosingProtocol01AWT $*
#testnoawt com.jogamp.opengl.test.junit.newt.TestWindowClosingProtocol02NEWT $*
#testawt com.jogamp.opengl.test.junit.newt.TestWindowClosingProtocol03NewtAWT $*
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 3a923d435..6aedb8433 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol01AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol01AWT.java
@@ -87,10 +87,16 @@ public class TestWindowClosingProtocol01AWT extends UITestCase {
glCanvas.setDefaultCloseOperation(WindowClosingMode.DISPOSE_ON_CLOSE);
op = glCanvas.getDefaultCloseOperation();
Assert.assertEquals(WindowClosingMode.DISPOSE_ON_CLOSE, op);
+
+ Thread.sleep(300);
- Assert.assertEquals(true, AWTRobotUtil.closeWindow(frame, false)); // no frame close
+ Assert.assertEquals(true, AWTRobotUtil.closeWindow(frame, false)); // no frame close, but GLCanvas's GL resources will be destroyed
+ Thread.sleep(100);
Assert.assertEquals(true, frame.isDisplayable());
Assert.assertEquals(true, frame.isVisible());
+ for (int wait=0; wait<AWTRobotUtil.POLL_DIVIDER && glCanvas.isRealized(); wait++) {
+ Thread.sleep(AWTRobotUtil.TIME_SLICE);
+ }
Assert.assertEquals(false, glCanvas.isRealized());
SwingUtilities.invokeAndWait(new Runnable() {
@@ -125,6 +131,8 @@ public class TestWindowClosingProtocol01AWT extends UITestCase {
WindowClosingMode op = glCanvas.getDefaultCloseOperation();
Assert.assertEquals(WindowClosingMode.DO_NOTHING_ON_CLOSE, op);
+ Thread.sleep(300);
+
Assert.assertEquals(true, AWTRobotUtil.closeWindow(frame, false)); // nop
Thread.sleep(100);
Assert.assertEquals(true, frame.isDisplayable());
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 1657fcbe9..8cd44b82c 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol02NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol02NEWT.java
@@ -69,6 +69,8 @@ public class TestWindowClosingProtocol02NEWT extends UITestCase {
glWindow.setDefaultCloseOperation(WindowClosingMode.DO_NOTHING_ON_CLOSE);
op = glWindow.getDefaultCloseOperation();
Assert.assertEquals(WindowClosingMode.DO_NOTHING_ON_CLOSE, op);
+
+ Thread.sleep(300);
Assert.assertEquals(true, AWTRobotUtil.closeWindow(glWindow, false)); // nop
Assert.assertEquals(true, glWindow.isNativeValid());
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 65068e9e8..be3c48fb6 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol03NewtAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol03NewtAWT.java
@@ -85,6 +85,8 @@ public class TestWindowClosingProtocol03NewtAWT extends UITestCase {
WindowClosingMode op = newtCanvas.getDefaultCloseOperation();
Assert.assertEquals(WindowClosingMode.DO_NOTHING_ON_CLOSE, op);
+ Thread.sleep(300);
+
Assert.assertEquals(true, AWTRobotUtil.closeWindow(frame, false));
Assert.assertEquals(true, frame.isDisplayable());
Assert.assertEquals(false, frame.isVisible());
@@ -109,6 +111,8 @@ public class TestWindowClosingProtocol03NewtAWT extends UITestCase {
Assert.assertEquals(JFrame.DISPOSE_ON_CLOSE, frame.getDefaultCloseOperation());
op = newtCanvas.getDefaultCloseOperation();
Assert.assertEquals(WindowClosingMode.DISPOSE_ON_CLOSE, op);
+
+ Thread.sleep(300);
Assert.assertEquals(true, AWTRobotUtil.closeWindow(frame, true));
Assert.assertEquals(false, frame.isDisplayable());