changeset 16128:1540bede9ab5

8169043: The task bar icon color is not blue Reviewed-by: serb, arapte Contributed-by: ajit.ghaisas@oracle.com
author aghaisas
date Fri, 11 Nov 2016 12:40:59 +0530
parents 82f3b9ffb0f4
children 987287105ea5
files test/java/awt/image/multiresolution/MultiResolutionIcon/MultiResIconTest.java
diffstat 1 files changed, 18 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/test/java/awt/image/multiresolution/MultiResolutionIcon/MultiResIconTest.java	Thu Nov 10 12:23:14 2016 +0530
+++ b/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();
     }
 }