-
Notifications
You must be signed in to change notification settings - Fork 6.2k
JDK-8371365 : Update javax/swing/JFileChooser/bug4759934.java to use Util.findComponent() #28169
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
Closed
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
#27944 (comment)
This is more reliable and quicker than robot.
The only possible issue is to to ensure the updated test still reproduces the original bug.
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 just noticed your comment: #27944 (comment)
“…Since we have reference to these buttons,” it's even easier to call
frameBtn.doClick()anddlgBtnLoc.doClick().Once you get the reference to the Cancel button in the file chooser you can also use robot to click the button.
Using consistently the same method to click the buttons makes the test easier to comprehend.
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 referred to the original JBS issue for which this test was created - JDK-4759934. Looks like we can use doClick() instead of using Robot for the clicks.
But the problem is that when we use doClick() for frameBtn and dialogBtn, JFC's click on Cancel button doesn't happen and the test fails due to timeout. This happens on macOS26, I have to test on other platforms.
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 see… It may be not worth the effort then.
However, this behaviour — clicking the Cancel button doesn't happen — could be a bug.
Why does the test time out? Even if clicking the Cancel button didn't work, the test should finish with a failure.
Uh oh!
There was an error while loading. Please reload this page.
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 the test hangs after - dialogBtn.doClick() and does not proceed to the test condition check. I'll need to check in depth as to why this is happening.
I can create a separate JBS issue to look into it and as for the test changes use the doClick() for just the JFC's Cancel button. Does this sound good to you?
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.
This is likely the best approach.
It's a new problem that we discovered. It doesn't prevent integrating the change to search for the Cancel button in the file chooser, yet it would be good to investigate what goes wrong when all the buttons are clicked programmatically instead of using the robot to generate mouse clicks.
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.
Created a new JBS to track the doClick() issue - JDK-8371728