8146451: javax/swing/JComponent/4337267/bug4337267.java failed on Windows
Reviewed-by: serb
This commit is contained in:
parent
8812113984
commit
fff8122978
test/jdk
@ -760,7 +760,6 @@ javax/swing/Action/8133039/bug8133039.java 8196089 windows-all,macosx-all
|
||||
javax/swing/JComboBox/6559152/bug6559152.java 8196090 windows-all,macosx-all
|
||||
javax/swing/JComboBox/8032878/bug8032878.java 8196092,8196439 windows-all,macosx-all,linux-all
|
||||
javax/swing/JComboBox/8072767/bug8072767.java 8196093 windows-all,macosx-all
|
||||
javax/swing/JComponent/4337267/bug4337267.java 8146451 windows-all
|
||||
javax/swing/JFileChooser/4524490/bug4524490.java 8042380 generic-all
|
||||
javax/swing/JFileChooser/6396844/TwentyThousandTest.java 8198003 generic-all
|
||||
javax/swing/JFrame/8175301/ScaledFrameBackgroundTest.java 8193942 generic-all
|
||||
|
@ -50,7 +50,6 @@ public class bug4337267 {
|
||||
JComponent[] printq;
|
||||
static JFrame window;
|
||||
static boolean testFailed = false;
|
||||
static boolean done = false;
|
||||
|
||||
String shaped =
|
||||
"000 (E) 111 (A) \u0641\u0642\u0643 \u0662\u0662\u0662 (E) 333";
|
||||
@ -62,7 +61,6 @@ public class bug4337267 {
|
||||
testNonTextComponentHTML();
|
||||
testNonTextComponentPlain();
|
||||
|
||||
doneTask();
|
||||
}
|
||||
|
||||
void initUI() {
|
||||
@ -74,33 +72,6 @@ public class bug4337267 {
|
||||
window.setVisible(true);
|
||||
}
|
||||
|
||||
Runnable printComponents = new Runnable() {
|
||||
public void run() {
|
||||
printComponent(printq[0], i1);
|
||||
printComponent(printq[1], i2);
|
||||
}
|
||||
};
|
||||
|
||||
Runnable compareRasters = new Runnable() {
|
||||
public void run() {
|
||||
assertEquals(p1.image, p2.image);
|
||||
assertEquals(i1, i2);
|
||||
}
|
||||
};
|
||||
|
||||
void doneTask() {
|
||||
final Object monitor = this;
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
done = true;
|
||||
synchronized(monitor) {
|
||||
monitor.notify();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
void fail(String message) {
|
||||
testFailed = true;
|
||||
throw new RuntimeException(message);
|
||||
@ -126,8 +97,10 @@ public class bug4337267 {
|
||||
area2.setText(text);
|
||||
window.repaint();
|
||||
printq = new JComponent[] { area1, area2 };
|
||||
SwingUtilities.invokeLater(printComponents);
|
||||
SwingUtilities.invokeLater(compareRasters);
|
||||
printComponent(printq[0], i1);
|
||||
printComponent(printq[1], i2);
|
||||
assertEquals(p1.image, p2.image);
|
||||
assertEquals(i1, i2);
|
||||
}
|
||||
|
||||
void testNonTextComponentHTML() {
|
||||
@ -140,12 +113,14 @@ public class bug4337267 {
|
||||
label2.setText("<html>" + text);
|
||||
window.repaint();
|
||||
printq = new JComponent[] { label1, label2 };
|
||||
SwingUtilities.invokeLater(printComponents);
|
||||
SwingUtilities.invokeLater(compareRasters);
|
||||
printComponent(printq[0], i1);
|
||||
printComponent(printq[1], i2);
|
||||
assertEquals(p1.image, p2.image);
|
||||
assertEquals(i1, i2);
|
||||
}
|
||||
|
||||
void testNonTextComponentPlain() {
|
||||
System.out.println("testNonTextComponentHTML:");
|
||||
System.out.println("testNonTextComponentPlain:");
|
||||
JLabel label1 = new JLabel();
|
||||
injectComponent(p1, label1, false);
|
||||
label1.setText(shaped);
|
||||
@ -154,8 +129,10 @@ public class bug4337267 {
|
||||
label2.setText(text);
|
||||
window.repaint();
|
||||
printq = new JComponent[] { label1, label2 };
|
||||
SwingUtilities.invokeLater(printComponents);
|
||||
SwingUtilities.invokeLater(compareRasters);
|
||||
printComponent(printq[0], i1);
|
||||
printComponent(printq[1], i2);
|
||||
assertEquals(p1.image, p2.image);
|
||||
assertEquals(i1, i2);
|
||||
}
|
||||
|
||||
void setShaping(JComponent c) {
|
||||
@ -250,25 +227,15 @@ public class bug4337267 {
|
||||
|
||||
|
||||
|
||||
public static void main(String[] args) throws Throwable {
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
final bug4337267 test = new bug4337267();
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
SwingUtilities.invokeAndWait(new Runnable() {
|
||||
public void run() {
|
||||
test.run();
|
||||
}
|
||||
});
|
||||
|
||||
synchronized(test) {
|
||||
while (!done) {
|
||||
try {
|
||||
test.wait();
|
||||
} catch (InterruptedException ex) {
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (testFailed) {
|
||||
throw new RuntimeException("FAIL");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user