8224830: test/jdk/java/awt/Focus/ModalExcludedWindowClickTest/ModalExcludedWindowClickTest.java fails on linux-x64
authorpsadhukhan
Tue, 28 May 2019 16:35:47 +0530
changeset 55184 8cddb14bb234
parent 55183 4929c53ff29d
child 55185 f11d2e10a6e4
8224830: test/jdk/java/awt/Focus/ModalExcludedWindowClickTest/ModalExcludedWindowClickTest.java fails on linux-x64 Reviewed-by: jdv
test/jdk/java/awt/Focus/ModalExcludedWindowClickTest/ModalExcludedWindowClickTest.java
--- a/test/jdk/java/awt/Focus/ModalExcludedWindowClickTest/ModalExcludedWindowClickTest.java	Mon May 27 12:24:26 2019 -0700
+++ b/test/jdk/java/awt/Focus/ModalExcludedWindowClickTest/ModalExcludedWindowClickTest.java	Tue May 28 16:35:47 2019 +0530
@@ -113,7 +113,9 @@
         } else {
             robot.mouseMove(p.x + (int)(d.getWidth()/2), p.y + (int)(d.getHeight()/2));
         }
+        waitForIdle();
         robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.delay(50);
         robot.mouseRelease(InputEvent.BUTTON1_MASK);
         waitForIdle();
     }
@@ -121,8 +123,9 @@
         while (true) {
             try {
                 Thread.sleep(100);
-                c.getLocationOnScreen();
-                break;
+                Point p = c.getLocationOnScreen();
+                if (p != null)
+                    break;
             } catch (InterruptedException e) {
                 throw new RuntimeException(e);
             } catch (IllegalComponentStateException e) {}