Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion test/jdk/ProblemList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,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/Focus/WindowUpdateFocusabilityTest/WindowUpdateFocusabilityTest.java 8339929 linux-all
java/awt/datatransfer/ConstructFlavoredObjectTest/ConstructFlavoredObjectTest.java 8202860 linux-all
java/awt/FileDialog/FilenameFilterTest/FilenameFilterTest.java 8202882 linux-all
Expand Down
16 changes: 13 additions & 3 deletions test/jdk/java/awt/Debug/DumpOnKey/DumpOnKey.java
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -22,6 +22,7 @@
*/

import java.awt.AWTException;
import java.awt.EventQueue;
import java.awt.Frame;
import java.awt.Robot;
import java.awt.Window;
Expand Down Expand Up @@ -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);
Expand All @@ -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);
}
Expand Down