RFR: JDK-8266245: AWT Test FullScreenInsets.java fails due to incorrect pixel color and wrong window bounds
Harshitha Onkar
honkar at openjdk.org
Fri Dec 2 22:28:08 UTC 2022
On Fri, 2 Dec 2022 03:43:57 GMT, Sergey Bylokhov <serb 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 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.
It was a miss - I meant to use the current ScreenDevice's DefaultConfiguration bounds - `device.getDefaultConfiguration().getBounds()` instead of `device.getFullScreenWindow().getBounds()`
I was debugging this further and found that the displayMode's width and height differ from the actual size of the full-screen windows as shown below for 2 screen extended display setup. The actual width and height of full screen window seem to match with `device.getDefaultConfiguration().getBounds()` and not with the display mode's which is what is being set here - https://github.com/openjdk/jdk/blob/2821fa9883cc9687b53e3bb5655732a614cff8fc/src/java.desktop/share/classes/java/awt/GraphicsDevice.java#L321
I'm currently looking into the past issues associated with this test case to understand the context of comparing the full screen window size to the size of display mode (if it was part of test requirement or issue to be solved).
(Tested on Windows)
No. of Screen Devices: 2
Testing on Screen Device# 0
Screen Device Default Config Bounds Width: 1280.0 Height: 720.0
Wrong window bounds: Expected: width = 1920, height = 1080 Actual: java.awt.Dimension[width=1280,height=720]
Wrong window bounds: Expected: width = 1920, height = 1080 Actual: java.awt.Dimension[width=1280,height=720]
Testing on Screen Device# 1
Screen Device Default Config Bounds Width: 2293.0 Height: 960.0
Wrong window bounds: Expected: width = 3440, height = 1440 Actual: java.awt.Dimension[width=2293,height=960]
Wrong window bounds: Expected: width = 3440, height = 1440 Actual: java.awt.Dimension[width=2293,height=960]
-------------
PR: https://git.openjdk.org/jdk/pull/11462
More information about the client-libs-dev
mailing list