Skip to content

Commit ce1aac1

Browse files
committedOct 17, 2020
8028707: javax/swing/JComboBox/6236162/bug6236162.java fails on azure
Reviewed-by: serb, pbansal
1 parent 83ea863 commit ce1aac1

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed
 

‎test/jdk/ProblemList.txt

-1
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,6 @@ javax/swing/plaf/basic/BasicTextUI/8001470/bug8001470.java 8233177 linux-all,win
732732
javax/swing/border/TestTitledBorderLeak.java 8213531 linux-all
733733
javax/swing/JComponent/7154030/bug7154030.java 7190978 generic-all
734734
javax/swing/JComponent/6683775/bug6683775.java 8172337 generic-all
735-
javax/swing/JComboBox/6236162/bug6236162.java 8028707 windows-all,macosx-all
736735
javax/swing/JWindow/ShapedAndTranslucentWindows/ShapedTranslucentPerPixelTranslucentGradient.java 8233582 linux-all
737736
javax/swing/JWindow/ShapedAndTranslucentWindows/ShapedPerPixelTranslucentGradient.java 8233582 linux-all
738737
javax/swing/JWindow/ShapedAndTranslucentWindows/PerPixelTranslucentSwing.java 8194128 macosx-all

‎test/jdk/javax/swing/JComboBox/6236162/bug6236162.java

+10-8
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@
2828
* @summary Checks that there is no an inconsistence in combo box
2929
* behavior when user points an item in combo popup
3030
* by mouse and then uses UP/DOWN keys.
31-
* @library ../../regtesthelpers
32-
* @build Util
33-
* @author Mikhail Lapshin
3431
* @run main bug6236162
3532
*/
3633

@@ -44,15 +41,20 @@ public class bug6236162 {
4441
private static JFrame frame;
4542
private static JComboBox combo;
4643
private static MyComboUI comboUI;
44+
private static Robot robot;
4745

4846
public static void main(String[] args) throws Exception {
47+
robot = new Robot();
48+
robot.setAutoDelay(100);
4949
try {
5050
UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
5151
SwingUtilities.invokeAndWait(new Runnable() {
5252
public void run() {
5353
createAndShowGUI();
5454
}
5555
});
56+
robot.waitForIdle();
57+
robot.delay(1000);
5658
test();
5759
System.out.println("Test passed");
5860
} finally {
@@ -74,15 +76,14 @@ private static void createAndShowGUI() {
7476
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
7577
frame.setLocationRelativeTo(null);
7678
frame.setVisible(true);
79+
frame.toFront();
7780
}
7881

7982
private static void test() throws AWTException {
80-
Robot robot = new Robot();
81-
robot.setAutoDelay(50);
8283

8384
// Open popup menu
84-
robot.waitForIdle();
85-
Util.hitKeys(robot, KeyEvent.VK_DOWN);
85+
robot.keyPress(KeyEvent.VK_DOWN);
86+
robot.keyRelease(KeyEvent.VK_DOWN);
8687

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

99100
// Select the second popup menu item
100101
robot.waitForIdle();
101-
Util.hitKeys(robot, KeyEvent.VK_DOWN);
102+
robot.keyPress(KeyEvent.VK_DOWN);
103+
robot.keyRelease(KeyEvent.VK_DOWN);
102104

103105
robot.waitForIdle();
104106
JList list = comboUI.getComboPopup().getList();

0 commit comments

Comments
 (0)
Please sign in to comment.