8167284: [TESTBUG] [PIT] possible regression: javax/swing/JRadioButton/FocusTraversal/FocusTraversal.java
Reviewed-by: ssadetsky, yan
This commit is contained in:
parent
893ec91655
commit
547092cf8d
@ -42,7 +42,6 @@ import javax.swing.JPanel;
|
||||
import javax.swing.JRadioButton;
|
||||
import javax.swing.JTextField;
|
||||
import javax.swing.KeyStroke;
|
||||
import javax.swing.LookAndFeel;
|
||||
import javax.swing.SwingUtilities;
|
||||
import javax.swing.UIManager;
|
||||
import javax.swing.UnsupportedLookAndFeelException;
|
||||
@ -133,41 +132,19 @@ public class FocusTraversal {
|
||||
}
|
||||
|
||||
private static void runTestCase() throws Exception {
|
||||
LookAndFeel lookAndFeel = UIManager.getLookAndFeel();
|
||||
focusOn(a);
|
||||
if (isExcludedLookAndFeel(lookAndFeel)) {
|
||||
robot.keyPress(KeyEvent.VK_ENTER);
|
||||
robot.keyRelease(KeyEvent.VK_ENTER);
|
||||
robot.waitForIdle();
|
||||
isFocusOwner(b, "forward");
|
||||
robot.keyPress(KeyEvent.VK_SHIFT);
|
||||
robot.keyPress(KeyEvent.VK_TAB);
|
||||
robot.keyRelease(KeyEvent.VK_TAB);
|
||||
robot.keyRelease(KeyEvent.VK_SHIFT);
|
||||
robot.waitForIdle();
|
||||
isFocusOwner(a, "backward");
|
||||
|
||||
} else {
|
||||
robot.keyPress(KeyEvent.VK_ENTER);
|
||||
robot.keyRelease(KeyEvent.VK_ENTER);
|
||||
robot.waitForIdle();
|
||||
isFocusOwner(next, "forward");
|
||||
robot.keyPress(KeyEvent.VK_SHIFT);
|
||||
robot.keyPress(KeyEvent.VK_TAB);
|
||||
robot.keyRelease(KeyEvent.VK_TAB);
|
||||
robot.keyRelease(KeyEvent.VK_SHIFT);
|
||||
robot.waitForIdle();
|
||||
isFocusOwner(a, "backward");
|
||||
|
||||
robot.keyPress(KeyEvent.VK_ENTER);
|
||||
robot.keyRelease(KeyEvent.VK_ENTER);
|
||||
robot.waitForIdle();
|
||||
isFocusOwner(next, "forward");
|
||||
robot.keyPress(KeyEvent.VK_SHIFT);
|
||||
robot.keyPress(KeyEvent.VK_TAB);
|
||||
robot.keyRelease(KeyEvent.VK_TAB);
|
||||
robot.keyRelease(KeyEvent.VK_SHIFT);
|
||||
robot.waitForIdle();
|
||||
isFocusOwner(d, "backward");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static boolean isExcludedLookAndFeel(LookAndFeel lookAndFeel) {
|
||||
|
||||
return lookAndFeel.toString().toLowerCase().contains("aqua")
|
||||
|| lookAndFeel.toString().toLowerCase().contains("nimbus")
|
||||
|| lookAndFeel.toString().toLowerCase().contains("gtk");
|
||||
}
|
||||
|
||||
private static void focusOn(Component component)
|
||||
|
Loading…
Reference in New Issue
Block a user