This commit is contained in:
Kovid Goyal 2020-02-13 10:07:55 +05:30
parent b0b8b06b56
commit fdf055312c
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -73,6 +73,9 @@ class TestMouse(BaseTest):
count -= 1 count -= 1
ev(GLFW_MOUSE_BUTTON_LEFT, x=x, y=y) ev(GLFW_MOUSE_BUTTON_LEFT, x=x, y=y)
def scroll(x=0, y=0, up=True):
move(x=x, y=y, button=-2 if up else -3)
# Simple, click, move, release test # Simple, click, move, release test
init() init()
press() press()
@ -131,15 +134,14 @@ class TestMouse(BaseTest):
release() release()
# scrolling # scrolling
UP, DOWN = -2, -3
init() init()
press(x=1) press(x=1)
move(x=1, button=UP) scroll(x=1)
self.ae(sel(), 'LMNO12') self.ae(sel(), 'LMNO12')
move(x=1, button=UP) scroll(x=1)
self.ae(sel(), 'GHIJKLMNO12') self.ae(sel(), 'GHIJKLMNO12')
move(x=1, button=DOWN) scroll(x=1, up=False)
self.ae(sel(), 'LMNO12') self.ae(sel(), 'LMNO12')
move(x=2, button=DOWN) scroll(x=2, up=False)
self.ae(sel(), '23') self.ae(sel(), '23')
release() release()