8197825: [Test] Intermittent timeout with javax/swing JColorChooser Test
Reviewed-by: trebari, aivanov
This commit is contained in:
parent
b9d4211bc1
commit
c0084100bc
@ -734,7 +734,6 @@ javax/swing/JWindow/ShapedAndTranslucentWindows/SetShapeAndClickSwing.java 80134
|
|||||||
javax/swing/JWindow/ShapedAndTranslucentWindows/TranslucentJComboBox.java 8024627 macosx-all
|
javax/swing/JWindow/ShapedAndTranslucentWindows/TranslucentJComboBox.java 8024627 macosx-all
|
||||||
# The next test below is an intermittent failure
|
# The next test below is an intermittent failure
|
||||||
javax/swing/JComboBox/8033069/bug8033069ScrollBar.java 8163367 generic-all
|
javax/swing/JComboBox/8033069/bug8033069ScrollBar.java 8163367 generic-all
|
||||||
javax/swing/JColorChooser/Test6827032.java 8197825 windows-all
|
|
||||||
javax/swing/JTree/DnD/LastNodeLowerHalfDrop.java 8159131 linux-all
|
javax/swing/JTree/DnD/LastNodeLowerHalfDrop.java 8159131 linux-all
|
||||||
javax/swing/JTree/4633594/JTreeFocusTest.java 8173125 macosx-all
|
javax/swing/JTree/4633594/JTreeFocusTest.java 8173125 macosx-all
|
||||||
javax/swing/AbstractButton/6711682/bug6711682.java 8060765 windows-all,macosx-all
|
javax/swing/AbstractButton/6711682/bug6711682.java 8060765 windows-all,macosx-all
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
/*
|
/*
|
||||||
* @test
|
* @test
|
||||||
* @key headful
|
* @key headful
|
||||||
* @bug 6827032
|
* @bug 6827032 8197825
|
||||||
* @summary Color chooser with drag enabled shouldn't throw NPE
|
* @summary Color chooser with drag enabled shouldn't throw NPE
|
||||||
* @author Peter Zhelezniakov
|
* @author Peter Zhelezniakov
|
||||||
* @library ../regtesthelpers
|
* @library ../regtesthelpers
|
||||||
@ -38,47 +38,57 @@ import javax.swing.plaf.nimbus.NimbusLookAndFeel;
|
|||||||
|
|
||||||
|
|
||||||
public class Test6827032 {
|
public class Test6827032 {
|
||||||
|
|
||||||
private static volatile Point point;
|
private static volatile Point point;
|
||||||
|
private static JFrame frame;
|
||||||
private static JColorChooser cc;
|
private static JColorChooser cc;
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
UIManager.setLookAndFeel(new NimbusLookAndFeel());
|
try {
|
||||||
|
UIManager.setLookAndFeel(new NimbusLookAndFeel());
|
||||||
|
|
||||||
Robot robot = new Robot();
|
Robot robot = new Robot();
|
||||||
robot.setAutoDelay(50);
|
robot.setAutoDelay(100);
|
||||||
|
|
||||||
|
SwingUtilities.invokeAndWait(new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
createAndShowGUI();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
SwingUtilities.invokeAndWait(new Runnable() {
|
robot.waitForIdle();
|
||||||
public void run() {
|
robot.delay(1000);
|
||||||
createAndShowGUI();
|
|
||||||
|
SwingUtilities.invokeAndWait(new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
Component previewPanel = Util.findSubComponent(cc, "javax.swing.colorchooser.DefaultPreviewPanel");
|
||||||
|
point = previewPanel.getLocationOnScreen();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
point.translate(5, 5);
|
||||||
|
|
||||||
|
robot.mouseMove(point.x, point.y);
|
||||||
|
robot.waitForIdle();
|
||||||
|
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
|
||||||
|
robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
|
||||||
|
robot.waitForIdle();
|
||||||
|
robot.delay(1000);
|
||||||
|
} finally {
|
||||||
|
if (frame != null) {
|
||||||
|
SwingUtilities.invokeAndWait(() -> frame.dispose());
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
|
||||||
robot.waitForIdle();
|
|
||||||
|
|
||||||
SwingUtilities.invokeAndWait(new Runnable() {
|
|
||||||
public void run() {
|
|
||||||
Component previewPanel = Util.findSubComponent(cc, "javax.swing.colorchooser.DefaultPreviewPanel");
|
|
||||||
point = previewPanel.getLocationOnScreen();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
point.translate(5, 5);
|
|
||||||
|
|
||||||
robot.mouseMove(point.x, point.y);
|
|
||||||
robot.mousePress(InputEvent.BUTTON1_MASK);
|
|
||||||
robot.mouseRelease(InputEvent.BUTTON1_MASK);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static void createAndShowGUI() {
|
private static void createAndShowGUI() {
|
||||||
JFrame frame = new JFrame(Test6827032.class.getName());
|
frame = new JFrame(Test6827032.class.getName());
|
||||||
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||||
cc = new JColorChooser();
|
cc = new JColorChooser();
|
||||||
cc.setDragEnabled(true);
|
cc.setDragEnabled(true);
|
||||||
frame.add(cc);
|
frame.add(cc);
|
||||||
frame.pack();
|
frame.pack();
|
||||||
|
frame.setLocationRelativeTo(null);
|
||||||
frame.setVisible(true);
|
frame.setVisible(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user