RFR: 8282270: java/awt/Robot Screen Capture tests fail after 8280861 [v3]
Maxim Kartashev
duke at openjdk.java.net
Wed Mar 16 06:54:54 UTC 2022
On Tue, 15 Mar 2022 17:38:37 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:
> The test is run on Linux, so it makes sense to keep Linux in the summary.
True; will rectify that.
> Why do you remove 8280861 from the list of bugs?
While the test technically executes the lines of code changed for 8280861, I cannot imagine a scenario where this test would fail without the 8280861 fix and wouldn't fail with this fix.
> test/jdk/java/awt/Robot/HiDPIScreenCapture/HiDPIRobotScreenCaptureTest.java line 66:
>
>> 64:
>> 65: Frame frame = new Frame();
>> 66: frame.setBounds(83, 97, 100, 100);
>
> Does it make sense to preserve the comment? It explain the rationale for using the prime numbers as coordinates. The location remains unchanged, so the comment applies.
Yes, I guess so. Will reinstate the comment.
> test/jdk/java/awt/Robot/HiDPIScreenCapture/ScreenCaptureGtkTest.java line 68:
>
>> 66: // by the system because that area's occupied by the global
>> 67: // menu bar and such.
>> 68: frame.setBounds(89, 99, 100, 100);
>
> 99 is not a prime number. Is it intentional?
Now that there's an offset within the frame, the numbers should take that into account: (50+89)==139 and (50+99)==149 and these are prime numbers.
> test/jdk/java/awt/Robot/HiDPIScreenCapture/ScreenCaptureGtkTest.java line 84:
>
>> 82: for (int i = 1; i < 4; i++) {
>> 83: g.setColor(COLORS[i]);
>> 84: g.fillRect(leftOffset + i, topOffset, 1, 1);
>
> May I suggest using `COLORS.length` instead of 4 in the for-loops for painting and checking?
Sure. Will fix that.
-------------
PR: https://git.openjdk.java.net/jdk/pull/7613
More information about the client-libs-dev
mailing list