8327924: Simplify TrayIconScalingTest.java
Reviewed-by: honkar, prr
This commit is contained in:
parent
16ed191329
commit
1496b5de90
@ -85,28 +85,27 @@ public class TrayIconScalingTest {
|
||||
System.out.println("SystemTray is not supported");
|
||||
return;
|
||||
}
|
||||
PassFailJFrame passFailJFrame = 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);
|
||||
createAndShowTrayIcon();
|
||||
|
||||
try {
|
||||
passFailJFrame.awaitAndCheck();
|
||||
PassFailJFrame.builder()
|
||||
.title("TrayIcon Test Instructions")
|
||||
.instructions(INSTRUCTIONS)
|
||||
.testTimeOut(8)
|
||||
.rows(25)
|
||||
.columns(70)
|
||||
.screenCapture()
|
||||
.build()
|
||||
.awaitAndCheck();
|
||||
} finally {
|
||||
tray.remove(icon);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user