On Fri, 5 Apr 2024 19:47:23 GMT, Abhishek Kumar <abhis...@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.
>
> Abhishek Kumar has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Review comment update

test/jdk/javax/swing/JComboBox/DisabledComboBoxFontTestAuto.java line 40:

> 38: import static java.awt.image.BufferedImage.TYPE_INT_ARGB;
> 39: 
> 40: /*

Usually we keep jtreg comment section before imports.

test/jdk/javax/swing/JComboBox/DisabledComboBoxFontTestAuto.java line 58:

> 56: 
> 57:     private static void createCombo() {
> 58:         combo = new JComboBox();

If we can use unicode blank character instead of "Simple JComboBox" text. I 
think we make this test more robust and avoid tolerance checks.

test/jdk/javax/swing/JComboBox/DisabledComboBoxFontTestAuto.java line 101:

> 99:         ImageIO.write(enabledImage2, "png", new File(testDir
> 100:                 + "/" + lafName + "EnabledDLCR.png"));
> 101:         ImageIO.write(disabledImage2, "png", new File(testDir

We are saving these images even in the case where test passes. In my local 
macOS run i see 16 images getting saved in JTwork folder. This will end up 
taking good amount of space in our CI test systems.

We should save image only in case of test failure foe debugging purpose.

Also i see images with `Mac OS X***.png` filename and all of them are just 
blank and there is no combobox. Is that fine?

test/jdk/javax/swing/JComboBox/DisabledComboBoxFontTestAuto.java line 125:

> 123:                 dColor2 = new Color(disabledImage2.getRGB(x + 1, y - 1));
> 124:             } else if (lafName.equals("GTK+")) {
> 125:                 // In GTK LAF, the ComboBox sizes are different and

Is there any way to get these internal offsets programmatically and not use 
constants?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/18644#discussion_r1565382137
PR Review Comment: https://git.openjdk.org/jdk/pull/18644#discussion_r1565390546
PR Review Comment: https://git.openjdk.org/jdk/pull/18644#discussion_r1565387866
PR Review Comment: https://git.openjdk.org/jdk/pull/18644#discussion_r1565393803

Reply via email to