8202667: java/awt/Debug/DumpOnKey/DumpOnKey.java times out on Windows

Reviewed-by: prr
This commit is contained in:
Alexander Zuev 2021-11-02 13:23:18 +00:00
parent b889f2a88a
commit cd778f5b04
2 changed files with 13 additions and 4 deletions

View File

@ -469,7 +469,6 @@ java/awt/font/TextLayout/LigatureCaretTest.java 8266312 generic-all
java/awt/image/VolatileImage/CustomCompositeTest.java 8199002 windows-all,linux-all
java/awt/image/VolatileImage/GradientPaints.java 8199003 linux-all
java/awt/JAWT/JAWT.sh 8197798 windows-all,linux-all
java/awt/Debug/DumpOnKey/DumpOnKey.java 8202667 windows-all
java/awt/Robot/RobotWheelTest/RobotWheelTest.java 8129827 generic-all
java/awt/datatransfer/ConstructFlavoredObjectTest/ConstructFlavoredObjectTest.java 8202860 linux-all
java/awt/dnd/DisposeFrameOnDragCrash/DisposeFrameOnDragTest.java 8202790 macosx-all,linux-all

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -22,6 +22,7 @@
*/
import java.awt.AWTException;
import java.awt.EventQueue;
import java.awt.Frame;
import java.awt.Robot;
import java.awt.Window;
@ -58,9 +59,11 @@ public final class DumpOnKey {
w.setSize(200, 200);
w.setLocationRelativeTo(null);
w.setVisible(true);
w.toFront();
w.requestFocus();
final Robot robot = new Robot();
robot.setAutoDelay(50);
robot.setAutoDelay(100);
robot.setAutoWaitForIdle(true);
robot.mouseMove(w.getX() + w.getWidth() / 2,
w.getY() + w.getHeight() / 2);
@ -74,7 +77,14 @@ public final class DumpOnKey {
robot.keyRelease(KeyEvent.VK_SHIFT);
robot.keyRelease(KeyEvent.VK_CONTROL);
w.dispose();
try {
EventQueue.invokeAndWait(() -> {
w.dispose();
});
} catch (Exception e) {}
robot.delay(2000);
if (dumped != dump) {
throw new RuntimeException("Exp:" + dump + ", actual:" + dumped);
}