Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8136517: [macosx]Test java/awt/Focus/8073453/AWTFocusTransitionTest.java fails on MacOSX #3624

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -36,7 +36,6 @@
import java.awt.Frame;
import java.awt.GridLayout;
import java.awt.Panel;
import java.awt.Point;
import java.awt.Robot;
import java.awt.TextField;
import java.awt.event.KeyEvent;
@@ -48,30 +47,15 @@
private static TextField textField;
private static Button button;

private static void blockTillDisplayed(Component comp) {
Point p = null;
while (p == null) {
try {
p = comp.getLocationOnScreen();
} catch (IllegalStateException e) {
try {
Thread.sleep(500);
} catch (InterruptedException ie) {
}
}
}
}

public static void main(String[] args) throws Exception {
robot = new Robot();
robot.setAutoDelay(50);
robot.setAutoDelay(100);

try {
createAndShowGUI();

robot.waitForIdle();

blockTillDisplayed(textField);
checkFocusOwner(textField);

robot.keyPress(KeyEvent.VK_TAB);
@@ -123,7 +107,6 @@ private static void createAndShowGUI() {
p.add(panel);

frame.add(p);
frame.setAlwaysOnTop(true);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
@@ -39,7 +39,6 @@
import java.awt.Component;
import java.awt.DefaultFocusTraversalPolicy;
import java.awt.GridLayout;
import java.awt.Point;
import java.awt.Robot;
import java.awt.event.KeyEvent;

@@ -50,23 +49,9 @@
private static JTextField textField;
private static JButton button;

private static void blockTillDisplayed(Component comp) {
Point p = null;
while (p == null) {
try {
p = comp.getLocationOnScreen();
} catch (IllegalStateException e) {
try {
Thread.sleep(500);
} catch (InterruptedException ie) {
}
}
}
}

public static void main(String[] args) throws Exception {
robot = new Robot();
robot.setAutoDelay(50);
robot.setAutoDelay(100);

try {
SwingUtilities.invokeAndWait(new Runnable() {
@@ -78,7 +63,6 @@ public void run() {

robot.waitForIdle();

blockTillDisplayed(textField);
checkFocusOwner(textField);

robot.keyPress(KeyEvent.VK_TAB);
@@ -135,7 +119,6 @@ private static void createAndShowGUI() {
p.add(panel);

frame.add(p);
frame.setAlwaysOnTop(true);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}