Scrolling test

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

View File

@ -42,6 +42,11 @@ class TestMouse(BaseTest):
def init(): def init():
s.reset() s.reset()
s.draw('pqrst')
s.draw('uvwxy')
s.draw('ABCDE')
s.draw('FGHIJ')
s.draw('KLMNO')
s.draw('12345') s.draw('12345')
s.draw('67890') s.draw('67890')
s.draw('abcde') s.draw('abcde')
@ -60,8 +65,8 @@ class TestMouse(BaseTest):
clear_click_queue=True clear_click_queue=True
) )
def move(x=0, y=0): def move(x=0, y=0, button=-1):
ev(x=x, y=y) ev(x=x, y=y, button=button)
def multi_click(x=0, y=0, count=2): def multi_click(x=0, y=0, count=2):
while count > 0: while count > 0:
@ -124,3 +129,17 @@ class TestMouse(BaseTest):
move(x=3, y=3) move(x=3, y=3)
self.ae(sel(), '789bcdghi') self.ae(sel(), '789bcdghi')
release() release()
# scrolling
UP, DOWN = -2, -3
init()
press(x=1)
move(x=1, button=UP)
self.ae(sel(), 'LMNO12')
move(x=1, button=UP)
self.ae(sel(), 'GHIJKLMNO12')
move(x=1, button=DOWN)
self.ae(sel(), 'LMNO12')
move(x=2, button=DOWN)
self.ae(sel(), '23')
release()