Skip to content

Commit

Permalink
8255079: RobotTest::testPixelCaptureAverage fails intermittently on W…
Browse files Browse the repository at this point in the history
…indows with HiDPI scaling

Reviewed-by: kcr
  • Loading branch information
Lukasz Kostyra committed Sep 18, 2023
1 parent 5e145cc commit 2ae8c27
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -673,10 +673,6 @@ private static void testPixelCapture(boolean primitiveArg)

@Test
public void testPixelCaptureAverage() throws Exception {
if (PlatformUtil.isWindows() && Screen.getPrimary().getOutputScaleX() > 1) {
// Mark this test as unstable on Windows when HiDPI scale is more than 100%
Assume.assumeTrue(Boolean.getBoolean("unstable.test")); // JDK-8255079
}
CountDownLatch setSceneLatch = new CountDownLatch(1);
Pane pane = new StackPane();
InvalidationListener invalidationListener = observable -> setSceneLatch.countDown();
Expand All @@ -694,8 +690,8 @@ public void testPixelCaptureAverage() throws Exception {
AtomicReference<Color> captureColor = new AtomicReference<>();
Thread.sleep(1000);
Util.runAndWait(() -> {
int x = (int) stage.getX();
int y = (int) stage.getY();
int x = (int)(Math.round(stage.getX()));
int y = (int)(Math.round(stage.getY()));
// Subtracting one pixel from x makes the result RED, so we are on the border.
// If the implementation of getPixelColor is ever chaged to interpolate the
// colors on HiDPI screens, this test will fail and the resulting color will
Expand Down

1 comment on commit 2ae8c27

@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.