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: serb, pbansal
  • Loading branch information
prsadhuk committed Dec 14, 2020
1 parent c30fff7 commit 2ee795d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
1 change: 0 additions & 1 deletion test/jdk/ProblemList.txt
Expand Up @@ -738,7 +738,6 @@ javax/swing/JSplitPane/4201995/bug4201995.java 8079127 generic-all
javax/swing/JTree/DnD/LastNodeLowerHalfDrop.java 8159131 linux-all
javax/swing/JTree/4633594/JTreeFocusTest.java 8173125 macosx-all
javax/swing/AbstractButton/6711682/bug6711682.java 8060765 windows-all,macosx-all
javax/swing/JComboBox/8032878/bug8032878.java 8196092,8196439 windows-all,macosx-all,linux-all
javax/swing/JComboBox/8072767/bug8072767.java 8196093 windows-all,macosx-all
javax/swing/JFileChooser/4524490/bug4524490.java 8042380 generic-all
javax/swing/JFileChooser/6396844/TwentyThousandTest.java 8198003 generic-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 2ee795d

@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.