On Fri, 20 Feb 2026 19:24:34 GMT, Alexey Ivanov <[email protected]> wrote:
> I added capturing a screenshot of the splash screen into the test, and I > found that the splash screen is already closed when the screenshot is taken. > I realised that I had changed the behaviour of the test with my screenshot > code. The original test gets the color of the pixel on the screen before it > calls `getScaleFactor` that displays a dialog, which results closing the > splash screen. > > https://github.com/openjdk/jdk/blob/e0b040a6c6713827033e9ba51c9ded920dd0203b/test/jdk/java/awt/SplashScreen/MultiResolutionSplash/MultiResolutionSplashTest.java#L110-L111 > > I analysed the code of the splash screen, and it never opens the images with > decorations for 100% scale: `[email protected]` or `[email protected]`. > > To avoid any confusion, I modified the test code to ensure it never creates > decorated files for 100%. If the scale factor of the main screen is 1.00, the > second image remains with the default `@2x` decoration. > > I also simplified the test. Now, `getScaleFactor` doesn't display a dialog, > but reads the scale from `GraphicsEnvironment`. It did so anyway because the > `Graphics` object passed to `paint` is an instance of `SunGraphics2D` in > nearly all the cases. > > The test always creates a screenshot of the splash screen and reads the color > from the screenshot to determine whether the test fails or not. > > The updated test is stable on all the platforms, I ran it many times, and the > test never failed. > > If the test ever fails again, we'll have the screenshot to analyse why. Marked as reviewed by prr (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/29851#pullrequestreview-3884406258
