< prev index next >

test/javax/swing/plaf/aqua/CustomComboBoxFocusTest.java

Print this page

        

@@ -20,13 +20,15 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
 
 /* @test
-   @bug     8073001
+   @bug     8073001 8081764
    @summary Test verifies that combo box with custom editor renders
             focus ring around arrow button correctly.
+   @library /lib/testlibrary
+   @build jdk.testlibrary.OSInfo
    @run     main CustomComboBoxFocusTest
 */
 
 import java.awt.AWTException;
 import java.awt.Component;

@@ -48,17 +50,25 @@
 import javax.swing.JFrame;
 import javax.swing.JLabel;
 import javax.swing.JPanel;
 import javax.swing.JTextField;
 import javax.swing.SwingUtilities;
+import jdk.testlibrary.OSInfo;
+import javax.swing.*;
 
 public class CustomComboBoxFocusTest {
 
+    private static Class lafClass;
     private static CustomComboBoxFocusTest test = null;
 
-    public static void main(String[] args) {
-
+    public static void main(String[] args) throws Exception {
+        if (OSInfo.getOSType() != OSInfo.OSType.MACOSX) {
+            System.out.println("Only Mac platform test. Test is skipped for other OS.");
+            return;
+        }
+        lafClass = Class.forName(UIManager.getSystemLookAndFeelClassName());
+        UIManager.setLookAndFeel((LookAndFeel) lafClass.newInstance());
         try {
             SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
                     test = new CustomComboBoxFocusTest();
                 }
< prev index next >