7160653: test/javax/swing/plaf/synth/7158712/bug7158712.java failed on Ubuntu
authorrupashka
Thu, 12 Apr 2012 12:48:31 +0300
changeset 12409 39f4fbed4142
parent 12408 8e95f7b85140
child 12410 6e5f5781a5af
7160653: test/javax/swing/plaf/synth/7158712/bug7158712.java failed on Ubuntu Reviewed-by: alexp
jdk/test/javax/swing/plaf/synth/7158712/bug7158712.java
--- a/jdk/test/javax/swing/plaf/synth/7158712/bug7158712.java	Wed Apr 11 18:44:33 2012 -0700
+++ b/jdk/test/javax/swing/plaf/synth/7158712/bug7158712.java	Thu Apr 12 12:48:31 2012 +0300
@@ -28,6 +28,8 @@
    @author Pavel Porvatov
 */
 
+import sun.awt.SunToolkit;
+
 import javax.swing.*;
 import javax.swing.plaf.basic.BasicComboPopup;
 import javax.swing.plaf.synth.SynthLookAndFeel;
@@ -65,7 +67,7 @@
 
         UIManager.setLookAndFeel(laf);
 
-        EventQueue.invokeLater(new Runnable() {
+        EventQueue.invokeAndWait(new Runnable() {
             public void run() {
                 comboBox = new JComboBox<>(
                         new String[]{"Very Looooooooooooooooooooong Text Item 1", "Item 2"});
@@ -80,6 +82,8 @@
             }
         });
 
+        ((SunToolkit) Toolkit.getDefaultToolkit()).realSync();
+
         Point comboBoxLocation = Util.invokeOnEDT(new Callable<Point>() {
             @Override
             public Point call() throws Exception {