Skip to content

Commit fe7672b

Browse files
committed
8196099: javax/swing/text/CSSBorder/6796710/bug6796710.java fails
Reviewed-by: psadhukhan
1 parent cacce84 commit fe7672b

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

test/jdk/ProblemList.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,6 @@ javax/swing/JTabbedPane/8007563/Test8007563.java 8051591 generic-all
761761
javax/swing/JTabbedPane/4624207/bug4624207.java 8064922 macosx-all
762762
javax/swing/SwingUtilities/TestBadBreak/TestBadBreak.java 8160720 generic-all
763763
javax/swing/plaf/basic/Test6984643.java 8198340 windows-all
764-
javax/swing/text/CSSBorder/6796710/bug6796710.java 8196099 windows-all
765764
javax/swing/text/DefaultCaret/HidingSelection/HidingSelectionTest.java 8194048 windows-all
766765
javax/swing/text/DefaultCaret/HidingSelection/MultiSelectionTest.java 8213562 linux-all
767766
javax/swing/text/JTextComponent/5074573/bug5074573.java 8196100 windows-all

test/jdk/javax/swing/text/CSSBorder/6796710/bug6796710.java

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -28,12 +28,23 @@
2828
* @summary Html content in JEditorPane is overlapping on swing components while resizing the application.
2929
* @library ../../../regtesthelpers
3030
* @build Util
31-
@run main bug6796710
31+
* @run main/othervm -Dsun.java2d.uiScale=1 bug6796710
3232
*/
3333

34-
import java.awt.*;
34+
import java.awt.BorderLayout;
35+
import java.awt.Rectangle;
36+
import java.awt.Robot;
3537
import java.awt.image.BufferedImage;
36-
import javax.swing.*;
38+
import java.io.File;
39+
40+
import javax.imageio.ImageIO;
41+
import javax.swing.JButton;
42+
import javax.swing.JEditorPane;
43+
import javax.swing.JFrame;
44+
import javax.swing.JLabel;
45+
import javax.swing.JPanel;
46+
import javax.swing.JScrollPane;
47+
import javax.swing.SwingUtilities;
3748

3849
public class bug6796710 {
3950
// The page is inlined because we want to be sure that the JEditorPane filled synchronously
@@ -89,6 +100,7 @@ public void run() {
89100

90101
frame.setContentPane(pnContent);
91102
frame.setSize(400, 600);
103+
frame.setLocationRelativeTo(null);
92104
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
93105
frame.setVisible(true);
94106
}
@@ -113,7 +125,10 @@ public void run() {
113125
// On Linux platforms realSync doesn't guaranties setSize completion
114126
Thread.sleep(1000);
115127

116-
if (!Util.compareBufferedImages(bufferedImage, getPnBottomImage())) {
128+
BufferedImage pnBottomImage = getPnBottomImage();
129+
if (!Util.compareBufferedImages(bufferedImage, pnBottomImage)) {
130+
ImageIO.write(bufferedImage, "png", new File("bufferedImage.png"));
131+
ImageIO.write(pnBottomImage, "png", new File("pnBottomImage.png"));
117132
throw new RuntimeException("The test failed");
118133
}
119134

0 commit comments

Comments
 (0)