RFR: 8129827: [TEST_BUG] Test java/awt/Robot/RobotWheelTest/RobotWheelTest.java fails

Alexander Zvegintsev azvegint at openjdk.java.net
Fri Apr 22 07:05:25 UTC 2022


On Fri, 22 Apr 2022 05:06:55 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

>> Test was written based on assumption that we will receive only one `mouseWheelMoved` event with `getWheelRotation() == 20` after `robot.mouseWheel(20)` call, but we can receive 20  events with `getWheelRotation == 1` instead.
>> 
>> So the test is modified to accumulate wheel rotation values before checking.
>> 
>> Testing is green on all platforms.
>
> test/jdk/java/awt/Robot/RobotWheelTest/RobotWheelTest.java line 47:
> 
>> 45: 
>> 46:     private static AtomicInteger wheelRotation = new AtomicInteger();
>> 47:     private static int wheelSign = Platform.isOSX() ? -1 : 1;
> 
> Is this the scroll rotation direction?
> If it is, then as you can see in  JDK-8282716 review comments, this direction can be configured so we cannot rely on this it will always be -1 for macos...
> Maybe you can do the same as it is done there to check at runtime what is the scroll direction configured?

It is the scroll rotation direction.

Just checked, enabling/disabling `Scroll direction: Natural` for mouse or trackpad does not affect robot scrolling, so the test passes regardless of these settings.

Besides that verification of `getWheelRotation()` method itself is significant part of the test, so I doubt we can use it to detect scroll direction.

-------------

PR: https://git.openjdk.java.net/jdk/pull/8305



More information about the client-libs-dev mailing list