On Wed, 16 Nov 2022 05:18:28 GMT, Jayathirth D V <[email protected]> wrote:
>> test/jdk/sun/java2d/DirectX/OnScreenRenderingResizeTest/OnScreenRenderingResizeTest.java
>> line 126:
>>
>>> 124: robot.mouseMove(0,0);
>>> 125: } catch (AWTException ex) {
>>> 126: System.err.println("Robot creation failed,
>>> continuing.");
>>
>> Not sure if we should continue here as createScreenCapture is being used
>> down below which would result in NPE
>> Also this try-block is for creation so I think setAutoDelay and mouseMove
>> needs to be moved out of this block..
>> Also, better to use try-finally block to do frame.dispose()
>
> We will not throw NPE if robot is null. Because we have null check for robot
> when we want to use it.
> This test was originally written to check for crash after producing
> artifacts, thats why i think we continue to drawImage onto resizing frame
> even if Robot fails. So its better if we keep it that way.
>
> Also initially i used mouseMove() before we do screen capture, but this was
> causing considerably lag in drawing on my local mac machine. So i have kept
> it in initialization logic and i can see that mouse moves to (0, 0) and stays
> there until the test is completed. Next operation we do after this mouseMove
> is screenCapture. So keeping autodelay here or later should not matter.
>
> I have moved whole logic under try block and disposing frame under finally
> block.
SInce some coordinates are changed, can you please confirm the test can be used
still to confirm JDK-6664068 meaning it fails before the fix and pass with it?
-------------
PR: https://git.openjdk.org/jdk/pull/11158