--- old/java/awt/Choice/PopupPosTest/PopupPosTest.java 2014-12-04 12:31:00.000000000 +0300 +++ new/java/awt/Choice/PopupPosTest/PopupPosTest.java 2014-12-04 12:31:00.000000000 +0300 @@ -3,18 +3,25 @@ @bug 5044150 @summary Tests that pupup doesn't popdown if no space to display under @author andrei.dmitriev area=awt.choice + @library ../../../../lib/testlibrary + @build jdk.testlibrary.OSInfo @run applet PopupPosTest.html */ import java.applet.Applet; import java.awt.*; import java.awt.event.*; -import sun.awt.SunToolkit; + +import jdk.testlibrary.OSInfo; public class PopupPosTest extends Applet { public void start () { + if(OSInfo.getOSType().equals(OSInfo.OSType.MACOSX)) { + // On OS X, popup isn't under the mouse + return; + } Frame frame = new TestFrame(); } } @@ -41,9 +48,10 @@ setSize(screen.width - 10, screen.height - 70); setVisible(true); toFront(); - ((SunToolkit)tk).realSync(); try { robot = new Robot(); + robot.setAutoDelay(50); + robot.waitForIdle(); // fix for 6175418. When we take "choice.getHeight()/2" // divider 2 is not sufficiently big to hit into the // small box Choice. We should use bigger divider to get @@ -89,7 +97,7 @@ robot.mousePress(InputEvent.BUTTON1_MASK); robot.delay(30); robot.mouseRelease(InputEvent.BUTTON1_MASK); - ((SunToolkit)tk).realSync(); + robot.waitForIdle(); //should close choice after each test stage closeChoice(); checkSelectedIndex(); @@ -102,12 +110,12 @@ robot.mousePress(InputEvent.BUTTON1_MASK); robot.delay(30); robot.mouseRelease(InputEvent.BUTTON1_MASK); - ((SunToolkit)tk).realSync(); + robot.waitForIdle(); } public void closeChoice(){ robot.keyPress(KeyEvent.VK_ESCAPE); robot.keyRelease(KeyEvent.VK_ESCAPE); - ((SunToolkit)tk).realSync(); + robot.waitForIdle(); } public void checkSelectedIndex(){