8292588: [macos] Multiscreen/MultiScreenLocationTest/MultiScreenLocationTest.java: Robot.mouseMove test failed on Screen #0
Reviewed-by: dnguyen, jdv
This commit is contained in:
parent
53f72edcf6
commit
2a579ab839
@ -70,9 +70,12 @@ public class MultiScreenLocationTest {
|
||||
GraphicsConfiguration gc = gd.getDefaultConfiguration();
|
||||
Rectangle screen = gc.getBounds();
|
||||
Robot robot = new Robot(gd);
|
||||
robot.setAutoDelay(250);
|
||||
robot.waitForIdle();
|
||||
|
||||
// check Robot.mouseMove()
|
||||
robot.mouseMove(screen.x + mouseOffset.x, screen.y + mouseOffset.y);
|
||||
robot.waitForIdle();
|
||||
Point mouse = MouseInfo.getPointerInfo().getLocation();
|
||||
Point point = screen.getLocation();
|
||||
point.translate(mouseOffset.x, mouseOffset.y);
|
||||
@ -100,6 +103,16 @@ public class MultiScreenLocationTest {
|
||||
|| image.getRGB(image.getWidth() - 1, 0) != rgb
|
||||
|| image.getRGB(image.getWidth() - 1, image.getHeight() - 1) != rgb
|
||||
|| image.getRGB(0, image.getHeight() - 1) != rgb) {
|
||||
System.out.println("Robot.createScreenCapture Expected: " +
|
||||
String.format("0x%08X",rgb));
|
||||
System.out.println("Robot.createScreenCapture Top Left Actual: " +
|
||||
String.format("0x%08X",image.getRGB(0, 0)));
|
||||
System.out.println("Robot.createScreenCapture Top Right Actual: " +
|
||||
String.format("0x%08X",image.getRGB(image.getWidth() - 1, 0)));
|
||||
System.out.println("Robot.createScreenCapture Bottom Right Actual: " +
|
||||
String.format("0x%08X",image.getRGB(image.getWidth() - 1, image.getHeight() - 1)));
|
||||
System.out.println("Robot.createScreenCapture Top Left Actual: " +
|
||||
String.format("0x%08X",image.getRGB(0, image.getHeight() - 1)));
|
||||
throw new RuntimeException(
|
||||
getErrorText("Robot.createScreenCapture", i));
|
||||
}
|
||||
|
@ -174,6 +174,8 @@ public final class Util {
|
||||
if (screen.equals(color)) {
|
||||
return true;
|
||||
}
|
||||
System.out.println("Robot.getPixelColor Expected: " + color);
|
||||
System.out.println("Robot.getPixelColor Actual: " + screen);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user