changeset 11108:900cc6ee40b4

8213139: TooltipFXTest.testTooltipLeak failing intermittently Reviewed-by: kcr, arajkumar
author mbilla
date Mon, 05 Nov 2018 20:29:34 +0530
parents beaad9a20f47
children e864311d97e6
files tests/system/src/test/java/test/robot/javafx/web/TooltipFXTest.java
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/tests/system/src/test/java/test/robot/javafx/web/TooltipFXTest.java	Tue Oct 30 19:44:55 2018 +0100
+++ b/tests/system/src/test/java/test/robot/javafx/web/TooltipFXTest.java	Mon Nov 05 20:29:34 2018 +0530
@@ -31,6 +31,7 @@
 import javafx.application.Application;
 import javafx.application.Platform;
 import javafx.concurrent.Worker;
+import javafx.scene.input.MouseButton;
 import javafx.scene.layout.BorderPane;
 import javafx.scene.paint.Color;
 import javafx.scene.Scene;
@@ -144,7 +145,11 @@
         }
 
         Util.runAndWait(() -> {
-            robot.mouseMove(0, 0);
+            // Note that we need to click somewhere in the Stage to make sure
+            // we will get focus on the Windows platform.
+            robot.mouseMove((int)(scene.getWindow().getX() + scene.getX()),
+                (int)(scene.getWindow().getY() + scene.getY()));
+            robot.mouseClick(MouseButton.PRIMARY);
         });
 
         Util.sleep(SLEEP_TIME);