RFR: 8340173: Open source some Component/Panel/EventQueue tests - Set2 [v5]
Harshitha Onkar
honkar at openjdk.org
Thu Oct 10 00:29:13 UTC 2024
On Wed, 9 Oct 2024 21:02:00 GMT, Damon Nguyen <dnguyen at openjdk.org> wrote:
>> Following tests are added as part of this PR:
>>
>> 1. /java/awt/LightweightComponent/MultipleAddNotifyTest/MultipleAddNotifyTest.java - CONVERTED TO AUTO
>> 2. /java/awt/LightweightComponent/PopupTest/PopupTest.java - MANUAL
>> 3. /java/awt/Panel/PanelRepaint/PanelRepaint.java - MANUAL
>> 4. /java/awt/EventQueue/PushPopDeadlock/PushPopDeadlock.java MANUAL (PROBLEM LISTED)
>
> Damon Nguyen has updated the pull request incrementally with one additional commit since the last revision:
>
> Changed offset to pass on win
test/jdk/java/awt/LightweightComponent/MultipleAddNotifyTest/MultipleAddNotifyTest.java line 77:
> 75: "not visible.");
> 76: }
> 77: f.setSize(200, 200);
It is better to move the frame to the center of the screen to avoid interactions with menubars.
So `frame.setLocationRelativeTo(null);`
test/jdk/java/awt/LightweightComponent/MultipleAddNotifyTest/MultipleAddNotifyTest.java line 86:
> 84: posX = l.getWidth() + 75;
> 85: posY = l.getHeight();
> 86: });
After moving the frame to the center of the screen the click location can be updated as below.
This adds some context for click location instead of having a hard-coded arbitrary offset.
Suggestion:
EventQueue.invokeAndWait(() -> {
posX = f.getX() + l.getWidth() + l.getWidth() / 2;
posY = f.getY() + l.getHeight();
});
test/jdk/java/awt/LightweightComponent/MultipleAddNotifyTest/MultipleAddNotifyTest.java line 94:
> 92: r.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
> 93:
> 94: r.delay(500);
Grouping of related statements
Suggestion:
r.mouseMove(posX, posY);
r.delay(500);
r.mousePress(InputEvent.BUTTON1_DOWN_MASK);
r.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
r.delay(500);
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21398#discussion_r1794411214
PR Review Comment: https://git.openjdk.org/jdk/pull/21398#discussion_r1794416843
PR Review Comment: https://git.openjdk.org/jdk/pull/21398#discussion_r1794418039
More information about the client-libs-dev
mailing list