Skip to content
Permalink
Browse files
8242526: PIT: javax/swing/JInternalFrame/8020708/bug8020708.java fail…
…s in mach5 ubuntu system

8233644: [TESTBUG] JInternalFrame test bug8020708.java is failing on macos

Backport-of: 8b002d8
  • Loading branch information
GoeLin committed Sep 23, 2021
1 parent 7e73841 commit 4f3e01079ca28abca206b32379e5d491618cc0a9
Showing with 9 additions and 9 deletions.
  1. +0 −1 test/jdk/ProblemList.txt
  2. +9 −8 test/jdk/javax/swing/JInternalFrame/8020708/bug8020708.java
@@ -809,7 +809,6 @@ javax/swing/JMenuItem/4171437/bug4171437.java 8233641 macosx-all
javax/swing/JMenuBar/4750590/bug4750590.java 8233642 macosx-all
javax/swing/JMenu/4692443/bug4692443.java 8171998 macosx-all
javax/swing/JMenu/4515762/bug4515762.java 8233643 macosx-all
javax/swing/JInternalFrame/8020708/bug8020708.java 8233644 macosx-all
javax/swing/JColorChooser/Test8051548.java 8233647 macosx-all
javax/swing/plaf/synth/7158712/bug7158712.java 8238720 windows-all
javax/swing/plaf/basic/BasicComboPopup/JComboBoxPopupLocation/JComboBoxPopupLocation.java 8238720 windows-all
@@ -73,14 +73,15 @@ public static void main(String[] args) throws Exception {
if (!installLookAndFeel(laf)) {
continue;
}
testInternalFrameMnemonic();
testInternalFrameMnemonic(locale);
}
}
}

static void testInternalFrameMnemonic() throws Exception {
static void testInternalFrameMnemonic(Locale locale) throws Exception {
Robot robot = new Robot();
robot.setAutoDelay(50);
robot.setAutoDelay(250);
robot.setAutoWaitForIdle(true);

SwingUtilities.invokeAndWait(new Runnable() {
@Override
@@ -108,26 +109,26 @@ public void run() {
robot.mouseMove(clickPoint.x, clickPoint.y);
robot.mousePress(InputEvent.BUTTON1_MASK);
robot.mouseRelease(InputEvent.BUTTON1_MASK);
robot.waitForIdle();
robot.delay(500);

Util.hitKeys(robot, KeyEvent.VK_SHIFT, KeyEvent.VK_ESCAPE);
robot.waitForIdle();
robot.delay(500);

int keyCode = KeyEvent.VK_C;
String mnemonic = UIManager
.getString("InternalFrameTitlePane.closeButton.mnemonic");
try {
keyCode = Integer.parseInt(mnemonic);
} catch (NumberFormatException e) {
}
System.out.println("keyCode " + keyCode);
Util.hitKeys(robot, keyCode);
robot.waitForIdle();
robot.delay(500);

SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
if (internalFrame.isVisible()) {
throw new RuntimeException("Close mnemonic does not work in "+UIManager.getLookAndFeel());
throw new RuntimeException("Close mnemonic does not work in "+UIManager.getLookAndFeel() + " for locale " + locale);
}
frame.dispose();
}

1 comment on commit 4f3e010

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on 4f3e010 Sep 23, 2021

Please sign in to comment.