Skip to content

Commit cd778f5

Browse files
author
Alexander Zuev
committed
8202667: java/awt/Debug/DumpOnKey/DumpOnKey.java times out on Windows
Reviewed-by: prr
1 parent b889f2a commit cd778f5

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

test/jdk/ProblemList.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,6 @@ java/awt/font/TextLayout/LigatureCaretTest.java 8266312 generic-all
469469
java/awt/image/VolatileImage/CustomCompositeTest.java 8199002 windows-all,linux-all
470470
java/awt/image/VolatileImage/GradientPaints.java 8199003 linux-all
471471
java/awt/JAWT/JAWT.sh 8197798 windows-all,linux-all
472-
java/awt/Debug/DumpOnKey/DumpOnKey.java 8202667 windows-all
473472
java/awt/Robot/RobotWheelTest/RobotWheelTest.java 8129827 generic-all
474473
java/awt/datatransfer/ConstructFlavoredObjectTest/ConstructFlavoredObjectTest.java 8202860 linux-all
475474
java/awt/dnd/DisposeFrameOnDragCrash/DisposeFrameOnDragTest.java 8202790 macosx-all,linux-all

test/jdk/java/awt/Debug/DumpOnKey/DumpOnKey.java

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
2222
*/
2323

2424
import java.awt.AWTException;
25+
import java.awt.EventQueue;
2526
import java.awt.Frame;
2627
import java.awt.Robot;
2728
import java.awt.Window;
@@ -58,9 +59,11 @@ public void list(final PrintStream out, final int indent) {
5859
w.setSize(200, 200);
5960
w.setLocationRelativeTo(null);
6061
w.setVisible(true);
62+
w.toFront();
63+
w.requestFocus();
6164

6265
final Robot robot = new Robot();
63-
robot.setAutoDelay(50);
66+
robot.setAutoDelay(100);
6467
robot.setAutoWaitForIdle(true);
6568
robot.mouseMove(w.getX() + w.getWidth() / 2,
6669
w.getY() + w.getHeight() / 2);
@@ -74,7 +77,14 @@ public void list(final PrintStream out, final int indent) {
7477
robot.keyRelease(KeyEvent.VK_SHIFT);
7578
robot.keyRelease(KeyEvent.VK_CONTROL);
7679

77-
w.dispose();
80+
try {
81+
EventQueue.invokeAndWait(() -> {
82+
w.dispose();
83+
});
84+
} catch (Exception e) {}
85+
86+
robot.delay(2000);
87+
7888
if (dumped != dump) {
7989
throw new RuntimeException("Exp:" + dump + ", actual:" + dumped);
8090
}

0 commit comments

Comments
 (0)