Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8297213

Robot capture tests should move mouse to corner of screen

XMLWordPrintable

    • b09

      This is a follow-on to JDK-8289605, which fixed a problem where intermittent failures can happen on some platforms for robot capture tests if a previous test left the mouse cursor in the region being captured. In order to reduce the scope of the fix, the change for that bug only updated two specific failing tests. The rest of the robot capture tests are still fragile in that a new test could be added in the future that leaves the mouse cursor in just the right location to affect those tests as well.

      Further, the fix for JDK-8289605 moved the cursor to the bottom corner of the Stage being tested, which could still impact a test that samples the lower left pixel. A more robust fix would be to move the mouse to the lower left of the visible bounds of the Screen.

      I propose to fix this globally in an `@Before` method in all tests that use robot to read pixels from the screen. At least the following tests should be looked at:

      test/robot/javafx/embed/swing/RT30650GUI.java
      test/robot/javafx/scene/PixelBufferDrawTest.java
      test/robot/javafx/scene/RobotTest.java
      test/robot/javafx/scene/canvas/ImageSmoothingDrawTest.java
      test/robot/testharness/VisualTestBase.java

      Note that the change done to `test/robot/javafx/scene/layout/RegionBackgroundImageUITest.java` as part of JDK-8289605 would be reverted as part of this new fix, since `RegionBackgroundImageUITest` extends `VisualTestBase`.

            angorya Andy Goryachev
            kcr Kevin Rushforth
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: