8031423: Test java/awt/dnd/DisposeFrameOnDragCrash/DisposeFrameOnDragTest.java fails by Timeout on Windows

Reviewed-by: yan, arapte
This commit is contained in:
Ajit Ghaisas 2016-04-19 13:00:00 +05:30
parent 881e667223
commit 108c188df5

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013, 2016 Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -56,17 +56,24 @@ public class DisposeFrameOnDragTest {
} }
}); });
Util.waitForIdle(null); Robot testRobot = null;
try { try {
Point loc = textArea.getLocationOnScreen(); testRobot = new Robot();
Util.drag(new Robot(), } catch(AWTException ex) {
new Point((int) loc.x + 3, (int) loc.y + 3), throw new RuntimeException("Error while creating Robot");
new Point((int) loc.x + 40, (int) loc.y + 40),
InputEvent.BUTTON1_MASK);
} catch (AWTException ex) {
throw new RuntimeException("Could not initiate a drag operation");
} }
Util.waitForIdle(null);
Util.waitForIdle(testRobot);
Point loc = textArea.getLocationOnScreen();
Util.drag(testRobot,
new Point((int) loc.x + 3, (int) loc.y + 3),
new Point((int) loc.x + 40, (int) loc.y + 40),
InputEvent.BUTTON1_MASK);
Util.waitForIdle(testRobot);
testRobot.delay(200);
} }
private static void constructTestUI() { private static void constructTestUI() {