Skip to content
Permalink
Browse files
8202667: java/awt/Debug/DumpOnKey/DumpOnKey.java times out on Windows
Reviewed-by: prr
  • Loading branch information
Alexander Zuev committed Nov 2, 2021
1 parent b889f2a commit cd778f5b049d52b68ab5872aad5f81e86e1718f7
Showing 2 changed files with 13 additions and 4 deletions.
@@ -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
@@ -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 void list(final PrintStream out, final int indent) {
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 void list(final PrintStream out, final int indent) {
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);
}

1 comment on commit cd778f5

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on cd778f5 Nov 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.