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

8347836: Disabled PopupMenu shows shortcuts on Mac #23402

Closed

Conversation

DamonGuy
Copy link
Contributor

@DamonGuy DamonGuy commented Jan 31, 2025

The test instructions say that disabled PopupMenus should not have shortcuts shown, but on MacOS, these shortcuts still appear. When checking native MacOS15 behavior, disabled PopupMenus still have shortcuts shown. Since the test doesn't modify the popup's shortcuts other than adding the shortcut for A, it makes sense that the result matches native behavior. So, I modified the test instructions instead to exclude MacOS from this step.


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-8347836: Disabled PopupMenu shows shortcuts on Mac (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 23402

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 31, 2025

👋 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
Copy link

openjdk bot commented Jan 31, 2025

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

8347836: Disabled PopupMenu shows shortcuts on Mac

Reviewed-by: azvegint, achung, kizune, abhiscxk

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

  • b9b62a0: 8346792: serviceability/jvmti/vthread/GetThreadState/GetThreadState.java testObjectWaitMillis failed
  • 6b994cd: 8333697: C2: Hit MemLimit in PhaseCFG::global_code_motion
  • 2ff8440: 8349344: Clarify documentation of Arena.ofConfined
  • 19399d2: 8348572: C2 compilation asserts due to unexpected irreducible loop
  • 6146588: 8348190: Framework for tracing makefile inclusion and parsing
  • 66a3898: 8348659: AArch64: IR rule failure with compiler/loopopts/superword/TestSplitPacks.java
  • 40603a5: 8349214: Improve size optimization flags for MSVC builds
  • 0926949: 8347629: Test FailOverDirectExecutionControlTest.java fails with -Xcomp
  • a51e669: 8349200: [JMH] time.format.ZonedDateTimeFormatterBenchmark fails
  • 9d23de5: 8184352: Remove Sun provider information from KeyPairGenerator javadoc
  • ... and 301 more: https://git.openjdk.org/jdk/compare/379d05bcc130446086786ecf6ca5a6b8e977386c...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.

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

@openjdk openjdk bot added the rfr Pull request is ready for review label Jan 31, 2025
@openjdk
Copy link

openjdk bot commented Jan 31, 2025

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

@mlbridge
Copy link

mlbridge bot commented Jan 31, 2025

Webrevs

Copy link
Contributor

@kumarabhi006 kumarabhi006 left a comment

Choose a reason for hiding this comment

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

You may remove .rows((int) INSTRUCTIONS.lines().count() + 2), not mandatory though.

@@ -47,7 +47,7 @@ public class PopupMenuVisuals {
If following conditions are met:
- Menu is disabled
- Menu has caption 'Popup menu' (only applicable for linux)
- Menu items don't show shortcuts
- Menu items don't show shortcuts (except on MacOS)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it good to restrict the test for "Windows and Linux" only ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It still tests for PopupMenu visuals on MacOS I suppose. We can still see if a disabled PopupMenu appears correctly. It's also a manual test. Not sure if restricting the test is actually required unless there's a bigger reason I'm missing.

test/jdk/java/awt/PopupMenu/PopupMenuVisuals.java Outdated Show resolved Hide resolved
Copy link
Contributor

@kumarabhi006 kumarabhi006 left a comment

Choose a reason for hiding this comment

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

Test changes looks good to me.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Feb 3, 2025
@@ -47,7 +47,7 @@ public class PopupMenuVisuals {
If following conditions are met:
- Menu is disabled
- Menu has caption 'Popup menu' (only applicable for linux)
Copy link
Member

@azvegint azvegint Feb 3, 2025

Choose a reason for hiding this comment

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

I believe we can only print instructions that are specific to the current platform.

e.g.:

--- a/test/jdk/java/awt/PopupMenu/PopupMenuVisuals.java
+++ b/test/jdk/java/awt/PopupMenu/PopupMenuVisuals.java
@@ -20,14 +20,17 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 /*
  * @test
  * @bug 6180413 6184485 6267144
  * @summary test for popup menu visual bugs in XAWT
- * @library /java/awt/regtesthelpers
- * @build PassFailJFrame
+ * @library /java/awt/regtesthelpers /test/lib
+ * @build PassFailJFrame jdk.test.lib.Platform
  * @run main/manual PopupMenuVisuals
-*/
+ */
+
+import jdk.test.lib.Platform;
 
 import java.awt.Button;
 import java.awt.CheckboxMenuItem;
@@ -45,11 +48,13 @@ public class PopupMenuVisuals {
          This test should show a button 'Popup'.
          Click on the button. A popup menu should be shown.
          If following conditions are met:
-          - Menu is disabled
-          - Menu has caption 'Popup menu' (only applicable for linux)
-          - Menu items don't show shortcuts (except on MacOS)
+          - Menu is disabled %s%s
 
-         Click Pass else click Fail.""";
+         Click Pass else click Fail."""
+            .formatted(
+                    Platform.isLinux() ? "\n - Menu has caption 'Popup menu'" : "",
+                    !Platform.isOSX() ? "\n - Menu items don't show shortcuts" : ""
+            );
 
     static PopupMenu pm;
     static Frame frame;

I think it will improve a test user experience.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Neat! Learned something new. Will definitely use this where applicable in the future. Added.

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Feb 3, 2025
@openjdk openjdk bot added the ready Pull request is ready to be integrated label Feb 3, 2025
@@ -79,9 +83,9 @@ private static Frame createTestUI() {
CheckboxMenuItem mi3 = new CheckboxMenuItem("Item 3");
Menu sm = new Menu("Submenu");

//Get things going. Request focus, set size, et cetera
// Get things going. Request focus, set size, et cetera
Copy link
Contributor

Choose a reason for hiding this comment

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

can just remove this comment since it's an artifact from Applet testing

@DamonGuy
Copy link
Contributor Author

DamonGuy commented Feb 5, 2025

/integrate

@openjdk
Copy link

openjdk bot commented Feb 5, 2025

Going to push as commit 379c3f9.
Since your change was applied there have been 313 commits pushed to the master branch:

  • 82bc0a7: 8344316: security/auth/callback/TextCallbackHandler/Password.java make runnable with JTReg and add the UI
  • 2f2f7cf: 8349084: Update vectors used in several PQC benchmarks
  • b9b62a0: 8346792: serviceability/jvmti/vthread/GetThreadState/GetThreadState.java testObjectWaitMillis failed
  • 6b994cd: 8333697: C2: Hit MemLimit in PhaseCFG::global_code_motion
  • 2ff8440: 8349344: Clarify documentation of Arena.ofConfined
  • 19399d2: 8348572: C2 compilation asserts due to unexpected irreducible loop
  • 6146588: 8348190: Framework for tracing makefile inclusion and parsing
  • 66a3898: 8348659: AArch64: IR rule failure with compiler/loopopts/superword/TestSplitPacks.java
  • 40603a5: 8349214: Improve size optimization flags for MSVC builds
  • 0926949: 8347629: Test FailOverDirectExecutionControlTest.java fails with -Xcomp
  • ... and 303 more: https://git.openjdk.org/jdk/compare/379d05bcc130446086786ecf6ca5a6b8e977386c...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Feb 5, 2025
@openjdk openjdk bot closed this Feb 5, 2025
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Feb 5, 2025
@openjdk
Copy link

openjdk bot commented Feb 5, 2025

@DamonGuy Pushed as commit 379c3f9.

💡 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 [email protected] integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

5 participants