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
No related branches found
No related tags found
No related merge requests found
...@@ -85,28 +85,27 @@ public class TrayIconScalingTest { ...@@ -85,28 +85,27 @@ public class TrayIconScalingTest {
System.out.println("SystemTray is not supported"); System.out.println("SystemTray is not supported");
return; return;
} }
PassFailJFrame passFailJFrame = PassFailJFrame.builder()
createAndShowTrayIcon();
try {
PassFailJFrame.builder()
.title("TrayIcon Test Instructions") .title("TrayIcon Test Instructions")
.instructions(INSTRUCTIONS) .instructions(INSTRUCTIONS)
.testTimeOut(8) .testTimeOut(8)
.rows(25) .rows(25)
.columns(70) .columns(70)
.screenCapture() .screenCapture()
.build(); .build()
.awaitAndCheck();
createAndShowGUI();
// does not have a test window,
// hence only the instruction frame is positioned
PassFailJFrame.positionTestWindow(null,
PassFailJFrame.Position.HORIZONTAL);
try {
passFailJFrame.awaitAndCheck();
} finally { } finally {
if (tray != null) {
tray.remove(icon); tray.remove(icon);
} }
} }
}
private static void createAndShowGUI() { private static void createAndShowTrayIcon() {
ArrayList<Image> imageList = new ArrayList<>(); ArrayList<Image> imageList = new ArrayList<>();
for (int size = 16; size <= 48; size += 4) { for (int size = 16; size <= 48; size += 4) {
imageList.add(createIcon(size)); imageList.add(createIcon(size));
...@@ -120,7 +119,7 @@ public class TrayIconScalingTest { ...@@ -120,7 +119,7 @@ public class TrayIconScalingTest {
try { try {
tray.add(icon); tray.add(icon);
} catch (AWTException e) { } 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