RFR: 8366844: Update and automate MouseDraggedOriginatedByScrollBarTest.java [v4]
Damon Nguyen
dnguyen at openjdk.org
Fri Sep 5 18:37:06 UTC 2025
On Thu, 4 Sep 2025 08:09:54 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:
>> Damon Nguyen has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Review comment edits
>
> test/jdk/java/awt/List/MouseDraggedOriginatedByScrollBarTest.java line 85:
>
>> 83: System.out.println(me.toString());
>> 84: throw new RuntimeException("Test failed. Mouse dragged " +
>> 85: "event detected.");
>
> Suggestion:
>
> throw new RuntimeException("Mouse dragged event detected.");
>
> Being concise is better, isn't it? An exception is already an indicator that the test failed, let's just provide the reason.
True, updated. Thanks!
> test/jdk/java/awt/List/MouseDraggedOriginatedByScrollBarTest.java line 127:
>
>> 125: loc = p;
>> 126: });
>> 127: robot.mouseMove(loc.x - 10, loc.y + 20);
>
> Suggestion:
>
> EventQueue.invokeAndWait(() -> {
> Point p = list.getLocationOnScreen();
> p.translate(list.getWidth() - 10, 20);
> loc = p;
> });
> robot.mouseMove(loc.x, loc.y);
>
> Prepare the correct location inside `invokeAndWait`. The offsets could be declared constants, which may result in clearer code.
Updated this and tested again on ubuntu 24.04 to double-check point values.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26636#discussion_r2325783958
PR Review Comment: https://git.openjdk.org/jdk/pull/26636#discussion_r2325784722
More information about the client-libs-dev
mailing list