8169043: The task bar icon color is not blue
authoraghaisas
Fri, 11 Nov 2016 12:40:59 +0530
changeset 42210 7acd39aaf16f
parent 42209 2b05a23bc5ee
child 42211 ac4e6dc2d20f
8169043: The task bar icon color is not blue Reviewed-by: serb, arapte Contributed-by: ajit.ghaisas@oracle.com
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
-                    = "<html>    INSTRUCTIONS:<br><br>"
+                    = "<html>    INSTRUCTIONS:<br>"
+                    + "This test is for Windows OS only.<br>"
+                    + "Make sure that 'Use Small Icons' setting is not set<br>"
+                    + "on Windows Taskbar Properties <br>"
                     + "1) Test frame title icon and frame color should be green."
                     + "<br>"
                     + "2) Test frame task bar icon should be blue<br>"
@@ -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();
     }
 }