RFR: 8169474: KeyCharTest: Wrong number of key events: 0
Alexander Zuev
kizune at openjdk.java.net
Wed Nov 3 18:37:10 UTC 2021
On Tue, 2 Nov 2021 03:13:43 GMT, Phil Race <prr at openjdk.org> wrote:
>> When i reproduced the test failures locally on Ubuntu 18 it seems like AWT Frame
>> that appeared on the screen had not received focus and keyboard events went to the
>> Window Manager which ignored them for having no meaning in the current context.
>> Added explicit toFront and requestFocus calls so window gets focused.
>
> test/jdk/java/awt/event/KeyEvent/KeyChar/KeyCharTest.java line 90:
>
>> 88: BufferedImage capture = robot.createScreenCapture(gd.getDefaultConfiguration().getBounds());
>> 89: File captureFile = new File("capture.png");
>> 90: ImageIO.write(capture, "png", captureFile);
>
> Can you confirm this png gets written somewhere that isn't scratch spaced deleted at the end of testing ?
> I don't think we do this multi-screen dance in most tests since the default screen should be good enough.
> Why isn't it here ?
I can confirm that in case of the failure the file is accessible in the work directory for download. I added this multi-monitor just in case if test fails because window is in the strange spot on multi-monitor configuration so i want to capture which screen it is on. That's not necessary since in 99.99% cases it will stay on the default display, but it does not hurt either.
-------------
PR: https://git.openjdk.java.net/jdk/pull/6161
More information about the client-libs-dev
mailing list