8258924: javax/swing/JSplitPane/4201995/bug4201995.java fails in GTk L&F

Reviewed-by: serb
This commit is contained in:
Prasanta Sadhukhan 2021-01-04 04:33:30 +00:00
parent f351e155e2
commit a2a3f4a3dc
2 changed files with 26 additions and 11 deletions

View File

@ -735,7 +735,6 @@ javax/swing/JComboBox/6559152/bug6559152.java 8164484 linux-x64
# The next test below is an intermittent failure
javax/swing/JComboBox/8033069/bug8033069ScrollBar.java 8163367 generic-all
javax/swing/JColorChooser/Test6827032.java 8197825 windows-all
javax/swing/JSplitPane/4201995/bug4201995.java 8079127 generic-all
javax/swing/JTree/DnD/LastNodeLowerHalfDrop.java 8159131 linux-all
javax/swing/JTree/4633594/JTreeFocusTest.java 8173125 macosx-all
javax/swing/AbstractButton/6711682/bug6711682.java 8060765 windows-all,macosx-all

View File

@ -32,16 +32,32 @@ import javax.swing.*;
public class bug4201995 {
public static void main(String[] args) throws Exception {
SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
boolean expectedOpaqueValue = !"Nimbus".equals(UIManager.getLookAndFeel().getName());
JSplitPane sp = new JSplitPane();
if (sp.isOpaque() != expectedOpaqueValue) {
throw new RuntimeException("JSplitPane has incorrect default opaque value");
}
for (UIManager.LookAndFeelInfo LF :
UIManager.getInstalledLookAndFeels()) {
try {
UIManager.setLookAndFeel(LF.getClassName());
} catch (UnsupportedLookAndFeelException ignored) {
System.out.println("Unsupported L&F: " + LF.getClassName());
continue;
} catch (ClassNotFoundException | InstantiationException
| IllegalAccessException e) {
throw new RuntimeException(e);
}
});
System.out.println("Testing L&F: " + LF.getClassName());
SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
boolean expectedOpaqueValue =
!("Nimbus".equals(UIManager.getLookAndFeel().getName()) ||
UIManager.getLookAndFeel().getName().contains("GTK"));
JSplitPane sp = new JSplitPane();
System.out.println("sp.isOpaque " + sp.isOpaque());
if (sp.isOpaque() != expectedOpaqueValue) {
throw new RuntimeException("JSplitPane has incorrect default opaque value");
}
}
});
}
}
}