Skip to content

Commit

Permalink
8313633: [macOS] java/awt/dnd/NextDropActionTest/NextDropActionTest.j…
Browse files Browse the repository at this point in the history
…ava fails with java.lang.RuntimeException: wrong next drop action!

Reviewed-by: honkar, serb
  • Loading branch information
Damon Nguyen committed Aug 10, 2023
1 parent 79be8d9 commit d97de82
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions test/jdk/java/awt/dnd/NextDropActionTest/NextDropActionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public void start() throws InterruptedException,
final DragSourceListener dsl = new DragSourceAdapter() {
boolean firstCall = true;
public void dragDropEnd(DragSourceDropEvent e) {
System.err.println("DragSourseListener.dragDropEnd(): " +
System.err.println("DragSourceListener.dragDropEnd(): " +
" firstCall=" + firstCall +
" drop action=" + e.getDropAction());
if (firstCall) {
Expand Down Expand Up @@ -140,18 +140,22 @@ public void drop(DropTargetDropEvent e) {
robot.keyRelease(KeyEvent.VK_CONTROL);
LOCK.wait(WAIT_TIMEOUT);
}

if (!firstEnd) {
System.err.println("DragSourseListener.dragDropEnd() " +
System.err.println("DragSourceListener.dragDropEnd() " +
"was not called, returning");
return;
}

robot.delay(1000);

synchronized (LOCK) {
Util.doDragDrop(robot, startPoint, endPoint);
LOCK.wait(WAIT_TIMEOUT);
}

if (!secondEnd) {
System.err.println("DragSourseListener.dragDropEnd() " +
System.err.println("DragSourceListener.dragDropEnd() " +
"was not called, returning");
return;
}
Expand All @@ -171,7 +175,7 @@ public void drop(DropTargetDropEvent e) {

class Util {
public static int sign(int n) {
return n < 0 ? -1 : n == 0 ? 0 : 1;
return Integer.compare(n, 0);
}

public static void doDragDrop(Robot robot, Point startPoint, Point endPoint) {
Expand Down

1 comment on commit d97de82

@openjdk-notifier
Copy link

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.