aboutsummaryrefslogtreecommitdiffstats
path: root/src/junit/com
diff options
context:
space:
mode:
Diffstat (limited to 'src/junit/com')
-rw-r--r--src/junit/com/jogamp/test/junit/jogl/awt/TestSwingAWTRobotUsageBeforeJOGLInitBug411.java25
-rw-r--r--src/junit/com/jogamp/test/junit/newt/TestGLWindows01NEWT.java3
-rw-r--r--src/junit/com/jogamp/test/junit/newt/TestGLWindows02NEWTAnimated.java4
3 files changed, 20 insertions, 12 deletions
diff --git a/src/junit/com/jogamp/test/junit/jogl/awt/TestSwingAWTRobotUsageBeforeJOGLInitBug411.java b/src/junit/com/jogamp/test/junit/jogl/awt/TestSwingAWTRobotUsageBeforeJOGLInitBug411.java
index e77f4f8b0..fd1a15e52 100644
--- a/src/junit/com/jogamp/test/junit/jogl/awt/TestSwingAWTRobotUsageBeforeJOGLInitBug411.java
+++ b/src/junit/com/jogamp/test/junit/jogl/awt/TestSwingAWTRobotUsageBeforeJOGLInitBug411.java
@@ -146,6 +146,7 @@ public class TestSwingAWTRobotUsageBeforeJOGLInitBug411 extends UITestCase {
});
frame.setContentPane(panel);
frame.setSize(512, 512);
+ frame.setLocation(0, 0);
frame.pack();
frame.setVisible(true);
@@ -216,9 +217,6 @@ public class TestSwingAWTRobotUsageBeforeJOGLInitBug411 extends UITestCase {
colorPanel.setBackground(Color.blue);
drawable.addGLEventListener(new SwingGLAction());
- Animator animator = new Animator(drawable);
- animator.start();
-
Point p0 = canvas.getLocationOnScreen();
Rectangle r0 = canvas.getBounds();
robot.mouseMove( (int) ( p0.getX() + .5 ) ,
@@ -243,7 +241,6 @@ public class TestSwingAWTRobotUsageBeforeJOGLInitBug411 extends UITestCase {
frame.pack();
}
});
- Assert.assertEquals(false, animator.isAnimating());
}
@Test
@@ -257,19 +254,22 @@ public class TestSwingAWTRobotUsageBeforeJOGLInitBug411 extends UITestCase {
win0.setSize(100,100);
win0.setVisible(true);
Screen screen = win0.getScreen();
- win0.setPosition(screen.getWidth()-150, screen.getHeight()-150);
+ win0.setPosition(screen.getWidth()-150, 0);
win0.addGLEventListener(new Gears());
Animator anim0 = new Animator(win0);
anim0.start();
- NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(GLWindow.create(caps));
-
- runTestGL(newtCanvasAWT, (GLAutoDrawable)newtCanvasAWT.getNEWTChild());
+ GLWindow win1 = GLWindow.create(caps);
+ NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(win1);
+ Animator anim1 = new Animator(win1);
+ anim1.start();
+ runTestGL(newtCanvasAWT, win1);
win0.destroy(true);
Assert.assertEquals(false, anim0.isAnimating());
newtCanvasAWT.destroy(true);
+ Assert.assertEquals(false, anim1.isAnimating());
System.err.println("TestSwingAWTRobotUsageBeforeJOGLInitBug411.test01NewtCanvasAWT(): End");
}
@@ -284,17 +284,22 @@ public class TestSwingAWTRobotUsageBeforeJOGLInitBug411 extends UITestCase {
win0.setSize(100,100);
win0.setVisible(true);
Screen screen = win0.getScreen();
- win0.setPosition(screen.getWidth()-150, screen.getHeight()-150);
+ win0.setPosition(screen.getWidth()-150, 0);
win0.addGLEventListener(new Gears());
Animator anim0 = new Animator(win0);
anim0.start();
GLCanvas glCanvas = new GLCanvas(caps);
-
+ Animator anim1 = new Animator(glCanvas);
+ anim1.start();
runTestGL(glCanvas, glCanvas);
+ Thread.sleep(100); // wait 1/10Hz to allow animation to be paused
+ Assert.assertEquals(false, anim1.isAnimating());
+
win0.destroy(true);
Assert.assertEquals(false, anim0.isAnimating());
+
System.err.println("TestSwingAWTRobotUsageBeforeJOGLInitBug411.test02GLCanvas(): End");
}
diff --git a/src/junit/com/jogamp/test/junit/newt/TestGLWindows01NEWT.java b/src/junit/com/jogamp/test/junit/newt/TestGLWindows01NEWT.java
index f136b2a3c..7c06879b2 100644
--- a/src/junit/com/jogamp/test/junit/newt/TestGLWindows01NEWT.java
+++ b/src/junit/com/jogamp/test/junit/newt/TestGLWindows01NEWT.java
@@ -266,8 +266,7 @@ public class TestGLWindows01NEWT extends UITestCase {
Assert.assertNotNull(window2);
Assert.assertEquals(1,Display.getActiveDisplayNumber());
-
- Assert.assertEquals(2,display.getReferenceCount());
+ Assert.assertEquals(1,display.getReferenceCount());
Assert.assertEquals(true,display.isNativeValid());
Assert.assertNotNull(display.getEDTUtil());
Assert.assertEquals(true,display.getEDTUtil().isRunning());
diff --git a/src/junit/com/jogamp/test/junit/newt/TestGLWindows02NEWTAnimated.java b/src/junit/com/jogamp/test/junit/newt/TestGLWindows02NEWTAnimated.java
index 12cc7875a..56730d42f 100644
--- a/src/junit/com/jogamp/test/junit/newt/TestGLWindows02NEWTAnimated.java
+++ b/src/junit/com/jogamp/test/junit/newt/TestGLWindows02NEWTAnimated.java
@@ -161,9 +161,11 @@ public class TestGLWindows02NEWTAnimated extends UITestCase {
Assert.assertNotNull(screen);
GLWindow window1 = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */);
Assert.assertNotNull(window1);
+ window1.setPosition(0, 0);
GLWindow window2 = createWindow(screen, caps, width-10, height-10, true /* onscreen */, false /* undecorated */);
Assert.assertNotNull(window2);
+ window2.setPosition(screen.getWidth()-width, 0);
Animator animator1 = new Animator(window1);
animator1.start();
@@ -194,11 +196,13 @@ public class TestGLWindows02NEWTAnimated extends UITestCase {
Assert.assertNotNull(screen1);
GLWindow window1 = createWindow(screen1, caps, width, height, true /* onscreen */, false /* undecorated */);
Assert.assertNotNull(window1);
+ window1.setPosition(0, 0);
Screen screen2 = NewtFactory.createScreen(display2, 0); // screen 0
Assert.assertNotNull(screen2);
GLWindow window2 = createWindow(screen2, caps, width-10, height-10, true /* onscreen */, false /* undecorated */);
Assert.assertNotNull(window2);
+ window2.setPosition(screen2.getWidth()-width, 0);
Animator animator1 = new Animator(window1);
animator1.start();