changeset 3965:a7ea2d624d40

7030774: javax/swing/text/CSSBorder/6796710/bug6796710.java test fails against jdk7 b134 Reviewed-by: malenkov
author rupashka
date Wed, 13 Apr 2011 21:08:08 +0400
parents b83978b25d1d
children 21fa255f0edf
files test/javax/swing/text/CSSBorder/6796710/bug6796710.java
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/test/javax/swing/text/CSSBorder/6796710/bug6796710.java	Wed Apr 13 20:16:19 2011 +0400
+++ b/test/javax/swing/text/CSSBorder/6796710/bug6796710.java	Wed Apr 13 21:08:08 2011 +0400
@@ -31,6 +31,8 @@
    @run main bug6796710
  */
 
+import sun.awt.SunToolkit;
+
 import javax.swing.*;
 import java.awt.*;
 import java.awt.image.BufferedImage;
@@ -91,7 +93,7 @@
             }
         });
 
-        robot.waitForIdle();
+        ((SunToolkit) SunToolkit.getDefaultToolkit()).realSync();
 
         BufferedImage bufferedImage = getPnBottomImage();
 
@@ -101,7 +103,10 @@
             }
         });
 
-        robot.waitForIdle();
+        ((SunToolkit) SunToolkit.getDefaultToolkit()).realSync();
+
+        // On Linux platforms realSync doesn't guaranties setSize completion
+        Thread.sleep(1000);
 
         if (!Util.compareBufferedImages(bufferedImage, getPnBottomImage())) {
             throw new RuntimeException("The test failed");