Testcases: init pointer in a predictable position

Tests may disturb the pointer in their normal operation that may lead to
unexpected results in later tests using that display. Reset the pointer
before a test begins to (0, 0) to save test developers from related
"gotchas" and reduce multi-monitor test boilerplate.
This commit is contained in:
Tony Crisci 2013-12-02 18:06:19 -05:00 committed by Michael Stapelberg
parent 18ad1fd4de
commit 1b640ae3be
1 changed files with 3 additions and 0 deletions

View File

@ -155,6 +155,9 @@ __
warnings->import; warnings->import;
$x ||= i3test::X11->new; $x ||= i3test::X11->new;
# set the pointer to a predictable position in case a previous test has
# disturbed it
$x->root->warp_pointer(0, 0);
$cv->recv if $i3_autostart; $cv->recv if $i3_autostart;
@_ = ($class); @_ = ($class);