mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-03 06:58:23 +00:00
8341972: java/awt/dnd/DnDRemoveFocusOwnerCrashTest.java timed out after JDK-8341257
Reviewed-by: azvegint
This commit is contained in:
parent
7276a1bec0
commit
1f6bd0c3e5
@ -201,6 +201,7 @@ java/awt/event/KeyEvent/ExtendedKeyCode/ExtendedKeyCodeTest.java 8169476 windows
|
||||
java/awt/event/KeyEvent/KeyChar/KeyCharTest.java 8169474,8224055 macosx-all,windows-all
|
||||
java/awt/event/KeyEvent/KeyTyped/CtrlASCII.java 8298910 linux-all
|
||||
|
||||
java/awt/dnd/DnDRemoveFocusOwnerCrashTest.java 8242805 macosx-all
|
||||
java/awt/dnd/DnDCursorCrashTest.java 8242805 macosx-all
|
||||
java/awt/dnd/DnDClipboardDeadlockTest.java 8079553 linux-all
|
||||
java/awt/dnd/URIListToFileListBetweenJVMsTest/URIListToFileListBetweenJVMsTest.java 8194947 generic-all
|
||||
|
||||
@ -64,10 +64,13 @@ public class DnDRemoveFocusOwnerCrashTest {
|
||||
public static Frame frame;
|
||||
public static Robot robot;
|
||||
public static DragSourceButton dragSourceButton;
|
||||
static volatile Point p;
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
robot = new Robot();
|
||||
robot.setAutoWaitForIdle(true);
|
||||
robot.delay(FRAME_ACTIVATION_TIMEOUT);
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
frame = new Frame();
|
||||
dragSourceButton = new DragSourceButton();
|
||||
@ -79,37 +82,33 @@ public class DnDRemoveFocusOwnerCrashTest {
|
||||
frame.add(dropTargetPanel);
|
||||
frame.pack();
|
||||
frame.setVisible(true);
|
||||
});
|
||||
|
||||
try {
|
||||
robot.delay(FRAME_ACTIVATION_TIMEOUT);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException("The test failed.");
|
||||
}
|
||||
robot.waitForIdle();
|
||||
robot.delay(FRAME_ACTIVATION_TIMEOUT);
|
||||
|
||||
Point p = dragSourceButton.getLocationOnScreen();
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
p = dragSourceButton.getLocationOnScreen();
|
||||
p.translate(10, 10);
|
||||
});
|
||||
|
||||
try {
|
||||
Robot robot = new Robot();
|
||||
robot.mouseMove(p.x, p.y);
|
||||
robot.keyPress(KeyEvent.VK_CONTROL);
|
||||
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
|
||||
for (int dy = 0; dy < 50; dy++) {
|
||||
robot.mouseMove(p.x, p.y + dy);
|
||||
robot.delay(10);
|
||||
}
|
||||
robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
|
||||
robot.keyRelease(KeyEvent.VK_CONTROL);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException("The test failed.");
|
||||
robot.delay(FRAME_ACTIVATION_TIMEOUT);
|
||||
robot.mouseMove(p.x, p.y);
|
||||
robot.delay(FRAME_ACTIVATION_TIMEOUT);
|
||||
robot.keyPress(KeyEvent.VK_CONTROL);
|
||||
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
|
||||
for (int dy = 0; dy < 50; dy++) {
|
||||
robot.mouseMove(p.x, p.y + dy);
|
||||
robot.delay(10);
|
||||
}
|
||||
robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
|
||||
robot.keyRelease(KeyEvent.VK_CONTROL);
|
||||
} finally {
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
if (frame != null) {
|
||||
frame.dispose();
|
||||
}
|
||||
});
|
||||
} finally {
|
||||
if (frame != null) {
|
||||
EventQueue.invokeAndWait(() -> frame.dispose());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user