Skip to content

Commit 94bf6db

Browse files
Amos ShiGoeLin
Amos Shi
authored andcommitted
8202790: DnD test DisposeFrameOnDragTest.java does not clean up
Backport-of: 102a305f73d52d8e378de46c3c0b170db0f2c8af
1 parent 8ca3b77 commit 94bf6db

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

test/jdk/ProblemList.txt

-1
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,6 @@ java/awt/JAWT/JAWT.sh 8197798 windows-all
446446
java/awt/Debug/DumpOnKey/DumpOnKey.java 8202667 windows-all
447447
java/awt/Focus/WindowUpdateFocusabilityTest/WindowUpdateFocusabilityTest.java 8202926 linux-all
448448
java/awt/datatransfer/ConstructFlavoredObjectTest/ConstructFlavoredObjectTest.java 8202860 linux-all
449-
java/awt/dnd/DisposeFrameOnDragCrash/DisposeFrameOnDragTest.java 8202790 macosx-all,linux-all
450449
java/awt/FileDialog/FilenameFilterTest/FilenameFilterTest.java 8202882 linux-all
451450
java/awt/Frame/FramesGC/FramesGC.java 8079069 macosx-all
452451
java/awt/Focus/NonFocusableBlockedOwnerTest/NonFocusableBlockedOwnerTest.java 7124275 macosx-all

test/jdk/java/awt/dnd/DisposeFrameOnDragCrash/DisposeFrameOnDragTest.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
public class DisposeFrameOnDragTest {
5050

5151
private static JTextArea textArea;
52+
private static JFrame background;
5253

5354
public static void main(String[] args) throws Throwable {
5455

@@ -72,14 +73,20 @@ public void run() {
7273
Util.drag(testRobot,
7374
new Point((int) loc.x + 3, (int) loc.y + 3),
7475
new Point((int) loc.x + 40, (int) loc.y + 40),
75-
InputEvent.BUTTON1_MASK);
76+
InputEvent.BUTTON1_DOWN_MASK);
7677

7778
Util.waitForIdle(testRobot);
7879

7980
testRobot.delay(200);
81+
background.dispose();
8082
}
8183

8284
private static void constructTestUI() {
85+
background = new JFrame("Background");
86+
background.setBounds(100, 100, 100, 100);
87+
background.setUndecorated(true);
88+
background.setVisible(true);
89+
8390
final JFrame frame = new JFrame("Test frame");
8491
textArea = new JTextArea("Drag Me!");
8592
try {

0 commit comments

Comments
 (0)