RFR: JDK-8344368 : IndependenceSwingTest.java and IndependenceAWTTest.java failed: Selected text & clipboard contents differs [v3]
Harshitha Onkar
honkar at openjdk.org
Tue Dec 3 02:04:39 UTC 2024
On Tue, 3 Dec 2024 01:38:49 GMT, Alexander Zvegintsev <azvegint at openjdk.org> wrote:
>> Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision:
>>
>> frame title
>
> test/jdk/java/awt/datatransfer/Independence/IndependenceAWTTest.java line 170:
>
>> 168: });
>> 169:
>> 170: robot.glide(new Point(0, 0), ttf1Center);
>
> Gliding from `0,0` can sometimes be time consuming, e.g. on my `3440x1440` screen this test took 24s, but with the following patch only 7s.
>
>
> --- a/test/jdk/java/awt/datatransfer/Independence/IndependenceAWTTest.java
> +++ b/test/jdk/java/awt/datatransfer/Independence/IndependenceAWTTest.java
> @@ -59,6 +59,7 @@ public class IndependenceAWTTest {
> private static Clipboard primaryClip;
> private static ExtendedRobot robot;
> private static volatile Point ttf1Center;
> + private static volatile Point glideStartLocation;
>
> public static void main (String[] args) throws Exception {
> try {
> @@ -165,9 +166,11 @@ private static void test() throws Exception {
> Point center = tf1.getLocationOnScreen();
> center.translate(tf1.getWidth() / 2, tf1.getHeight() / 2);
> ttf1Center = center;
> + glideStartLocation = frame.getLocationOnScreen();
> + glideStartLocation.x -= 10;
> });
>
> - robot.glide(new Point(0, 0), ttf1Center);
> + robot.glide(glideStartLocation, ttf1Center);
> robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
> robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
> robot.waitForIdle(20);
Thanks. With your patch the test executes much faster. Since I moved the frame to center, the time required for robot.glide() was more noticeable and using `glideStartLocation` works well.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22490#discussion_r1866877817
More information about the client-libs-dev
mailing list