RFR: 8297095: Write a test to determine the quit request of the application

Harshitha Onkar honkar at openjdk.org
Wed Nov 23 18:41:23 UTC 2022


On Wed, 23 Nov 2022 16:59:05 GMT, Naveen Narayanan <duke at openjdk.org> wrote:

> This testcase will
> 1) Verify the handleQuitRequestWith() method of QuitHandler interface.
> 2) Check that the response is passed to the handler by means of quit notification generated by a key combination of META+Q (Mac) or ALT+F4(Windows & Linux).
> 3) Confirm that the active window is closed.
> 
> Testing:
> Tested using Mach5(20 times per platform) in Mac OS, Linux and Windows and got all pass.

Changes requested by honkar (Author).

test/jdk/java/awt/Desktop/ActiveWindowCloseTest.java line 2:

> 1: 
> 2: /* Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.

If this is a newly created test, then the copyright should contain only the present year.

test/jdk/java/awt/Desktop/ActiveWindowCloseTest.java line 23:

> 21:  * questions.
> 22:  */
> 23: import java.awt.AWTException;

Minor nit: Please add a newline between copyright header and import statements.

test/jdk/java/awt/Desktop/ActiveWindowCloseTest.java line 108:

> 106:                             robot.keyRelease(KeyEvent.VK_ALT);
> 107:                         }
> 108:                         robot.waitForIdle();

Adding an additional delay (`robot.delay(200)`) will make sure that all the preceding events are processed.

test/jdk/java/awt/Desktop/ActiveWindowCloseTest.java line 123:

> 121:         }
> 122:     }
> 123: 

Minor nit: extra newline before closing brace can be removed.

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

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



More information about the client-libs-dev mailing list