RFR: JDK-8290469: Add new positioning options to PassFailJFrame test framework [v6]

Alexey Ivanov aivanov at openjdk.org
Fri Aug 5 19:21:23 UTC 2022


On Fri, 5 Aug 2022 17:42:03 GMT, Harshitha Onkar <honkar at openjdk.org> wrote:

>> Additional position setting (TOP_LEFT_CORNER) and a method to obtain bounds of test instruction frame are added to PassFailJFrame to handle positioning of multiple test frames.
>> 
>> In scenarios where multiple test windows might be present, the test windows might overlap the instruction frame. In order to fix this TOP_LEFT_CORNER position option is added that positions the test instruction frame at top left corner with main test window below it.
>> 
>> Additionally `getInstructionFrameBounds()` is added to obtain the position and dimensions of test instruction frame.
>
> Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision:
> 
>   added null check in positionWindow

test/jdk/java/awt/regtesthelpers/PassFailJFrame.java line 297:

> 295:                 .getDefaultScreenDevice().getDefaultConfiguration();
> 296:         Insets screenInsets = Toolkit.getDefaultToolkit().getScreenInsets(gc);
> 297: 

I suggest separating the logic to calculate coordinates into a separate function, or save them into a local variable.

Then call `sync` and `sleep`. Or this sequence could be extracted into its own helper method to avoid code duplication, it's repeated at least twice.

Shall this method call `window.setVisible(true)` automatically?

test/jdk/java/awt/regtesthelpers/PassFailJFrame.java line 309:

> 307:             } catch (InterruptedException e) {
> 308:                 e.printStackTrace();
> 309:             }

Is it safe to call on EDT?

If `positionTestWindow` is not to be called on EDT, should it be enforced?

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

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



More information about the client-libs-dev mailing list