# HG changeset patch
# User aghaisas
# Date 1478848259 -19800
# Node ID 7acd39aaf16f194e32aa467a8e731240504e135b
# Parent 2b05a23bc5ee2af9783a832fb76189d7d19b9947
8169043: The task bar icon color is not blue
Reviewed-by: serb, arapte
Contributed-by: ajit.ghaisas@oracle.com
diff -r 2b05a23bc5ee -r 7acd39aaf16f jdk/test/java/awt/image/multiresolution/MultiResolutionIcon/MultiResIconTest.java
--- a/jdk/test/java/awt/image/multiresolution/MultiResolutionIcon/MultiResIconTest.java Thu Nov 10 12:23:14 2016 +0530
+++ b/jdk/test/java/awt/image/multiresolution/MultiResolutionIcon/MultiResIconTest.java Fri Nov 11 12:40:59 2016 +0530
@@ -24,9 +24,10 @@
/**
* @test
* @key headful
- * @bug 8149371
+ * @bug 8149371 8169043
* @summary multi-res. image: -Dsun.java2d.uiScale does not work for Window
* icons (some ambiguity for Window.setIconImages()?)
+ * @requires (os.family == "windows")
* @run main/othervm/manual -Dsun.java2d.uiScale=2 MultiResIconTest
*/
import java.awt.Color;
@@ -58,6 +59,7 @@
private static JDialog f;
private static CountDownLatch latch;
private static TestFrame frame;
+ private static boolean testPassed;
private static BufferedImage generateImage(int x, Color c) {
@@ -70,12 +72,13 @@
return img;
}
- public MultiResIconTest() {
- try {
- latch = new CountDownLatch(1);
- createUI();
- latch.await();
- } catch (Exception ex) {
+ public MultiResIconTest() throws Exception {
+ latch = new CountDownLatch(1);
+ createUI();
+ latch.await();
+
+ if (!testPassed) {
+ throw new RuntimeException("User Pressed Failed Button");
}
}
@@ -89,7 +92,10 @@
resultButtonPanel = new JPanel(layout);
GridBagConstraints gbc = new GridBagConstraints();
String instructions
- = " INSTRUCTIONS:
"
+ = " INSTRUCTIONS:
"
+ + "This test is for Windows OS only.
"
+ + "Make sure that 'Use Small Icons' setting is not set
"
+ + "on Windows Taskbar Properties
"
+ "1) Test frame title icon and frame color should be green."
+ "
"
+ "2) Test frame task bar icon should be blue
"
@@ -106,6 +112,7 @@
passButton = new JButton("Pass");
passButton.setActionCommand("Pass");
passButton.addActionListener((ActionEvent e) -> {
+ testPassed = true;
latch.countDown();
f.dispose();
frame.dispose();
@@ -115,6 +122,7 @@
failButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
+ testPassed = false;
latch.countDown();
f.dispose();
frame.dispose();
@@ -140,6 +148,7 @@
f.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
+ testPassed = false;
latch.countDown();
f.dispose();
frame.dispose();
@@ -191,7 +200,7 @@
}
}
- public static void main(String[] args) {
+ public static void main(String[] args) throws Exception {
new MultiResIconTest();
}
}