diff options
author | Sven Gothel <[email protected]> | 2019-09-16 12:10:23 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2019-09-16 12:10:23 +0200 |
commit | ecc6794670b31d859763eb363ed3ead15d757977 (patch) | |
tree | 6b1fb76ee70dbdc05a475442b854572d8a7ce1d4 | |
parent | fe6600234cafe16afb1d06a0254d2135ffb71b12 (diff) |
Bug 1393: Adding test cases setting visibility before enabling exclusive context thread animator
MacOS Java11 freezes occur on 3rd NEWT window creation (orderFront) after enabling exclusive context thread animator.
Here we add set visibility upfront which does not trigger the freeze on the AppKit main thread.
Note: OpenJDK8 works flawlessly.
For some reason, the exclusive context thread enabled animator interferes when 'orderFront' is issued.
-rw-r--r-- | src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase00.java | 96 |
1 files changed, 78 insertions, 18 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase00.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase00.java index f1219844b..fca967ea4 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase00.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase00.java @@ -99,7 +99,7 @@ public abstract class ExclusiveContextBase00 extends UITestCase { protected abstract void setGLAutoDrawableVisible(GLAutoDrawable[] glads); protected abstract void destroyGLAutoDrawableVisible(GLAutoDrawable glad); - protected void runTestGL(final GLCapabilitiesImmutable caps, final int drawableCount, final boolean exclusive, final boolean preAdd, final boolean shortenTest) throws InterruptedException { + protected void runTestGL(final GLCapabilitiesImmutable caps, final int drawableCount, final boolean exclusive, final boolean preAdd, final boolean preVisible, final boolean shortenTest) throws InterruptedException { final boolean useAWTRenderThread = isAWTTestCase(); if( useAWTRenderThread && exclusive ) { if( testExclusiveWithAWT ) { @@ -129,6 +129,9 @@ public abstract class ExclusiveContextBase00 extends UITestCase { demo.setVerbose(false); drawables[i].addGLEventListener(demo); } + if( preVisible ) { + setGLAutoDrawableVisible(drawables); + } if( preAdd ) { for(int i=0; i<drawableCount; i++) { @@ -183,7 +186,9 @@ public abstract class ExclusiveContextBase00 extends UITestCase { Assert.assertEquals(ect, drawables[i].getExclusiveContextThread()); } } - setGLAutoDrawableVisible(drawables); + if( !preVisible ) { + setGLAutoDrawableVisible(drawables); + } // Made visible, check if drawables are realized { @@ -373,59 +378,114 @@ public abstract class ExclusiveContextBase00 extends UITestCase { } @Test - public void test01NormalPre_1Win() throws InterruptedException { + public void test01NormalPre_1WinPostVis() throws InterruptedException { final GLProfile glp = GLProfile.getGL2ES2(); final GLCapabilities caps = new GLCapabilities( glp ); - runTestGL(caps, 1 /* numWin */, false /* exclusive */, true /* preAdd */, false /* short */); + runTestGL(caps, 1 /* numWin */, false /* exclusive */, true /* preAdd */, false /* preVis */, false /* short */); } @Test - public void test02NormalPost_1Win() throws InterruptedException { + public void test02NormalPost_1WinPostVis() throws InterruptedException { final GLProfile glp = GLProfile.getGL2ES2(); final GLCapabilities caps = new GLCapabilities( glp ); - runTestGL(caps, 1 /* numWin */, false /* exclusive */, false /* preAdd */, true /* short */); + runTestGL(caps, 1 /* numWin */, false /* exclusive */, false /* preAdd */, false /* preVis */, true /* short */); } @Test - public void test03ExclPre_1Win() throws InterruptedException { + public void test03ExclPre_1WinPostVis() throws InterruptedException { final GLProfile glp = GLProfile.getGL2ES2(); final GLCapabilities caps = new GLCapabilities( glp ); - runTestGL(caps, 1 /* numWin */, true /* exclusive */, true /* preAdd */, false /* short */); + runTestGL(caps, 1 /* numWin */, true /* exclusive */, true /* preAdd */, false /* preVis */, false /* short */); } @Test - public void test04ExclPost_1Win() throws InterruptedException { + public void test04ExclPost_1WinPostVis() throws InterruptedException { final GLProfile glp = GLProfile.getGL2ES2(); final GLCapabilities caps = new GLCapabilities( glp ); - runTestGL(caps, 1 /* numWin */, true /* exclusive */, false /* preAdd */, true /* short */); + runTestGL(caps, 1 /* numWin */, true /* exclusive */, false /* preAdd */, false /* preVis */, true /* short */); } @Test - public void test05NormalPre_4Win() throws InterruptedException { + public void test05NormalPre_4WinPostVis() throws InterruptedException { final GLProfile glp = GLProfile.getGL2ES2(); final GLCapabilities caps = new GLCapabilities( glp ); - runTestGL(caps, 4 /* numWin */, false /* exclusive */, true /* preAdd */, false /* short */); + runTestGL(caps, 4 /* numWin */, false /* exclusive */, true /* preAdd */, false /* preVis */, false /* short */); } @Test - public void test06NormalPost_4Win() throws InterruptedException { + public void test06NormalPost_4WinPostVis() throws InterruptedException { final GLProfile glp = GLProfile.getGL2ES2(); final GLCapabilities caps = new GLCapabilities( glp ); - runTestGL(caps, 4 /* numWin */, false /* exclusive */, false /* preAdd */, true /* short */); + runTestGL(caps, 4 /* numWin */, false /* exclusive */, false /* preAdd */, false /* preVis */, true /* short */); } @Test - public void test07ExclPre_4Win() throws InterruptedException { + public void test07ExclPre_4WinPostVis() throws InterruptedException { final GLProfile glp = GLProfile.getGL2ES2(); final GLCapabilities caps = new GLCapabilities( glp ); - runTestGL(caps, 4 /* numWin */, true /* exclusive */, true /* preAdd */, false /* short */); + runTestGL(caps, 4 /* numWin */, true /* exclusive */, true /* preAdd */, false /* preVis */, false /* short */); } @Test - public void test08ExclPost_4Win() throws InterruptedException { + public void test08ExclPost_4WinPostVis() throws InterruptedException { final GLProfile glp = GLProfile.getGL2ES2(); final GLCapabilities caps = new GLCapabilities( glp ); - runTestGL(caps, 4 /* numWin */, true /* exclusive */, false /* preAdd */, true /* short */); + runTestGL(caps, 4 /* numWin */, true /* exclusive */, false /* preAdd */, false /* preVis */, true /* short */); } + @Test + public void test11NormalPre_1WinPreVis() throws InterruptedException { + final GLProfile glp = GLProfile.getGL2ES2(); + final GLCapabilities caps = new GLCapabilities( glp ); + runTestGL(caps, 1 /* numWin */, false /* exclusive */, true /* preAdd */, true /* preVis */, false /* short */); + } + + @Test + public void test12NormalPost_1WinPreVis() throws InterruptedException { + final GLProfile glp = GLProfile.getGL2ES2(); + final GLCapabilities caps = new GLCapabilities( glp ); + runTestGL(caps, 1 /* numWin */, false /* exclusive */, false /* preAdd */, true /* preVis */, true /* short */); + } + + @Test + public void test13ExclPre_1WinPreVis() throws InterruptedException { + final GLProfile glp = GLProfile.getGL2ES2(); + final GLCapabilities caps = new GLCapabilities( glp ); + runTestGL(caps, 1 /* numWin */, true /* exclusive */, true /* preAdd */, true /* preVis */, false /* short */); + } + + @Test + public void test14ExclPost_1WinPreVis() throws InterruptedException { + final GLProfile glp = GLProfile.getGL2ES2(); + final GLCapabilities caps = new GLCapabilities( glp ); + runTestGL(caps, 1 /* numWin */, true /* exclusive */, false /* preAdd */, true /* preVis */, true /* short */); + } + + @Test + public void test15NormalPre_4WinPreVis() throws InterruptedException { + final GLProfile glp = GLProfile.getGL2ES2(); + final GLCapabilities caps = new GLCapabilities( glp ); + runTestGL(caps, 4 /* numWin */, false /* exclusive */, true /* preAdd */, true /* preVis */, false /* short */); + } + + @Test + public void test16NormalPost_4WinPreVis() throws InterruptedException { + final GLProfile glp = GLProfile.getGL2ES2(); + final GLCapabilities caps = new GLCapabilities( glp ); + runTestGL(caps, 4 /* numWin */, false /* exclusive */, false /* preAdd */, true /* preVis */, true /* short */); + } + + @Test + public void test17ExclPre_4WinPreVis() throws InterruptedException { + final GLProfile glp = GLProfile.getGL2ES2(); + final GLCapabilities caps = new GLCapabilities( glp ); + runTestGL(caps, 4 /* numWin */, true /* exclusive */, true /* preAdd */, true /* preVis */, false /* short */); + } + + @Test + public void test18ExclPost_4WinPreVis() throws InterruptedException { + final GLProfile glp = GLProfile.getGL2ES2(); + final GLCapabilities caps = new GLCapabilities( glp ); + runTestGL(caps, 4 /* numWin */, true /* exclusive */, false /* preAdd */, true /* preVis */, true /* short */); + } } |