On Tue, 16 Apr 2024 04:16:26 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, tolerance check removed test/jdk/javax/swing/JComboBox/DisabledComboBoxFontTestAuto.java line 125: > 123: private static boolean isColorMatching(Color c1, Color c2) { > 124: if ((c1.getRed() != c2.getRed()) > 125: || (c1.getBlue() != c2.getBlue()) This condition can be optimized since the test is done for all LAF and for each this method is called twice. Instead of using ||, using && would optimized slightly. You can check for `true` where it checks for `==` and returns true. Its just a suggestion. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/18644#discussion_r1568197384