Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8225045: javax/swing/JInternalFrame/8146321/JInternalFrameIconTest.java fails on linux-x64 #2918

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion test/jdk/ProblemList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,6 @@ javax/swing/JComboBox/8182031/ComboPopupTest.java 8196465 linux-all,macosx-all
javax/swing/JFileChooser/6738668/bug6738668.java 8194946 generic-all
javax/swing/JFileChooser/8062561/bug8062561.java 8196466 linux-all,macosx-all
javax/swing/JInternalFrame/Test6325652.java 8196467 macosx-all
javax/swing/JInternalFrame/8146321/JInternalFrameIconTest.java 8225045 linux-all
javax/swing/JLabel/6596966/bug6596966.java 8040914 macosx-all
javax/swing/JPopupMenu/4870644/bug4870644.java 8194130 macosx-all
javax/swing/JSpinner/8223788/JSpinnerButtonFocusTest.java 8238085 macosx-all
Expand Down
Original file line number Diff line number Diff line change
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