Skip to content

Commit 3169c97

Browse files
committed
Fix test was causing flaky window tests 2
1 parent c8849ed commit 3169c97

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

compose/ui/ui/src/desktopTest/kotlin/androidx/compose/ui/window/DesktopCursorPositionTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ internal class DesktopCursorPositionTest {
7676
awaitIdle()
7777

7878
val contentLocation = window?.contentPane?.locationOnScreen ?: java.awt.Point(0, 0)
79-
robot.mouseMove(
79+
moveMouse(
8080
contentLocation.x + pxTargetOffset.x,
8181
contentLocation.y + pxTargetOffset.y
8282
)

compose/ui/ui/src/desktopTest/kotlin/androidx/compose/ui/window/TestUtils.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,8 @@ internal class WindowTestScope(
190190

191191
exceptionHandler.throwIfCaught()
192192
}
193+
194+
internal fun moveMouse(x: Int, y: Int) = robot::mouseMove
193195
}
194196

195197
suspend fun Window.waitForFocusGain() {

0 commit comments

Comments
 (0)