Skip to content

Conversation

azvegint
Copy link
Member

@azvegint azvegint commented Sep 9, 2025

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.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8366852: java/awt/Choice/ChoiceMouseWheelTest/ChoiceMouseWheelTest.java test is failing (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/27161/head:pull/27161
$ git checkout pull/27161

Update a local copy of the PR:
$ git checkout pull/27161
$ git pull https://git.openjdk.org/jdk.git pull/27161/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 27161

View PR using the GUI difftool:
$ git pr show -t 27161

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/27161.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 9, 2025

👋 Welcome back azvegint! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Sep 9, 2025

@azvegint This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8366852: java/awt/Choice/ChoiceMouseWheelTest/ChoiceMouseWheelTest.java test is failing

Reviewed-by: psadhukhan, honkar

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 89 new commits pushed to the master branch:

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk
Copy link

openjdk bot commented Sep 9, 2025

@azvegint The following label will be automatically applied to this pull request:

  • client

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added client [email protected] rfr Pull request is ready for review labels Sep 9, 2025
@mlbridge
Copy link

mlbridge bot commented Sep 9, 2025

Webrevs

throw new RuntimeException("Mouse Wheel over the choice failed!");
}
// mouse wheel doesn't work for the choice on X11 and Mac, so skip it
if (!isXtoolkit && !isLWCToolkit) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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..

Copy link
Member Author

@azvegint azvegint Sep 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a different case that only works on Windows. When the mouse cursor is above the choice, you should be able to change the items using the mouse wheel (without click and showing a popup)

public static void main(String[] args) {
new ChoiceMouseWheelTest();
public static void main(String[] args) throws Exception {
ChoiceMouseWheelTest test = Util.invokeOnEDT(ChoiceMouseWheelTest::new);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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||

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any need to have dependancy on Util..we can use EventQueue directly, right? That will help in running standalone too!!

It was already there, so I decided to use it. It greatly reduce the code amount.

Also jtreg tags is not aligned with asterisks and author tag not removed||

updated


public class ChoiceMouseWheelTest extends Frame {

private volatile boolean itemChanged = false;
private volatile boolean wheelMoved = false;
private volatile boolean frameExited = false;
private final Choice choice = new Choice();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WHy not do the initialization in EDT in constructor?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is already on EDT, but moved to the constructor.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Sep 12, 2025
Copy link
Contributor

@honkar-jdk honkar-jdk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM.

* @test
* @key headful
* @bug 7050935
* @summary closed/java/awt/Choice/WheelEventsConsumed/WheelEventsConsumed.html fails on win32
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: You may want to change the test path in the summary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client [email protected] ready Pull request is ready to be integrated rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

3 participants