RFR: 8300405: Screen capture for test JFileChooserSetLocationTest.java, failure case
Tejesh R
tr at openjdk.org
Fri Jan 20 09:44:29 UTC 2023
On Fri, 20 Jan 2023 08:09:38 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:
>> This is a diagnostic update related to [JDK-8295804](https://bugs.openjdk.org/browse/JDK-8295804). The issue was not reproducible and was showing up in particular machines (Where the machines are down now). So adding a screen capture to `BufferedImage` in case of failure so that it will help in analysis when the issue comes up in future.
>
> test/jdk/javax/swing/JFileChooser/JFileChooserSetLocationTest.java line 189:
>
>> 187: System.out.println("Test passed");
>> 188: } else {
>> 189: Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
>
> I think what you want to use here is the bounds of the screen, not the size, since the screen coordinates may start from non-zero values.
GraphicsConfiguration gc = GraphicsEnvironment.
getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
Rectangle gcBounds = gc.getBounds();
This way?
-------------
PR: https://git.openjdk.org/jdk/pull/12060
More information about the client-libs-dev
mailing list