RFR: JDK-8266245: AWT Test FullScreenInsets.java fails due to incorrect pixel color and wrong window bounds

Sergey Bylokhov serb at openjdk.org
Fri Dec 2 03:50:42 UTC 2022


On Thu, 1 Dec 2022 18:03:42 GMT, Harshitha Onkar <honkar at openjdk.org> wrote:

> The above test was failing due to incorrect pixel color and wrong window bounds on Mac-ARM, Windows and Linux platforms.
> 
> The following changes have been made:
> - Correct window bounds are obtained using the screen device being tested (this test checks FullScreen functionality on multiple screen devices).
> - Color tolerance has been added for color check
> - Instead of scanning the full screen to check pixel color, vertical and horizontal scans are done at the far right and bottom end to ensure that window is in full screen mode w.r.t to screen device and the window bounds are as expected.
> 
> CI testing passes on all platforms (tested 50 times per platform).

test/jdk/java/awt/FullScreen/FullScreenInsets/FullScreenInsets.java line 44:

> 42:  * @bug 8003173 7019055
> 43:  * @summary Full-screen windows should have the proper insets.
> 44:  * @run main FullScreenInsets

run main is not needed if no options are provided for the test. less one place to make a typo or copy-paste error in the name of the test.

test/jdk/java/awt/FullScreen/FullScreenInsets/FullScreenInsets.java line 51:

> 49:     private static Robot robot = null;
> 50:     private static int deviceCount = 0;
> 51:     private static final float TOLERANCE = 10;

Are you sure that we need so big tolerance just to capture the green and red colors? We have CheckCommonColors which checks all our common colors via robot, and seems it works fine w/o tolerance.

test/jdk/java/awt/FullScreen/FullScreenInsets/FullScreenInsets.java line 61:

> 59:         final Frame wGreen = new Frame();
> 60:         wGreen.setBackground(Color.GREEN);
> 61:         wGreen.setUndecorated(true);

Why did you make that frame undecorated? I think the decoration was one of the reasons why the bug was reproduced.

test/jdk/java/awt/FullScreen/FullScreenInsets/FullScreenInsets.java line 89:

> 87:             device.setFullScreenWindow(wRed);
> 88:             sleep();
> 89:             testWindowBounds(device.getFullScreenWindow().getBounds(), wRed);

You changed the code
from:
   comparing the bounds of the display mode and the bounds of the window
to:
   comparing the bounds of the window and the bounds of the window
I do not think it is the right thing to do.

-------------

PR: https://git.openjdk.org/jdk/pull/11462



More information about the client-libs-dev mailing list