Skip to content
Snippets Groups Projects
Commit f8a119b5 authored by Goetz Lindenmaier's avatar Goetz Lindenmaier
Browse files

8327924: Simplify TrayIconScalingTest.java

Backport-of: 1496b5de9004c6a9e43ead5f6e9e88362028a7cc
parent 915cc663
Branches
Tags
No related merge requests found
......@@ -85,28 +85,27 @@ public class TrayIconScalingTest {
System.out.println("SystemTray is not supported");
return;
}
PassFailJFrame passFailJFrame = PassFailJFrame.builder()
createAndShowTrayIcon();
try {
PassFailJFrame.builder()
.title("TrayIcon Test Instructions")
.instructions(INSTRUCTIONS)
.testTimeOut(8)
.rows(25)
.columns(70)
.screenCapture()
.build();
createAndShowGUI();
// does not have a test window,
// hence only the instruction frame is positioned
PassFailJFrame.positionTestWindow(null,
PassFailJFrame.Position.HORIZONTAL);
try {
passFailJFrame.awaitAndCheck();
.build()
.awaitAndCheck();
} finally {
if (tray != null) {
tray.remove(icon);
}
}
}
private static void createAndShowGUI() {
private static void createAndShowTrayIcon() {
ArrayList<Image> imageList = new ArrayList<>();
for (int size = 16; size <= 48; size += 4) {
imageList.add(createIcon(size));
......@@ -120,7 +119,7 @@ public class TrayIconScalingTest {
try {
tray.add(icon);
} catch (AWTException e) {
throw new RuntimeException("Error while adding icon to system tray");
throw new RuntimeException("Error while adding icon to system tray", e);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment