Skip to content

Commit

Permalink
8225045: javax/swing/JInternalFrame/8146321/JInternalFrameIconTest.ja…
Browse files Browse the repository at this point in the history
…va fails on linux-x64

Reviewed-by: serb, pbansal, trebari
  • Loading branch information
prsadhuk committed Jan 13, 2021
1 parent 44c8379 commit a483869
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 0 additions & 1 deletion test/jdk/ProblemList.txt
Expand Up @@ -751,7 +751,6 @@ javax/swing/JFileChooser/6798062/bug6798062.java 8146446 windows-all
javax/swing/JComboBox/8182031/ComboPopupTest.java 8196465 linux-all,macosx-all
javax/swing/JFileChooser/6738668/bug6738668.java 8194946 generic-all
javax/swing/JInternalFrame/Test6325652.java 8224977 macosx-all
javax/swing/JInternalFrame/8146321/JInternalFrameIconTest.java 8225045 linux-all
javax/swing/JPopupMenu/4870644/bug4870644.java 8194130 macosx-all,linux-all
javax/swing/PopupFactory/6276087/NonOpaquePopupMenuTest.java 8065099,8208565 macosx-all,linux-all
javax/swing/UIDefaults/6302464/bug6302464.java 8199079 macosx-all
Expand Down
Expand Up @@ -30,13 +30,15 @@
* @build Util
* @run main JInternalFrameIconTest
*/
import java.io.File;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Robot;
import java.awt.image.BufferedImage;
import javax.imageio.ImageIO;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JDesktopPane;
Expand All @@ -61,7 +63,6 @@ public class JInternalFrameIconTest {

public static void main(String[] args) throws Exception {
robot = new Robot();
robot.delay(2000);
UIManager.LookAndFeelInfo[] lookAndFeelArray
= UIManager.getInstalledLookAndFeels();
for (UIManager.LookAndFeelInfo lookAndFeelItem : lookAndFeelArray) {
Expand All @@ -76,21 +77,28 @@ public static void main(String[] args) throws Exception {
private static void executeCase(String lookAndFeelString) throws Exception {
if (tryLookAndFeel(lookAndFeelString)) {
createImageIconUI(lookAndFeelString);
robot.waitForIdle();
robot.delay(1000);
getImageIconBufferedImage();
robot.waitForIdle();
robot.delay(1000);
cleanUp();
robot.waitForIdle();
robot.delay(1000);

createIconUI(lookAndFeelString);
robot.waitForIdle();
robot.delay(1000);
getIconBufferedImage();
robot.waitForIdle();
robot.delay(1000);
cleanUp();
robot.waitForIdle();
robot.delay(1000);

testIfSame(lookAndFeelString);
robot.waitForIdle();
robot.delay(1000);
}

}
Expand Down Expand Up @@ -208,6 +216,8 @@ private static void getIconBufferedImage() throws Exception {
private static void testIfSame(final String lookAndFeelString)
throws Exception {
if (!bufferedImagesEqual(imageIconImage, iconImage)) {
ImageIO.write(imageIconImage, "png", new File("imageicon-fail.png"));
ImageIO.write(iconImage, "png", new File("iconImage-fail.png"));
String error ="[" + lookAndFeelString
+ "] : ERROR: icon and imageIcon not same.";
errorString += error;
Expand Down

1 comment on commit a483869

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.