8273043: [TEST_BUG] Automate NimbusJTreeSelTextColor.java#5269
8273043: [TEST_BUG] Automate NimbusJTreeSelTextColor.java#5269aivanov-jdk wants to merge 4 commits intoopenjdk:masterfrom
Conversation
|
👋 Welcome back aivanov! A progress list of the required criteria for merging this PR into |
|
@aivanov-jdk The following label will be automatically applied to this pull request:
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. |
Webrevs
|
| treeBounds.x += iconOffset; | ||
| treeBounds.width -= iconOffset; | ||
| treeBounds.width -= 2; // crop selection border on the right | ||
| BufferedImage image = robot.createScreenCapture(treeBounds); |
There was a problem hiding this comment.
Can we skip the usage of the robot and render it directly to the buffered image? probably this will allow running the test in a headless envirement?
There was a problem hiding this comment.
I thought about it yet I didn't try that. It should work. Moreover, the test fails on macOS because the UI gets scaled, rendering to BufferedImage directly could avoid this problem.
|
I assume you must have tested this on headless environment and it must have passed. But is it really necessary to make this headless as we are showing JFrame and setting L&F. I mean these things mostly associate with headful environment. |
Yes, the test passes. The only exception is macOS: the test fails there either way because the text is rendered with antialiasing and I can't disable font smoothing on macOS. Does anyone know how to disable it? I'm thinking about skipping macOS altogher.
We're not showing the frame unless There are more headless hosts which can run the test, so a headless test could be run easier and faster than a headful one. |
You can try to change the foregound color in the Nimbus defaults then render it, then compare the part of the images which have the text. If the images are identical then your color was ignored and the bug exists. |
This should work, however, I think it's not worth the effort. Changing the defaults and comparing the two images entirely will make the test more complicated. Nimbus is a platform-independent Look and Feel, the issue is not specific to macOS. The problem is caught on Windows and Linux where one can easily disable text anti-aliasing. |
|
@aivanov-jdk 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 61 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 |
|
/integrate |
|
Going to push as commit 270a9d9.
Your commit was automatically rebased without conflicts. |
|
@aivanov-jdk Pushed as commit 270a9d9. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Automated NimbusJTreeSelTextColor.java test which is added under JDK-8271315.
It passes with the recent build of JDK 18.
It fails with JDK 18 build 7 where JDK-8266510 is not fixed yet:
The line is wrapped for readability. In this case the text is black instead of white.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/5269/head:pull/5269$ git checkout pull/5269Update a local copy of the PR:
$ git checkout pull/5269$ git pull https://git.openjdk.java.net/jdk pull/5269/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 5269View PR using the GUI difftool:
$ git pr show -t 5269Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/5269.diff