--- old/java/awt/Focus/DisposedWindow/DisposeDialogNotActivateOwnerTest/DisposeDialogNotActivateOwnerTest.java 2014-12-04 12:31:03.000000000 +0300 +++ new/java/awt/Focus/DisposedWindow/DisposeDialogNotActivateOwnerTest/DisposeDialogNotActivateOwnerTest.java 2014-12-04 12:31:03.000000000 +0300 @@ -9,11 +9,9 @@ import java.awt.*; import java.awt.event.*; import java.applet.Applet; -import sun.awt.SunToolkit; public class DisposeDialogNotActivateOwnerTest extends Applet { Robot robot; - SunToolkit toolkit; Frame frame = new Frame("Owner Frame"); Dialog dialog = new Dialog(new Frame(), "Owned Dialog"); @@ -41,13 +39,12 @@ {"This is automatic test. Simply wait until it is done." }); - frame.setBounds(800, 0, 200, 100); + frame.setBounds(800, 50, 200, 100); frame.add(frameButton); dialog.setBounds(800, 300, 200, 100); } public void start() { - toolkit = (SunToolkit)Toolkit.getDefaultToolkit(); frameButton.addFocusListener(new FocusAdapter() { public void focusGained(FocusEvent e) { @@ -56,7 +53,7 @@ }); frame.setVisible(true); - toolkit.realSync(); + robot.waitForIdle(); // make sure the frame is focused clickOn(frame); @@ -65,7 +62,7 @@ } dialog.setVisible(true); - toolkit.realSync(); + robot.waitForIdle(); // make sure the dialog is focused if (!dialog.isFocused()) { @@ -73,7 +70,7 @@ } dialog.dispose(); - toolkit.realSync(); + robot.waitForIdle(); if (passed) { Sysout.println("Test passed."); @@ -96,7 +93,7 @@ robot.delay(20); robot.mouseRelease(InputEvent.BUTTON1_MASK); - toolkit.realSync(); + robot.waitForIdle(); } }