<AWT Dev> RFR: 8267161 : Write automated test case for JDK-4479161 [v3]

lawrence.andrews github.com+87324768+lawrence-andrew at openjdk.java.net
Thu Aug 19 15:49:28 UTC 2021


On Mon, 16 Aug 2021 21:00:47 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

>> lawrence.andrews has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Fixed a single space issue
>>  - Add frame.setLocationRelativeTo to get the frame to center of the screen
>
> test/jdk/java/awt/im/4959409/bug4959409.java line 124:
> 
>> 122:         }
>> 123: 
>> 124:         Robot robot = new Robot();
> 
> Won't using `robot.setAutoDelay(DELAY)` give the same effect without the need to interleave key presses and mouse moves with explicit delay?

added

> test/jdk/java/awt/im/4959409/bug4959409.java line 144:
> 
>> 142:         robot.delay(DELAY);
>> 143:         robot.keyRelease(KeyEvent.VK_1);
>> 144:         robot.delay(DELAY);
> 
> Shall we not release '1' first and then Shift?
> 
> Isn't it the case mentioned in #5079 ?

done

> test/jdk/java/awt/im/4959409/bug4959409.java line 173:
> 
>> 171:             while (count <= 5) {
>> 172:                 TimeUnit.SECONDS.sleep(1);
>> 173:                 if (component.isVisible()) {
> 
> Should `component.isVisible()` also be called on EDT?

done

> test/jdk/java/awt/im/4959409/bug4959409.java line 198:
> 
>> 196:                 });
>> 197:             }
>> 198:         }
> 
> Probably this could be simplified to:
> Suggestion:
> 
>         try {
>             createUIAndTest();
>         } finally {
>             SwingUtilities.invokeAndWait(()-> {
>                 if (frame != null) {
>                     frame.dispose();
>                 }
>             });
>         }
> 
> 
> With the assumption `createUIAndTest()` is made static.

done

-------------

PR: https://git.openjdk.java.net/jdk/pull/5058


More information about the awt-dev mailing list