Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8294067: [macOS] javax/swing/JComboBox/6559152/bug6559152.java Cannot select an item from popup with the ENTER key. #10359

Closed

Conversation

DamonGuy
Copy link
Contributor

@DamonGuy DamonGuy commented Sep 20, 2022

The newly fix-sized JComboBox has its dropdown menu opened with this test's mouse click. The goal of the test is to focus the JComboBox, open the dropdown menu, and select the 2nd option of the menu using arrow keys and ENTER key. Since the JComboBox is focused without the click already, the click can be removed.


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-8294067: [macOS] javax/swing/JComboBox/6559152/bug6559152.java Cannot select an item from popup with the ENTER key.

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 10359

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 20, 2022

👋 Welcome back dnguyen! 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 openjdk bot added the rfr Pull request is ready for review label Sep 20, 2022
@openjdk
Copy link

openjdk bot commented Sep 20, 2022

@DamonGuy 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 the client client-libs-dev@openjdk.org label Sep 20, 2022
@mlbridge
Copy link

mlbridge bot commented Sep 20, 2022

Webrevs

@prrace
Copy link
Contributor

prrace commented Sep 20, 2022

I note that the mouse click was added to stabilise this test in this PR
https://github.com/openjdk/jdk/pull/1666/files#diff-92c0c78d42028b3d6bb57bd687afe28b5947ba8e3ccae9025a5a62214a21930c

@prsadhuk was it really needed ?

The comment back then was
"and also made this test's frame gain focus by clicking on the frame, as it seems the frame does not get focus sometime so that keyevent does not get registered causing it to fail."

Copy link
Member

@azvegint azvegint left a comment

Choose a reason for hiding this comment

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

Personally I would prefer to keep the click for better test stability.
Let's hear some thoughts from other reviewers.

EDIT: looks like I am not the only one concerning about this.

@@ -99,9 +99,6 @@ private static void setupUI() {
private static void test() throws Exception {
robot.mouseMove(p.x, p.y);
Copy link
Member

Choose a reason for hiding this comment

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

Are we still need this? There is no more mouse click.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I re-added the mouse click and took Prasanta's advice to just center the mouse on the combobox, instead of adding to the y position by 1.

@openjdk
Copy link

openjdk bot commented Sep 20, 2022

@DamonGuy 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:

8294067: [macOS] javax/swing/JComboBox/6559152/bug6559152.java Cannot select an item from popup with the ENTER key.

Reviewed-by: azvegint, psadhukhan

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 801 new commits pushed to the master branch:

  • cb5771d: 8294006: Avoid hardcoding object file suffixes in make
  • 5002eaa: 8293828: JFR: jfr/event/oldobject/TestClassLoaderLeak.java still fails when GC cycles are not happening
  • e3358e7: 8294008: Grapheme implementation of setText() throws IndexOutOfBoundsException
  • df8ec09: 8294046: Newly added test test/jdk/javax/swing/JTabbedPane/TestNPEStateChgListener.java fails in macos
  • 09af637: 8294012: RISC-V: get/put_native_u8 missing the case when address&7 is 6
  • 584de68: 8294058: Early use of lambda introduced in JDK-8285263 cause startup regressions in 20-b02
  • bb422f5: 8293595: tstrings::any() is missing an overload
  • 0f28cb0: 8294014: Remove redundant UseCompiler conditions
  • 84ee1a2: 8293781: RISC-V: Clarify types of calls
  • 1b49606: 8293922: Extend barrier-less Java thread transitions to native transitions
  • ... and 791 more: https://git.openjdk.org/jdk/compare/d9ca438d06166f153d11bb55c9ec672fc63c0e9e...master

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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@azvegint, @prsadhuk) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Sep 20, 2022
@prsadhuk
Copy link
Contributor

I think the click is needed to gain focus in some CI systems..
The thing is it does not fail in non macos systems so far makes it interesting..
Probably the mouseMove(p.x, p.y) is not actually moving the mouse to the combobox interior area in hidpi systems and it does not fail in windows probably because it is running in nonhidpi systems.

I guess probably the right fix will be to do
robot.mouseMove(p.x + comboBox.width/2, p.y + comboxBox.height/2) to make sure it is clicked inside the combobox

Also, better to run in all platforms after the test fix and put in JBS.

@@ -97,7 +98,7 @@ private static void setupUI() {
}

private static void test() throws Exception {
robot.mouseMove(p.x, p.y);
robot.mouseMove(p.x + cb.getWidth() / 2, p.y + cb.getHeight() / 2);
Copy link
Contributor

Choose a reason for hiding this comment

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

Since cb is swing component, appropriate will be to do
(Dimension) d = comp.getSize(); inside blockTillDisplayed() which is called in EDT

and use mouseMove(p.x + d.width/2, p.y + d.height/2)

@DamonGuy
Copy link
Contributor Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Sep 20, 2022
@openjdk
Copy link

openjdk bot commented Sep 20, 2022

@DamonGuy
Your change (at version d6bd577) is now ready to be sponsored by a Committer.

@azvegint
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Sep 20, 2022

Going to push as commit 3b438a6.
Since your change was applied there have been 802 commits pushed to the master branch:

  • caae53f: 8289508: Improve test coverage for XPath Axes: ancestor, ancestor-or-self, preceding, and preceding-sibling
  • cb5771d: 8294006: Avoid hardcoding object file suffixes in make
  • 5002eaa: 8293828: JFR: jfr/event/oldobject/TestClassLoaderLeak.java still fails when GC cycles are not happening
  • e3358e7: 8294008: Grapheme implementation of setText() throws IndexOutOfBoundsException
  • df8ec09: 8294046: Newly added test test/jdk/javax/swing/JTabbedPane/TestNPEStateChgListener.java fails in macos
  • 09af637: 8294012: RISC-V: get/put_native_u8 missing the case when address&7 is 6
  • 584de68: 8294058: Early use of lambda introduced in JDK-8285263 cause startup regressions in 20-b02
  • bb422f5: 8293595: tstrings::any() is missing an overload
  • 0f28cb0: 8294014: Remove redundant UseCompiler conditions
  • 84ee1a2: 8293781: RISC-V: Clarify types of calls
  • ... and 792 more: https://git.openjdk.org/jdk/compare/d9ca438d06166f153d11bb55c9ec672fc63c0e9e...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Sep 20, 2022
@openjdk openjdk bot closed this Sep 20, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Sep 20, 2022
@openjdk
Copy link

openjdk bot commented Sep 20, 2022

@azvegint @DamonGuy Pushed as commit 3b438a6.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client client-libs-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

4 participants