Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8028707: javax/swing/JComboBox/6236162/bug6236162.java fails on azure
Reviewed-by: serb, pbansal
  • Loading branch information
prsadhuk committed Oct 17, 2020
1 parent 83ea863 commit ce1aac1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
1 change: 0 additions & 1 deletion test/jdk/ProblemList.txt
Expand Up @@ -732,7 +732,6 @@ javax/swing/plaf/basic/BasicTextUI/8001470/bug8001470.java 8233177 linux-all,win
javax/swing/border/TestTitledBorderLeak.java 8213531 linux-all
javax/swing/JComponent/7154030/bug7154030.java 7190978 generic-all
javax/swing/JComponent/6683775/bug6683775.java 8172337 generic-all
javax/swing/JComboBox/6236162/bug6236162.java 8028707 windows-all,macosx-all
javax/swing/JWindow/ShapedAndTranslucentWindows/ShapedTranslucentPerPixelTranslucentGradient.java 8233582 linux-all
javax/swing/JWindow/ShapedAndTranslucentWindows/ShapedPerPixelTranslucentGradient.java 8233582 linux-all
javax/swing/JWindow/ShapedAndTranslucentWindows/PerPixelTranslucentSwing.java 8194128 macosx-all
Expand Down
18 changes: 10 additions & 8 deletions test/jdk/javax/swing/JComboBox/6236162/bug6236162.java
Expand Up @@ -28,9 +28,6 @@
* @summary Checks that there is no an inconsistence in combo box
* behavior when user points an item in combo popup
* by mouse and then uses UP/DOWN keys.
* @library ../../regtesthelpers
* @build Util
* @author Mikhail Lapshin
* @run main bug6236162
*/

Expand All @@ -44,15 +41,20 @@ public class bug6236162 {
private static JFrame frame;
private static JComboBox combo;
private static MyComboUI comboUI;
private static Robot robot;

public static void main(String[] args) throws Exception {
robot = new Robot();
robot.setAutoDelay(100);
try {
UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
createAndShowGUI();
}
});
robot.waitForIdle();
robot.delay(1000);
test();
System.out.println("Test passed");
} finally {
Expand All @@ -74,15 +76,14 @@ private static void createAndShowGUI() {
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
frame.toFront();
}

private static void test() throws AWTException {
Robot robot = new Robot();
robot.setAutoDelay(50);

// Open popup menu
robot.waitForIdle();
Util.hitKeys(robot, KeyEvent.VK_DOWN);
robot.keyPress(KeyEvent.VK_DOWN);
robot.keyRelease(KeyEvent.VK_DOWN);

// Move mouse to the first popup menu item
robot.waitForIdle();
Expand All @@ -98,7 +99,8 @@ private static void test() throws AWTException {

// Select the second popup menu item
robot.waitForIdle();
Util.hitKeys(robot, KeyEvent.VK_DOWN);
robot.keyPress(KeyEvent.VK_DOWN);
robot.keyRelease(KeyEvent.VK_DOWN);

robot.waitForIdle();
JList list = comboUI.getComboPopup().getList();
Expand Down

1 comment on commit ce1aac1

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented on ce1aac1 Oct 17, 2020

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.