8213116: javax/swing/JComboBox/WindowsComboBoxSize/WindowsComboBoxSizeTest.java fails in Windows
authorpsadhukhan
Thu, 08 Nov 2018 12:09:06 +0530
changeset 52541 7f67b8184ffc
parent 52540 a00f1403dbe9
child 52542 8c7638601045
8213116: javax/swing/JComboBox/WindowsComboBoxSize/WindowsComboBoxSizeTest.java fails in Windows Reviewed-by: prr
src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsComboBoxUI.java
test/jdk/ProblemList.txt
test/jdk/javax/swing/JComboBox/WindowsComboBoxSize/WindowsComboBoxSizeTest.java
--- a/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsComboBoxUI.java	Tue Nov 06 17:57:17 2018 -0800
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsComboBoxUI.java	Thu Nov 08 12:09:06 2018 +0530
@@ -344,7 +344,11 @@
             if (c instanceof JComboBox) {
                 isEditable = ((JComboBox) c).isEditable();
             }
-            d.height += isEditable ? 4 : 6;
+            if (((JComboBox)c).getBorder() instanceof EmptyBorder) {
+                d.height += isEditable ? 2 : 4;
+            } else {
+                d.height += isEditable ? 4 : 6;
+            }
         } else {
             d.width += 4;
             d.height += 2;
--- a/test/jdk/ProblemList.txt	Tue Nov 06 17:57:17 2018 -0800
+++ b/test/jdk/ProblemList.txt	Thu Nov 08 12:09:06 2018 +0530
@@ -818,7 +818,6 @@
 javax/swing/JPopupMenu/8075063/ContextMenuScrollTest.java 202880 linux-all
 javax/swing/dnd/8139050/NativeErrorsInTableDnD.java 8202765  macosx-all,linux-all
 javax/swing/Popup/TaskbarPositionTest.java 8065097 macosx-all,linux-all
-javax/swing/JComboBox/WindowsComboBoxSize/WindowsComboBoxSizeTest.java 8213116 windows-all
 javax/swing/GraphicsConfigNotifier/StalePreferredSize.java 8213121 macosx-all
 javax/swing/JButton/4368790/bug4368790.java 8213123 macosx-all
 javax/swing/JEditorPane/6917744/bug6917744.java 8213124 macosx-all
--- a/test/jdk/javax/swing/JComboBox/WindowsComboBoxSize/WindowsComboBoxSizeTest.java	Tue Nov 06 17:57:17 2018 -0800
+++ b/test/jdk/javax/swing/JComboBox/WindowsComboBoxSize/WindowsComboBoxSizeTest.java	Thu Nov 08 12:09:06 2018 +0530
@@ -24,7 +24,7 @@
 /**
  * @test
  * @key headful
- * @bug 8179027
+ * @bug 8179027 8213116
  * @requires (os.family == "windows")
  * @summary JComboBox too small under Windows LAF
  * @run main WindowsComboBoxSizeTest
@@ -64,7 +64,6 @@
         });
         Robot robot = new Robot();
         robot.waitForIdle();
-
         try {
             test();
         } finally {
@@ -78,12 +77,12 @@
             if (comboBox.getSize().height != expected ) {
                 throw new RuntimeException(
                         "Wrong non-editable JComboBox height " +
-                                              comboBox.getSize().height);
+                                              comboBox.getSize().height + " expected " + expected);
             }
             if (comboBoxEd.getSize().height != expected ) {
                 throw new RuntimeException(
                         "Wrong editable JComboBox height " +
-                                            comboBoxEd.getSize().height);
+                                            comboBoxEd.getSize().height + " expected " + expected);
             }
         });
     }