On Tue, 16 Jan 2024 12:46:30 GMT, Alexey Ivanov <aiva...@openjdk.org> wrote:
>> songpv-imt has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Update InterJVMGetDropSuccessTest.java >> - Remove robot.setWaitForIdle(true) and add robot.waitForIdle() after >> mouseMove >> - Change FRAME_ACTIVATION_TIMEOUT to 1000 >> - Remove unused pointInComponent and pointInComponentImpl methods >> - Use Java-style array declaration for successCodes >> - Use per-class imports instead of wildcard imports > > test/jdk/java/awt/dnd/InterJVMGetDropSuccessTest/InterJVMGetDropSuccessTest.java > line 1: > >> 1: /* > > You missed two spots that I talked about: > > > @@ -89,7 +68,9 @@ public void start() { > frame.setVisible(true); > > try { > - Thread.sleep(Util.FRAME_ACTIVATION_TIMEOUT); > + Robot robot = new Robot(); > + robot.waitForIdle(); > + robot.delay(Util.FRAME_ACTIVATION_TIMEOUT); > > Point p = frame.getLocationOnScreen(); > Dimension d = frame.getSize(); > @@ -250,13 +230,14 @@ public void run(String[] args) { > frame.setBounds(300, 200, 150, 150); > frame.setVisible(true); > > - Thread.sleep(Util.FRAME_ACTIVATION_TIMEOUT); > + Robot robot = new Robot(); > + robot.waitForIdle(); > + robot.delay(Util.FRAME_ACTIVATION_TIMEOUT); > > Point sourcePoint = Util.getCenterLocationOnScreen(frame); > > Point targetPoint = new Point(x + w / 2, y + h / 2); > > - Robot robot = new Robot(); > robot.mouseMove(sourcePoint.x, sourcePoint.y); > robot.waitForIdle(); > robot.delay(50); > > > --- > > `MOUSE_RELEASE_TIMEOUT` is still present in the test but it's unused. In addition to this, I propose removing `robot.delay(50);` from the for-loops, or at least reducing this value, let's say, to 5. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16396#discussion_r1453381385