RFR: 8340494: Open some dialog awt tests 4 [v3]

Damon Nguyen dnguyen at openjdk.org
Tue Oct 15 21:17:15 UTC 2024


On Tue, 15 Oct 2024 20:08:58 GMT, Alisen Chung <achung at openjdk.org> wrote:

>> Fifth set of swing test to open for fall 2024 test sprint
>
> Alisen Chung has updated the pull request incrementally with one additional commit since the last revision:
> 
>   dispose frames

test/jdk/java/awt/Container/ActivateOnFocusTest.java line 97:

> 95:         mc2 = new MyComponent(Color.blue);
> 96:         add(mc2);
> 97:         addWindowListener(this);

Suggestion:

        addWindowListener(new WindowAdapter() {
            @Override
            public void windowActivated(WindowEvent e) {
                mc1.requestFocusInWindow();
            }

            @Override
            public void windowDeactivated(WindowEvent e) {
                mc2.requestFocusInWindow();
            }
        });


Probably better to create a WindowAdapter here to avoid needing those empty WindowListener methods. Remove the `implements WindowListener` as well though. Tested and still works.

test/jdk/java/awt/Container/MouseEnteredTest.java line 91:

> 89:             EventQueue.invokeAndWait(() -> {
> 90:                 test = new MouseEnteredTest();
> 91:             });

Suggestion:

            EventQueue.invokeAndWait(() -> test = new MouseEnteredTest());

Lambda

test/jdk/java/awt/Dialog/ModalExcludedTest.java line 138:

> 136: 
> 137:         Button b = new Button("Modal dialog w/o modal excluded");
> 138:         b.addActionListener(new ActionListener() {

Suggestion:

        b.addActionListener(ev -> {

Lambda

test/jdk/java/awt/Dialog/ModalExcludedTest.java line 195:

> 193:                 dd.setVisible(true);
> 194:                 // dialog should be modal excluded as being a child of the modal excluded frame
> 195:                 //          SunToolkit.setModalExcluded(dd);

Is this meant to still be here?

test/jdk/java/awt/Dialog/ModalExcludedTest.java line 289:

> 287:                 dd.setVisible(true);
> 288:                 // dialog should be modal excluded as being child of modal excluded frame
> 289:                 //          SunToolkit.setModalExcluded(dd);

Same here.

test/jdk/java/awt/Dialog/ModalExcludedTest.java line 320:

> 318:                 dd.setVisible(true);
> 319:                 // dialog should be modal excluded as being child of modal excluded frame
> 320:                 //          SunToolkit.setModalExcluded(dd);

And here.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21479#discussion_r1802022645
PR Review Comment: https://git.openjdk.org/jdk/pull/21479#discussion_r1802025106
PR Review Comment: https://git.openjdk.org/jdk/pull/21479#discussion_r1802027553
PR Review Comment: https://git.openjdk.org/jdk/pull/21479#discussion_r1802027799
PR Review Comment: https://git.openjdk.org/jdk/pull/21479#discussion_r1802027973
PR Review Comment: https://git.openjdk.org/jdk/pull/21479#discussion_r1802028127


More information about the client-libs-dev mailing list