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

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

Description of the change

[test] Check that F1 toggles the launcher and brings the focus to the previous active window

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

Works great, thanks

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-04 16:33:21 +0000
3+++ tests/launcher/autohide_show_tests.rb 2012-01-17 11:28:26 +0000
4@@ -187,4 +187,31 @@
5 xid.close!
6 end
7
8+ test "Press Alt+F1 to focus/unfocus Launcher" do
9+ xid = open_window_at(10,100)
10+ sleep 0.5
11+ assert_equal( Integer(@app.Unity2dPanel()['x_absolute']), -WIDTH, \
12+ 'Launcher visible with window in the way, should be hidden' )
13+ assert_equal( xid.id, XDo::XWindow.active_window, \
14+ 'terminal should have focus after starting it' )
15+ XDo::Keyboard.alt_F1 #Must use uppercase F to indicate function keys
16+ sleep 0.5
17+ assert_equal( Integer(@app.Unity2dPanel()['x_absolute']), 0, \
18+ 'Launcher hiding after Alt+F1 pressed, should be visible' )
19+
20+ assert_equal( @app.LauncherList( :name => 'main' ) \
21+ .QDeclarativeItem( :name => 'Dash home' ) \
22+ .QDeclarativeImage( :name => 'selectionOutline' )['visible'], 'true', \
23+ 'Dash icon not highlighted after Alt+F1 pressed' )
24+ assert_not_equal( xid.id, XDo::XWindow.active_window, \
25+ 'terminal has focus when it should be in the launcher' )
26+ XDo::Keyboard.alt_F1
27+ sleep 2
28+ assert_equal( Integer(@app.Unity2dPanel()['x_absolute']), -WIDTH, \
29+ 'Launcher visible with window in the way and mouse moved out, should be hidden' )
30+ assert_equal( xid.id, XDo::XWindow.active_window, \
31+ 'terminal does not have focus when it should' )
32+ xid.close!
33+ end
34+
35 end

Subscribers

People subscribed via source and target branches