Merge lp:~aacid/unity-2d/unity-2d_test_mouse_timing_tests into lp:unity-2d

Proposed by Albert Astals Cid
Status: Merged
Approved by: Gerry Boland
Approved revision: 852
Merged at revision: 856
Proposed branch: lp:~aacid/unity-2d/unity-2d_test_mouse_timing_tests
Merge into: lp:unity-2d
Diff against target: 39 lines (+10/-2)
1 file modified
tests/launcher/autohide_show_tests.rb (+10/-2)
To merge this branch: bzr merge lp:~aacid/unity-2d/unity-2d_test_mouse_timing_tests
Reviewer Review Type Date Requested Status
Gerry Boland (community) Approve
Review via email: mp+88895@code.launchpad.net

Description of the change

[test] Small improvements to autohide tests regarding timing on mouse moves

To post a comment you must log in.
Revision history for this message
Gerry Boland (gerboland) wrote :

Hey,
you're gonna kill me, but I've a MR with this whole test re-done using the verify* methods.
https://code.launchpad.net/~gerboland/unity-2d/rewrite-launcher-autohide-show-test/+merge/88969

I did this because all the sleep statements made the test very unreliable. Merging this now will just make the situation worse, so I'm hoping that if my MR is accepted, you can modify this to take advantage of the verify* methods too.
-G

852. By Albert Astals Cid

Merge trunk

Revision history for this message
Gerry Boland (gerboland) wrote :

Thank you for updating this test. Approved

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/launcher/autohide_show_tests.rb'
2--- tests/launcher/autohide_show_tests.rb 2012-01-18 11:01:20 +0000
3+++ tests/launcher/autohide_show_tests.rb 2012-01-18 12:14:29 +0000
4@@ -179,11 +179,11 @@
5 # * Open application in position overlapping Launcher
6 # * Verify Launcher hiding
7 # * Move mouse to left of screen to reveal Launcher
8- # * Verify Launcher shows
9+ # * Verify Launcher shows but not immediately
10 # * Move mouse to the right, but still over the Launcher
11 # * Verify Launcher still showing
12 # * Move mouse further right to not overlap Launcher
13- # * Verify Launcher hides
14+ # * Verify Launcher hides but not immediately
15 # Post-conditions
16 # * None
17 # References
18@@ -195,6 +195,10 @@
19 }
20
21 XDo::Mouse.move(0,200)
22+ sleep 0.4
23+ verify_equal( -WIDTH, 0, 'Launcher should not be visible immediately after mouse moves to the left edge, has to wait 0.5 seconds to show' ) {
24+ @app.Unity2dPanel()['x_absolute'].to_i
25+ }
26 verify_equal( 0, TIMEOUT, 'Launcher hiding when mouse at left edge of screen' ) {
27 @app.Unity2dPanel()['x_absolute'].to_i
28 }
29@@ -205,6 +209,10 @@
30 }
31
32 XDo::Mouse.move(WIDTH,200)
33+ sleep 0.9
34+ verify_equal( 0, 0, 'Launcher should still be visible as it should take 1 second to hide after mouse is not over it' ) {
35+ @app.Unity2dPanel()['x_absolute'].to_i
36+ }
37 verify_equal( -WIDTH, TIMEOUT, 'Launcher visible with window in the way and mouse moved out, should be hidden' ) {
38 @app.Unity2dPanel()['x_absolute'].to_i
39 }

Subscribers

People subscribed via source and target branches