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 all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -199,8 +199,6 @@ java/awt/Focus/8013611/JDK8013611.java 8175366 windows-all,macosx-all
java/awt/Focus/6378278/InputVerifierTest.java 8198616 macosx-all
java/awt/Focus/6382144/EndlessLoopTest.java 8198617 macosx-all
java/awt/Focus/6981400/Test1.java 8029675 windows-all,macosx-all
java/awt/Focus/8073453/AWTFocusTransitionTest.java 8136517 macosx-all
java/awt/Focus/8073453/SwingFocusTransitionTest.java 8136517 macosx-all
java/awt/Focus/6981400/Test3.java 8173264 generic-all
java/awt/event/KeyEvent/ExtendedKeyCode/ExtendedKeyCodeTest.java 8169476 windows-all,macosx-all
java/awt/event/KeyEvent/KeyChar/KeyCharTest.java 8169474,8224055 macosx-all,windows-all
@@ -26,12 +26,18 @@
* @key headful
* @bug 8073453
* @summary Focus doesn't move when pressing Shift + Tab keys
* @author Dmitry Markov
* @compile AWTFocusTransitionTest.java
* @run main/othervm AWTFocusTransitionTest
*/

import java.awt.*;
import java.awt.Button;
import java.awt.Component;
import java.awt.DefaultFocusTraversalPolicy;
import java.awt.Frame;
import java.awt.GridLayout;
import java.awt.Panel;
import java.awt.Robot;
import java.awt.TextField;
import java.awt.event.KeyEvent;

public class AWTFocusTransitionTest {
@@ -43,7 +49,7 @@

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

try {
createAndShowGUI();
@@ -101,14 +107,15 @@ private static void createAndShowGUI() {
p.add(panel);

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

private static void checkFocusOwner(Component component) {
if (component != frame.getFocusOwner()) {
throw new RuntimeException("Test Failed! Incorrect focus owner: " + frame.getFocusOwner() +
throw new RuntimeException("Test Failed! Incorrect focus " +
"owner: " + frame.getFocusOwner() +
", but expected: " + component);
}
}
}

@@ -26,13 +26,20 @@
* @key headful
* @bug 8073453
* @summary Focus doesn't move when pressing Shift + Tab keys
* @author Dmitry Markov
* @compile SwingFocusTransitionTest.java
* @run main/othervm SwingFocusTransitionTest
*/

import javax.swing.*;
import java.awt.*;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.SwingUtilities;
import java.awt.Component;
import java.awt.DefaultFocusTraversalPolicy;
import java.awt.GridLayout;
import java.awt.Robot;
import java.awt.event.KeyEvent;

public class SwingFocusTransitionTest {
@@ -44,7 +51,7 @@

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

try {
SwingUtilities.invokeAndWait(new Runnable() {
@@ -112,19 +119,21 @@ private static void createAndShowGUI() {
p.add(panel);

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

private static void checkFocusOwner(final Component component) throws Exception {
private static void checkFocusOwner(final Component component)
throws Exception {
SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
if (component != frame.getFocusOwner()) {
throw new RuntimeException("Test Failed! Incorrect focus owner: " + frame.getFocusOwner() +
throw new RuntimeException("Test Failed! Incorrect focus" +
" owner: " + frame.getFocusOwner() +
", but expected: " + component);
}
}
});
}
}