Skip to content

Commit

Permalink
Add functions to aid automated testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
treeform committed Nov 18, 2023
1 parent 97ddacb commit 00db247
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/windy/platforms/win32/platform.nim
Original file line number Diff line number Diff line change
Expand Up @@ -2354,3 +2354,18 @@ proc pollEvents*() =

when defined(windyUseStdHttp):
pollHttp()

proc forceMousePos*(window: Window, mousePos: IVec2) =
## Forces mouse position to a place.
## This is used for simulating UI tests.
window.state.mousePos = mousePos

proc forceButtonPress*(window: Window, button: Button) =
## Forces button press.
## This is used for simulating UI tests.
window.handleButtonPress(button)

proc forceButtonReleased*(window: Window, button: Button) =
## Forces button release.
## This is used for simulating UI tests.
window.handleButtonRelease(button)

0 comments on commit 00db247

Please sign in to comment.