Skip to content

Commit

Permalink
8196092: javax/swing/JComboBox/8032878/bug8032878.java fails
Browse files Browse the repository at this point in the history
Reviewed-by: mdoerr
Backport-of: 2ee795d
  • Loading branch information
jerboaa committed Jun 8, 2021
1 parent d3a5ed2 commit 6deb21f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
2 changes: 0 additions & 2 deletions test/jdk/ProblemList.txt
Expand Up @@ -729,7 +729,6 @@ javax/swing/AbstractButton/6711682/bug6711682.java 8060765 windows-all,macosx-al
javax/swing/Action/8133039/bug8133039.java 8196089 windows-all,macosx-all
javax/swing/JComboBox/6559152/bug6559152.java 8196090 windows-all,macosx-all
javax/swing/JComboBox/6607130/bug6607130.java 8196091 windows-all
javax/swing/JComboBox/8032878/bug8032878.java 8196092 windows-all,macosx-all
javax/swing/JComboBox/8057893/bug8057893.java 8169953 windows-all,macosx-all
javax/swing/JComboBox/8072767/bug8072767.java 8196093 windows-all,macosx-all
javax/swing/JComponent/4337267/bug4337267.java 8146451 windows-all
Expand All @@ -751,7 +750,6 @@ javax/swing/text/CSSBorder/6796710/bug6796710.java 8196099 windows-all
javax/swing/text/DefaultCaret/HidingSelection/HidingSelectionTest.java 8194048 windows-all
javax/swing/JFileChooser/6798062/bug6798062.java 8146446 windows-all
javax/swing/plaf/basic/BasicGraphicsUtils/8132119/bug8132119.java 8196434 linux-all,solaris-all
javax/swing/JComboBox/8032878/bug8032878.java 8196439 linux-all
javax/swing/JComboBox/8182031/ComboPopupTest.java 8196465 linux-all,macosx-all
javax/swing/JFileChooser/6738668/bug6738668.java 8194946 generic-all
javax/swing/JFileChooser/8021253/bug8021253.java 8169954 windows-all,linux-all,macosx-all
Expand Down
26 changes: 17 additions & 9 deletions test/jdk/javax/swing/JComboBox/8032878/bug8032878.java
Expand Up @@ -28,9 +28,6 @@
* @summary Checks that JComboBox as JTable cell editor processes key events
* even where setSurrendersFocusOnKeystroke flag in JTable is false and
* that it does not lose the first key press where the flag is true.
* @library ../../regtesthelpers
* @build Util
* @author Alexey Ivanov
* @run main bug8032878
*/

Expand Down Expand Up @@ -86,31 +83,42 @@ private void setupUI() {

frame.pack();
frame.setVisible(true);
frame.setLocationRelativeTo(null);
}

private void test(final boolean flag) throws Exception {
try {
surrender = flag;
SwingUtilities.invokeAndWait(this);

robot.waitForIdle();
robot.delay(1000);
runTest();
checkResult();
} finally {
if (frame != null) {
frame.dispose();
SwingUtilities.invokeAndWait(() -> frame.dispose());
}
}
}

private void runTest() throws Exception {
robot.waitForIdle();
// Select 'one'
Util.hitKeys(robot, KeyEvent.VK_TAB);
robot.keyPress(KeyEvent.VK_TAB);
robot.keyRelease(KeyEvent.VK_TAB);
robot.waitForIdle();
Util.hitKeys(robot, KeyEvent.VK_1);
Util.hitKeys(robot, KeyEvent.VK_2);
Util.hitKeys(robot, KeyEvent.VK_3);
Util.hitKeys(robot, KeyEvent.VK_ENTER);
robot.keyPress(KeyEvent.VK_1);
robot.keyRelease(KeyEvent.VK_1);
robot.waitForIdle();
robot.keyPress(KeyEvent.VK_2);
robot.keyRelease(KeyEvent.VK_2);
robot.waitForIdle();
robot.keyPress(KeyEvent.VK_3);
robot.keyRelease(KeyEvent.VK_3);
robot.waitForIdle();
robot.keyPress(KeyEvent.VK_ENTER);
robot.keyRelease(KeyEvent.VK_ENTER);
robot.waitForIdle();
}

Expand Down

1 comment on commit 6deb21f

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.