RFR: 8366852: java/awt/Choice/ChoiceMouseWheelTest/ChoiceMouseWheelTest.java test is failing
Prasanta Sadhukhan
psadhukhan at openjdk.org
Thu Sep 11 05:21:26 UTC 2025
On Tue, 9 Sep 2025 06:28:08 GMT, Alexander Zvegintsev <azvegint at openjdk.org> wrote:
> There are several major issues with the test:
>
> 1. The `frameExited` variable is set to true when the mouse pointer exits the frame. The test does not expect this to happen with the first mouse click on the `choice` when the mouse pointer is already over the test frame (frame mouseExited - > choice mouseEntered). A reset for the frameExited was added.
> 2. The test does not wait for the frame to appear after the call to `setVisible()`, so the test can start operating not on a fully visible window (e.g. one with an appearance animation). A delay has been added.
> 3. In macOS, the direction of rotation of the mouse wheel is different, which was not taken into account.
>
> Testing looks good.
test/jdk/java/awt/Choice/ChoiceMouseWheelTest/ChoiceMouseWheelTest.java line 57:
> 55: private volatile boolean wheelMoved = false;
> 56: private volatile boolean frameExited = false;
> 57: private final Choice choice = new Choice();
WHy not do the initialization in EDT in constructor?
test/jdk/java/awt/Choice/ChoiceMouseWheelTest/ChoiceMouseWheelTest.java line 60:
> 58:
> 59: public static void main(String[] args) throws Exception {
> 60: ChoiceMouseWheelTest test = Util.invokeOnEDT(ChoiceMouseWheelTest::new);
Is there any need to have dependancy on Util..we can use EventQueue directly, right? That will help in running standalone too!!
Also jtreg tags is not aligned with asterisks and author tag not removed||
test/jdk/java/awt/Choice/ChoiceMouseWheelTest/ChoiceMouseWheelTest.java line 121:
> 119:
> 120: // mouse wheel doesn't work for the choice on X11 and Mac, so skip it
> 121: if (!isXtoolkit && !isLWCToolkit) {
Is this block required? As in the description it is mentioned that the wheel rotation is taken care for macos down below and it seems test works ok without this block too..
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27161#discussion_r2338608365
PR Review Comment: https://git.openjdk.org/jdk/pull/27161#discussion_r2335846378
PR Review Comment: https://git.openjdk.org/jdk/pull/27161#discussion_r2335845878
More information about the client-libs-dev
mailing list