RFR: 8287912: GTK L&F : Background of tree icons are red [v2]

Abhishek Kumar duke at openjdk.org
Fri Sep 2 07:23:41 UTC 2022


On Fri, 2 Sep 2022 01:14:10 GMT, Damon Nguyen <dnguyen at openjdk.org> wrote:

>> test/jdk/javax/swing/JTree/TestTreeBackgroundColor.java line 81:
>> 
>>> 79:                     if (c.equals(Color.RED)) {
>>> 80:                         passed = true;
>>> 81:                     }
>> 
>> better to check at midpoint tree.width/2, tree.height/2 and also break if it's RED, no need to check all pixels.
>
> Another possible solution that I used in a previous test was a midpoint as suggested, but also one pixel near each edge. This eliminates the chance of the red still existing but not being detected at the midpoint because the red is at a different location.

The test check has been changed to compare the pixels of entire width keeping the height constant to half of tree height. Now it will check pixel color and if it is not red , the test will fail.

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

PR: https://git.openjdk.org/jdk/pull/10112



More information about the client-libs-dev mailing list