RFR: 8359061: Update and ProblemList manual test java/awt/Cursor/CursorDragTest/ListDragCursor.java [v5]

Alexey Ivanov aivanov at openjdk.org
Tue Jun 17 15:15:36 UTC 2025


On Fri, 13 Jun 2025 17:11:17 GMT, Damon Nguyen <dnguyen at openjdk.org> wrote:

>> This change is to restore the original intent of the test by updating the instructions to check that the type of Cursor is preserved when clicked and dragged. Now the test correctly has instructions to check that an I-beam cursor stays an I-beam until released over a List with its cursor being updated to a Hand cursor.
>> 
>> There is a bug where this does not correctly update in macOS (found in [JDK-7177297](https://bugs.openjdk.org/browse/JDK-7177297)). So, this test needs to be problem-listed.
>> 
>> I have confirmed that preserving the cursor image when dragging is native behavior across macOS, Windows, and Ubuntu. And I have checked that the test passes on both Windows and Ubuntu, while macOS fails and immediately updates the cursor as it leaves the TextArea.
>
> Damon Nguyen has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Rearrange and update test.

Changes requested by aivanov (Reviewer).

test/jdk/java/awt/Cursor/CursorDragTest/ListDragCursor.java line 44:

> 42:     static Frame testFrame;
> 43:     static Frame instructionsFrame;
> 44:     static CountDownLatch countDownLatch;

Suggestion:

    private static final CountDownLatch countDownLatch = new CountDownLatch(1);

test/jdk/java/awt/Cursor/CursorDragTest/ListDragCursor.java line 57:

> 55: 
> 56:     static void createTestFrame() {
> 57:         Frame frame = new Frame("Cursor change after drag");

You didn't assign it to `testFrame`, therefore this frame is never disposed of, and the test doesn't exit cleanly if run without jtreg.

In fact, I suggest returning the frame from `createTestFrame` and assigning it to the variable in the `main` method in the lambda expression that calls the method. The same applies to the `createInstructionsFrame` method.

test/jdk/java/awt/Cursor/CursorDragTest/ListDragCursor.java line 80:

> 78: 
> 79:     static void createInstructionsFrame() {
> 80:         String instructions = """

I suggest moving the instructions outside of method and placing at the top of the file as static constant.

test/jdk/java/awt/Cursor/CursorDragTest/ListDragCursor.java line 91:

> 89:                 left mouse button. Immediately after, the cursor
> 90:                 should change to a Hand cursor. If true, this test
> 91:                 passes.

I still see different behaviour on macOS. For me, the cursor remains I-beam over the text area, then it changes to the arrow when the mouse hovers over the scrollbars, and immediately changes to the hand as soon as it enter the list.

I observe the same behaviour with `PassFailJFrame` on macOS.

test/jdk/java/awt/Cursor/CursorDragTest/ListDragCursor.java line 105:

> 103:         Panel btnPanel = new Panel();
> 104:         Button passBtn = new Button("PASS");
> 105:         Button failBtn = new Button("FAIL");

Suggestion:

        Button passBtn = new Button("Pass");
        Button failBtn = new Button("Fail");

There's no reason ‘scream’.

test/jdk/java/awt/Cursor/CursorDragTest/ListDragCursor.java line 121:

> 119:         instructionsFrame.pack();
> 120:         instructionsFrame.setLocation(300, 100);
> 121:         instructionsFrame.setVisible(true);

I suggest displaying the frame in the centre of the screen


instructionsFrame.setLocationRelativeTo(null);


and then position the test frame to the right of the instruction frame. This would align to the most common layout of manual tests and would adjust positioning to the size of the current screen.

Create the instruction frame first to be able to use its location to position the test frame.

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

PR Review: https://git.openjdk.org/jdk/pull/25705#pullrequestreview-2935842249
PR Review Comment: https://git.openjdk.org/jdk/pull/25705#discussion_r2152379965
PR Review Comment: https://git.openjdk.org/jdk/pull/25705#discussion_r2152508702
PR Review Comment: https://git.openjdk.org/jdk/pull/25705#discussion_r2152463455
PR Review Comment: https://git.openjdk.org/jdk/pull/25705#discussion_r2152524180
PR Review Comment: https://git.openjdk.org/jdk/pull/25705#discussion_r2152474594
PR Review Comment: https://git.openjdk.org/jdk/pull/25705#discussion_r2152491026


More information about the client-libs-dev mailing list