-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Conversation
👋 Welcome back dnguyen! A progress list of the required criteria for merging this PR into |
@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:
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
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 |
Webrevs
|
There was a problem hiding this 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) |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
@@ -47,7 +47,7 @@ public class PopupMenuVisuals { | |||
If following conditions are met: | |||
- Menu is disabled | |||
- Menu has caption 'Popup menu' (only applicable for linux) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
@@ -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 |
There was a problem hiding this comment.
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
/integrate |
Going to push as commit 379c3f9.
Your commit was automatically rebased without conflicts. |
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
Issue
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