RFR: 8310072: JComboBox/DisabledComboBoxFontTestAuto: Enabled and disabled ComboBox does not match in these LAFs: GTK+
Damon Nguyen
dnguyen at openjdk.org
Fri Apr 5 18:29:12 UTC 2024
On Fri, 5 Apr 2024 06:54:46 GMT, Abhishek Kumar <abhiscxk at openjdk.org> wrote:
> Test was failing on GTK and Windows LAF due to pixel color mismatch. Th reason behind this issue was the size of image which is different and that results in incorrect pixel comparison. Fix is to ensure that correct pixel is matched and the pixel color should remain within tolerance.
> For windows LAF the background color is not an exact match and thus added a TOLERANCE field to check if the RGB difference is within limits.
>
> `@key headful` added in jtreg tag to ensure that test run for GTK LAF as well which was not the case before as it is mentioned in JBS `It does not fail in mach5 because on linux + headless mode the gtk L&F is not supported.`
>
> CI testing is green for the modified test. Link attached in JBS.
Changes requested by dnguyen (Committer).
test/jdk/javax/swing/JComboBox/DisabledComboBoxFontTestAuto.java line 132:
> 130: eColor2 = new Color(enabledImage2.getRGB(x + 10, y + 2));
> 131: dColor1 = new Color(disabledImage.getRGB(x, y));
> 132: dColor2 = new Color(disabledImage2.getRGB(x + 10, y + 2));
I noticed with these components, sometimes the size varies slightly between different desktop scaling values or resolutions. You have exact combobox pixel sizes in the comments, but does this stay the same when you set your device to 200% or other values?
Maybe best to leave out the exact combo size from the comments regardless.
test/jdk/javax/swing/JComboBox/DisabledComboBoxFontTestAuto.java line 144:
> 142: }
> 143: }
> 144: System.out.println("Test Passed: "+lafName);
Suggestion:
System.out.println("Test Passed: " + lafName);
test/jdk/javax/swing/JComboBox/DisabledComboBoxFontTestAuto.java line 150:
> 148: int redDiff = c1.getRed() - c2.getRed();
> 149: int blueDiff = c1.getBlue() - c2.getBlue();
> 150: int greenDiff = c1.getGreen() - c2.getGreen();
Does this need Math.abs to get the absolute value of the difference?
-------------
PR Review: https://git.openjdk.org/jdk/pull/18644#pullrequestreview-1983854777
PR Review Comment: https://git.openjdk.org/jdk/pull/18644#discussion_r1554097166
PR Review Comment: https://git.openjdk.org/jdk/pull/18644#discussion_r1554089283
PR Review Comment: https://git.openjdk.org/jdk/pull/18644#discussion_r1554092528
More information about the client-libs-dev
mailing list