aboutsummaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2015-07-24 21:59:51 +0200
committerSven Gothel <[email protected]>2015-07-24 21:59:51 +0200
commitc47dab67985a23040effea36d69356737e40d4e5 (patch)
tree7eddc29ffb355a051a7159377d15fc2ae05b110b /src/test
parentcc3aa4f6e72171162476ee3e858c1949c4b577f2 (diff)
Fix TestBug1146GLContextDialogToolTipAWT / AWTRobotUtil.mouseClick(..) use BUTTON1_MASK instead of BUTTON1_DOWN_MASK
Diffstat (limited to 'src/test')
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestBug1146GLContextDialogToolTipAWT.java9
-rw-r--r--src/test/com/jogamp/opengl/test/junit/util/AWTRobotUtil.java5
2 files changed, 8 insertions, 6 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestBug1146GLContextDialogToolTipAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestBug1146GLContextDialogToolTipAWT.java
index 656cb47bd..42646c07e 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestBug1146GLContextDialogToolTipAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestBug1146GLContextDialogToolTipAWT.java
@@ -139,7 +139,8 @@ public class TestBug1146GLContextDialogToolTipAWT extends UITestCase {
final AbstractButton approveButton = findButton(0, fileChooser, approveButtonText);
if( null != approveButton ) {
approveButtonPos = approveButton.getLocationOnScreen();
- approveButtonPos.translate(2, 2);
+ final Dimension approveButtonSize = approveButton.getSize();
+ approveButtonPos.translate(approveButtonSize.width/2, approveButtonSize.height/2);
System.err.println("OK Button: "+approveButton.getClass().getSimpleName()+"; "+approveButton+", "+approveButtonPos);
} else {
System.err.println("OK Button: NULL");
@@ -149,7 +150,8 @@ public class TestBug1146GLContextDialogToolTipAWT extends UITestCase {
final AbstractButton cancelButton = findButton(0, fileChooser, cancelButtonText);
if( null != approveButton ) {
cancelButtonPos = cancelButton.getLocationOnScreen();
- cancelButtonPos.translate(2, 2);
+ final Dimension cancelButtonSize = cancelButton.getSize();
+ cancelButtonPos.translate(cancelButtonSize.width/2, cancelButtonSize.height/2);
System.err.println("CANCEL Button: "+cancelButton.getClass().getSimpleName()+"; "+cancelButton+", "+cancelButtonPos);
} else {
cancelButtonPos = null;
@@ -219,7 +221,8 @@ public class TestBug1146GLContextDialogToolTipAWT extends UITestCase {
Assert.assertEquals(1, glelc2.initCount);
}
- @Test
+
+ @Test(timeout=180000) // TO 3 min
public void test01() {
final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
for (int i = 0; i < NB_TEST; i++) {
diff --git a/src/test/com/jogamp/opengl/test/junit/util/AWTRobotUtil.java b/src/test/com/jogamp/opengl/test/junit/util/AWTRobotUtil.java
index bdb03ba1d..477b761bd 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/AWTRobotUtil.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/AWTRobotUtil.java
@@ -39,7 +39,6 @@ import java.awt.EventQueue;
import java.awt.MouseInfo;
import java.awt.Point;
import java.awt.Robot;
-import java.awt.event.InputEvent;
import com.jogamp.nativewindow.NativeWindow;
import com.jogamp.nativewindow.NativeWindowFactory;
@@ -596,8 +595,8 @@ public class AWTRobotUtil {
mouseMove(robot, pos, moveIter, moveDelay);
robot.delay(actionDelay);
- robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
- robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
+ robot.mousePress(java.awt.event.InputEvent.BUTTON1_MASK);
+ robot.mouseRelease(java.awt.event.InputEvent.BUTTON1_MASK);
robot.delay(actionDelay);
}