Merge lp:~saviq/unity-2d/shell_test-launcher-focus-with-dash into lp:~unity-2d-team/unity-2d/unity-2d-shell

Proposed by Michał Sawicz on 2012-01-20
Status: Merged
Approved by: Gerry Boland on 2012-01-20
Approved revision: 922
Merged at revision: 922
Proposed branch: lp:~saviq/unity-2d/shell_test-launcher-focus-with-dash
Merge into: lp:~unity-2d-team/unity-2d/unity-2d-shell
Diff against target: 157 lines (+140/-0)
1 file modified
tests/launcher/autohide_show_tests.rb (+140/-0)
To merge this branch: bzr merge lp:~saviq/unity-2d/shell_test-launcher-focus-with-dash
Reviewer Review Type Date Requested Status
Gerry Boland 2012-01-20 Pending
Review via email: mp+89456@code.launchpad.net

Description of the Change

[tests] add tests to ensure proper focusing of the launcher when dash is active

To post a comment you must log in.

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-20 13:42:51 +0000
3+++ tests/launcher/autohide_show_tests.rb 2012-01-20 15:54:18 +0000
4@@ -225,6 +225,40 @@
5
6
7 # Test case objectives:
8+ # * Check Launcher reveal when dash is invoked
9+ # Pre-conditions
10+ # * None
11+ # Test steps
12+ # * Open application in position overlapping Launcher
13+ # * Verify Launcher hiding
14+ # * Press Super key
15+ # * Verify Launcher shows
16+ # * Press Super key
17+ # * Verify Launcher hides
18+ # Post-conditions
19+ # * None
20+ # References
21+ # * None
22+ test "Press Super key to reveal launcher, press again to hide" do
23+ xid = TmpWindow.open_window_at(10,100)
24+ verify_equal( -WIDTH, TIMEOUT, 'Launcher visible with window in the way, should be hidden' ) {
25+ @app.Launcher()['x_absolute'].to_i
26+ }
27+
28+ XDo::Keyboard.simulate('{SUPER}')
29+ verify_equal( 0, TIMEOUT, 'Launcher hiding when Super Key pressed, should be visible' ) {
30+ @app.Launcher()['x_absolute'].to_i
31+ }
32+
33+ XDo::Keyboard.simulate('{SUPER}')
34+ verify_equal( -WIDTH, TIMEOUT, 'Launcher visible with window in the way and mouse moved out, should be hidden' ) {
35+ @app.Launcher()['x_absolute'].to_i
36+ }
37+ xid.close!
38+ end
39+
40+
41+ # Test case objectives:
42 # * Check Launcher reveal with Super key works
43 # Pre-conditions
44 # * None
45@@ -355,6 +389,112 @@
46
47
48 # Test case objectives:
49+ # * Alt+F1 gives keyboard focus to the Launcher when dash was open, escape removes it
50+ # Pre-conditions
51+ # * Desktop with no running applications
52+ # Test steps
53+ # * Open application in position overlapping Launcher
54+ # * Verify Launcher hiding
55+ # * Verify application has keyboard focus
56+ # * Press Super to invoke the Dash
57+ # * Verify Launcher is shown
58+ # * Press Alt+F1
59+ # * Verify Launcher shows
60+ # * Verify Dash icon is highlighted
61+ # * Verify application does not have keyboard focus
62+ # * Press Escape
63+ # * Verify Launcher hides
64+ # * Verify application has keyboard focus
65+ # Post-conditions
66+ # * None
67+ # References
68+ # * None
69+ xtest "Press Alt+F1 to focus/unfocus Launcher when dash is open" do
70+ xid = TmpWindow.open_window_at(10,100)
71+ verify_equal( -WIDTH, TIMEOUT, 'Launcher visible with window in the way, should be hidden' ) {
72+ @app.Launcher()['x_absolute'].to_i
73+ }
74+ assert_equal( xid.id, XDo::XWindow.active_window, \
75+ 'terminal should have focus after starting it' )
76+
77+ XDo::Keyboard.simulate('{SUPER}')
78+ verify_equal( 0, TIMEOUT, 'Launcher hiding after Super pressed, should be visible' ) {
79+ @app.Launcher()['x_absolute'].to_i
80+ }
81+
82+ XDo::Keyboard.alt_F1 #Must use uppercase F to indicate function keys
83+ verify_equal( 'true', TIMEOUT, 'Dash icon not highlighted after Alt+F1 pressed' ) {
84+ @app.LauncherList( :name => 'main' ) \
85+ .QDeclarativeItem( :name => 'Dash home' ) \
86+ .QDeclarativeImage( :name => 'selectionOutline' )['visible']
87+ }
88+ assert_not_equal( xid.id, XDo::XWindow.active_window, \
89+ 'terminal has focus when it should be in the launcher' )
90+
91+ XDo::Keyboard.escape
92+ verify_equal( -WIDTH, TIMEOUT, 'Launcher visible with window in the way and mouse moved out, should be hidden' ){
93+ @app.Launcher()['x_absolute'].to_i
94+ }
95+ assert_equal( xid.id, XDo::XWindow.active_window, \
96+ 'terminal does not have focus when it should' )
97+ xid.close!
98+ end
99+
100+
101+ # Test case objectives:
102+ # * Alt+F1 takes & gives keyboard focus to the Launcher when dash was open
103+ # Pre-conditions
104+ # * Desktop with no running applications
105+ # Test steps
106+ # * Open application in position overlapping Launcher
107+ # * Verify Launcher hiding
108+ # * Verify application has keyboard focus
109+ # * Press Super to invoke the Dash
110+ # * Verify Launcher is shown
111+ # * Press Alt+F1
112+ # * Verify Launcher shows
113+ # * Verify Dash icon is highlighted
114+ # * Verify application does not have keyboard focus
115+ # * Press Alt+F1
116+ # * Verify Launcher hides
117+ # * Verify application has keyboard focus
118+ # Post-conditions
119+ # * None
120+ # References
121+ # * None
122+ xtest "Press Alt+F1 to focus Launcher when dash is open, escape to unfocus" do
123+ xid = TmpWindow.open_window_at(10,100)
124+ verify_equal( -WIDTH, TIMEOUT, 'Launcher visible with window in the way, should be hidden' ) {
125+ @app.Launcher()['x_absolute'].to_i
126+ }
127+ assert_equal( xid.id, XDo::XWindow.active_window, \
128+ 'terminal should have focus after starting it' )
129+
130+ XDo::Keyboard.simulate('{SUPER}')
131+ verify_equal( 0, TIMEOUT, 'Launcher hiding after Super pressed, should be visible' ) {
132+ @app.Launcher()['x_absolute'].to_i
133+ }
134+
135+ XDo::Keyboard.alt_F1 #Must use uppercase F to indicate function keys
136+ verify_equal( 'true', TIMEOUT, 'Dash icon not highlighted after Alt+F1 pressed' ) {
137+ @app.LauncherList( :name => 'main' ) \
138+ .QDeclarativeItem( :name => 'Dash home' ) \
139+ .QDeclarativeImage( :name => 'selectionOutline' )['visible']
140+ }
141+ assert_not_equal( xid.id, XDo::XWindow.active_window, \
142+ 'terminal has focus when it should be in the launcher' )
143+
144+ XDo::Keyboard.alt_F1
145+ verify_equal( -WIDTH, TIMEOUT, 'Launcher visible with window in the way and mouse moved out, should be hidden' ){
146+ @app.Launcher()['x_absolute'].to_i
147+ }
148+ assert_equal( xid.id, XDo::XWindow.active_window, \
149+ 'terminal does not have focus when it should' )
150+ xid.close!
151+ end
152+
153+
154+ # Test case objectives:
155 # * Launcher displays when 'show desktop' engages
156 # Pre-conditions
157 # * Desktop with no running applications

Subscribers

People subscribed via source and target branches

to all changes: