test/java/awt/Mixing/AWT_Mixing/OverlappingTestBase.java
Print this page
*** 27,37 ****
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import javax.swing.*;
! import sun.awt.*;
import java.io.*;
import test.java.awt.regtesthelpers.Util;
/**
* <p>This class provides basis for AWT Mixing testing.
--- 27,37 ----
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import javax.swing.*;
! import sun.awt.EmbeddedFrame;
import java.io.*;
import test.java.awt.regtesthelpers.Util;
/**
* <p>This class provides basis for AWT Mixing testing.
*** 139,149 ****
}
public void getVerifyColor() {
try {
final int size = 200;
- final SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
final Point[] p = new Point[1];
SwingUtilities.invokeAndWait(new Runnable() {
public void run(){
JFrame frame = new JFrame("set back");
frame.getContentPane().setBackground(AWT_BACKGROUND_COLOR);
--- 139,148 ----
*** 153,163 ****
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
p[0] = frame.getLocation();
}
});
Robot robot = new Robot();
! toolkit.realSync();
Thread.sleep(ROBOT_DELAY);
AWT_VERIFY_COLOR = robot.getPixelColor(p[0].x+size/2, p[0].y+size/2);
System.out.println("Color will be compared with " + AWT_VERIFY_COLOR + " instead of " + AWT_BACKGROUND_COLOR);
} catch (Exception e) {
System.err.println("Cannot get verify color: "+e.getMessage());
--- 152,162 ----
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
p[0] = frame.getLocation();
}
});
Robot robot = new Robot();
! robot.waitForIdle();
Thread.sleep(ROBOT_DELAY);
AWT_VERIFY_COLOR = robot.getPixelColor(p[0].x+size/2, p[0].y+size/2);
System.out.println("Color will be compared with " + AWT_VERIFY_COLOR + " instead of " + AWT_BACKGROUND_COLOR);
} catch (Exception e) {
System.err.println("Cannot get verify color: "+e.getMessage());
*** 432,452 ****
* @see {@link OverlappingTestBase#propagateAWTControls(java.awt.Container) } for instructions about adding tested AWT control to UI
*/
protected Component currentAwtControl;
private void testComponent(Component component) throws InterruptedException, InvocationTargetException {
currentAwtControl = component;
System.out.println("Testing " + currentAwtControl.getClass().getSimpleName());
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
prepareControls();
}
});
if (component != null) {
Util.waitTillShown(component);
}
! Util.waitForIdle(null);
try {
Thread.sleep(500); // wait for graphic effects on systems like Win7
} catch (InterruptedException ex) {
}
if (!instance.performTest()) {
--- 431,456 ----
* @see {@link OverlappingTestBase#propagateAWTControls(java.awt.Container) } for instructions about adding tested AWT control to UI
*/
protected Component currentAwtControl;
private void testComponent(Component component) throws InterruptedException, InvocationTargetException {
+ Robot robot = null;
+ try {
+ robot = new Robot();
+ }catch(Exception ignorex) {
+ }
currentAwtControl = component;
System.out.println("Testing " + currentAwtControl.getClass().getSimpleName());
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
prepareControls();
}
});
if (component != null) {
Util.waitTillShown(component);
}
! Util.waitForIdle(robot);
try {
Thread.sleep(500); // wait for graphic effects on systems like Win7
} catch (InterruptedException ex) {
}
if (!instance.performTest()) {
*** 459,476 ****
}
});
}
private void testEmbeddedFrame() throws InvocationTargetException, InterruptedException {
System.out.println("Testing EmbeddedFrame");
currentAwtControl = null;
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
prepareControls();
}
});
! Util.waitForIdle(null);
try {
Thread.sleep(500); // wait for graphic effects on systems like Win7
} catch (InterruptedException ex) {
}
if (!instance.performTest()) {
--- 463,485 ----
}
});
}
private void testEmbeddedFrame() throws InvocationTargetException, InterruptedException {
+ Robot robot = null;
+ try {
+ robot = new Robot();
+ }catch(Exception ignorex) {
+ }
System.out.println("Testing EmbeddedFrame");
currentAwtControl = null;
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
prepareControls();
}
});
! Util.waitForIdle(robot);
try {
Thread.sleep(500); // wait for graphic effects on systems like Win7
} catch (InterruptedException ex) {
}
if (!instance.performTest()) {