java/awt/Focus/6378278/InputVerifierTest.java

Print this page

        

@@ -18,11 +18,10 @@
 import java.awt.Dialog;
 import java.awt.Frame;
 import java.awt.Point;
 import java.awt.Robot;
 import java.awt.TextArea;
-import java.awt.Toolkit;
 
 import java.awt.event.InputEvent;
 import java.awt.event.KeyEvent;
 
 import javax.swing.InputVerifier;

@@ -71,42 +70,41 @@
             e.printStackTrace();
             InputVerifierTest.fail(e.toString());
         }
 
         try {
-            sun.awt.SunToolkit tk = (sun.awt.SunToolkit) Toolkit.getDefaultToolkit();
-            tk.realSync();
+            r.waitForIdle();
 
             mouseClickOnComp(r, t1);
-            tk.realSync();
+            r.waitForIdle();
 
             if (!t1.isFocusOwner()) {
                 throw new RuntimeException("t1 is not a focus owner");
             }
             ivWasCalled = false;
             r.keyPress(KeyEvent.VK_TAB);
             r.delay(10);
             r.keyRelease(KeyEvent.VK_TAB);
-            tk.realSync();
+            r.waitForIdle();
 
             if (!t2.isFocusOwner()) {
                 throw new RuntimeException("t2 is not a focus owner");
             }
             if (!ivWasCalled) {
                 throw new RuntimeException("InputVerifier was not called after tabbing");
             }
 
             mouseClickOnComp(r, t1);
-            tk.realSync();
+            r.waitForIdle();
 
             if (!t1.isFocusOwner()) {
                 throw new RuntimeException("t1 is not a focus owner");
             }
 
             ivWasCalled = false;
             mouseClickOnComp(r, t2);
-            tk.realSync();
+            r.waitForIdle();
             if (!t2.isFocusOwner()) {
                 throw new RuntimeException("t2 is not a focus owner");
             }
             if (!ivWasCalled) {
                 throw new RuntimeException("InputVErifier was not called after mouse press");