Skip to content

Commit

Permalink
8341037: Use standard layouts in DefaultFrameIconTest.java and MenuCr…
Browse files Browse the repository at this point in the history
…ash.java

Reviewed-by: azvegint, prr
  • Loading branch information
aivanov-jdk committed Oct 2, 2024
1 parent 76283dd commit c43202b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 22 deletions.
12 changes: 1 addition & 11 deletions test/jdk/java/awt/Frame/DefaultFrameIconTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,11 @@ public static void main(String[] args) throws Exception {
.instructions(INSTRUCTIONS)
.columns(45)
.testUI(DefaultFrameIconTest::createAndShowUI)
.positionTestUI(DefaultFrameIconTest::positionTestWindows)
.positionTestUIRightRow()
.build()
.awaitAndCheck();
}

private static void positionTestWindows(List<? extends Window> testWindows,
PassFailJFrame.InstructionUI instructionUI) {
int gap = 5;
int x = instructionUI.getLocation().x + instructionUI.getSize().width + gap;
for (Window w : testWindows) {
w.setLocation(x, instructionUI.getLocation().y);
x += w.getWidth() + gap;
}
}

private static List<Window> createAndShowUI() {
Frame testFrame = new Frame("Frame DefaultFrameIconTest");
Dialog testDialog = new Dialog(testFrame, "Dialog DefaultFrameIconTest");
Expand Down
12 changes: 1 addition & 11 deletions test/jdk/java/awt/Frame/MenuCrash.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public static void main(String[] args) throws Exception {
.instructions(INSTRUCTIONS)
.columns(45)
.testUI(MenuCrash::createAndShowUI)
.positionTestUI(MenuCrash::positionTestWindows)
.positionTestUIRightRow()
.build()
.awaitAndCheck();
}
Expand All @@ -81,16 +81,6 @@ private static List<Window> createAndShowUI() {
return List.of(frame1, frame2);
}

private static void positionTestWindows(List<? extends Window> testWindows,
PassFailJFrame.InstructionUI instructionUI) {
int gap = 5;
int x = instructionUI.getLocation().x + instructionUI.getSize().width + gap;
for (Window w : testWindows) {
w.setLocation(x, instructionUI.getLocation().y);
x += w.getWidth() + gap;
}
}

static class MenuFrame extends Frame {
private final TextField field;

Expand Down

5 comments on commit c43202b

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GoeLin
Copy link
Member

@GoeLin GoeLin commented on c43202b Jan 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk21u-dev

@GoeLin
Copy link
Member

@GoeLin GoeLin commented on c43202b Jan 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk17u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on c43202b Jan 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GoeLin the backport was successfully created on the branch backport-GoeLin-c43202ba-master in my personal fork of openjdk/jdk21u-dev. To create a pull request with this backport targeting openjdk/jdk21u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit c43202ba from the openjdk/jdk repository.

The commit being backported was authored by Alexey Ivanov on 2 Oct 2024 and was reviewed by Alexander Zvegintsev and Phil Race.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk21u-dev:

$ git fetch https://github.com/openjdk-bots/jdk21u-dev.git backport-GoeLin-c43202ba-master:backport-GoeLin-c43202ba-master
$ git checkout backport-GoeLin-c43202ba-master
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk21u-dev.git backport-GoeLin-c43202ba-master

@openjdk
Copy link

@openjdk openjdk bot commented on c43202b Jan 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GoeLin the backport was successfully created on the branch backport-GoeLin-c43202ba-master in my personal fork of openjdk/jdk17u-dev. To create a pull request with this backport targeting openjdk/jdk17u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit c43202ba from the openjdk/jdk repository.

The commit being backported was authored by Alexey Ivanov on 2 Oct 2024 and was reviewed by Alexander Zvegintsev and Phil Race.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk17u-dev:

$ git fetch https://github.com/openjdk-bots/jdk17u-dev.git backport-GoeLin-c43202ba-master:backport-GoeLin-c43202ba-master
$ git checkout backport-GoeLin-c43202ba-master
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk17u-dev.git backport-GoeLin-c43202ba-master

Please sign in to comment.