8163167: [PIT] javax/swing/JTextArea/ScrollbarFlicker/ScrollFlickerTest.java always fail
Reviewed-by: serb, alexsch
--- a/jdk/test/javax/swing/JTextArea/ScrollbarFlicker/ScrollFlickerTest.java Mon Oct 17 13:20:04 2016 +0530
+++ b/jdk/test/javax/swing/JTextArea/ScrollbarFlicker/ScrollFlickerTest.java Mon Oct 17 10:51:58 2016 +0300
@@ -29,8 +29,6 @@
import javax.swing.*;
import java.awt.*;
-import java.awt.event.ComponentAdapter;
-import java.awt.event.ComponentEvent;
public class ScrollFlickerTest {
@@ -56,18 +54,19 @@
robot.delay(200);
SwingUtilities.invokeAndWait(() -> {
- scroll.getViewport().addChangeListener((e) -> cnt++);
Insets insets = scroll.getInsets();
scroll.setSize(insets.left + insets.right +
scroll.getVerticalScrollBar().getPreferredSize().width, 50);
scroll.revalidate();
});
-
+ robot.delay(200);
+ SwingUtilities.invokeAndWait(() ->
+ scroll.getViewport().addChangeListener((e) -> cnt++));
robot.delay(1000);
SwingUtilities.invokeLater(frame::dispose);
- if (cnt > 2) {
+ if (cnt > 0) {
throw new RuntimeException("Scroll bar flickers");
}
}