Merge lp:~gerboland/unity-2d/hide-mode-zero-test-fixes into lp:~didrocks/unity-2d/lock_launcher

Proposed by Gerry Boland
Status: Merged
Approved by: Didier Roche-Tolomelli
Approved revision: 1008
Merged at revision: 903
Proposed branch: lp:~gerboland/unity-2d/hide-mode-zero-test-fixes
Merge into: lp:~didrocks/unity-2d/lock_launcher
Diff against target: 168 lines (+36/-2)
6 files modified
tests/dash/dash-tests.rb (+3/-1)
tests/launcher/autohide_show_tests.rb (+7/-0)
tests/launcher/autohide_show_tests_rtl.rb (+7/-0)
tests/shell/input_shaping.rb (+7/-0)
tests/shell/input_shaping_rtl.rb (+7/-0)
tests/spread/spread-tests.rb (+5/-1)
To merge this branch: bzr merge lp:~gerboland/unity-2d/hide-mode-zero-test-fixes
Reviewer Review Type Date Requested Status
Didier Roche-Tolomelli Approve
Review via email: mp+92778@code.launchpad.net

Description of the change

Fix tests to work with Launcher hide-mode=0

To post a comment you must log in.
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

I'm not a ruby master, but looking at it and running it, it works! thanks :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/dash/dash-tests.rb'
2--- tests/dash/dash-tests.rb 2012-02-07 18:53:20 +0000
3+++ tests/dash/dash-tests.rb 2012-02-13 15:11:18 +0000
4@@ -214,6 +214,7 @@
5 test "Super, Super and Alt+F1 interaction" do
6 XDo::Mouse.move(200, 200, 0, true)
7 xid = TmpWindow.open_window_at(10,100)
8+ hide_mode = $SUT.execute_shell_command('gsettings get com.canonical.Unity2d.Launcher hide-mode').to_i
9 verify_equal( xid.id, TIMEOUT, 'terminal should have focus after starting it' ) {
10 XDo::XWindow.active_window
11 }
12@@ -231,7 +232,8 @@
13 verify_equal( xid.id, TIMEOUT, 'terminal should have focus after toggling the dash' ) {
14 XDo::XWindow.active_window
15 }
16- verify_equal( -LAUNCHER_WIDTH, TIMEOUT, 'Launcher should be hiding after toggling the dash' ) {
17+ verify_equal((hide_mode == 0) ? 0 : -LAUNCHER_WIDTH, TIMEOUT,
18+ 'Launcher position wrong after toggling the dash' ) {
19 @app.Launcher()['x_absolute'].to_i
20 }
21 XDo::Keyboard.alt_F1 #Must use uppercase F to indicate function keys
22
23=== modified file 'tests/launcher/autohide_show_tests.rb'
24--- tests/launcher/autohide_show_tests.rb 2012-02-07 11:18:21 +0000
25+++ tests/launcher/autohide_show_tests.rb 2012-02-13 15:11:18 +0000
26@@ -32,6 +32,7 @@
27 ############################# Test Suite #############################
28 context "Launcher Autohide and Show Tests" do
29 launcher_favorites = ""
30+ hide_mode = 0
31
32 def verify_launcher_visible(timeout, message = '')
33 verify_equal( 0, timeout, message ) {
34@@ -75,12 +76,18 @@
35 $SUT.execute_shell_command 'killall unity-2d-shell'
36 $SUT.execute_shell_command 'killall unity-2d-shell'
37
38+ hide_mode = $SUT.execute_shell_command 'gsettings get com.canonical.Unity2d.Launcher hide-mode'
39+
40+ # Set hide mode to intellihide
41+ $SUT.execute_shell_command 'gsettings set com.canonical.Unity2d.Launcher hide-mode 2'
42+
43 # Minimize all windows
44 XDo::XWindow.toggle_minimize_all
45 end
46
47 # Run once at the end of this test suite
48 shutdown do
49+ $SUT.execute_shell_command 'gsettings set com.canonical.Unity2d.Launcher hide-mode ' + hide_mode
50 end
51
52 # Run before each test case begins
53
54=== modified file 'tests/launcher/autohide_show_tests_rtl.rb'
55--- tests/launcher/autohide_show_tests_rtl.rb 2012-02-07 11:18:21 +0000
56+++ tests/launcher/autohide_show_tests_rtl.rb 2012-02-13 15:11:18 +0000
57@@ -32,6 +32,7 @@
58 ############################# Test Suite #############################
59 context "Launcher Autohide and Show Tests on RTL" do
60 launcher_favorites = ""
61+ hide_mode = 0
62
63 def verify_launcher_visible(timeout, message = '')
64 verify_equal( XDo::XWindow.display_geometry[0] - LAUNCHER_WIDTH, timeout, message ) {
65@@ -76,12 +77,18 @@
66 $SUT.execute_shell_command 'killall unity-2d-shell'
67 $SUT.execute_shell_command 'killall unity-2d-shell'
68
69+ hide_mode = $SUT.execute_shell_command 'gsettings get com.canonical.Unity2d.Launcher hide-mode'
70+
71+ # Set hide mode to intellihide
72+ $SUT.execute_shell_command 'gsettings set com.canonical.Unity2d.Launcher hide-mode 2'
73+
74 # Minimize all windows
75 XDo::XWindow.toggle_minimize_all
76 end
77
78 # Run once at the end of this test suite
79 shutdown do
80+ $SUT.execute_shell_command 'gsettings set com.canonical.Unity2d.Launcher hide-mode ' + hide_mode
81 end
82
83 # Run before each test case begins
84
85=== modified file 'tests/shell/input_shaping.rb'
86--- tests/shell/input_shaping.rb 2012-02-06 14:00:19 +0000
87+++ tests/shell/input_shaping.rb 2012-02-13 15:11:18 +0000
88@@ -33,6 +33,7 @@
89 ############################# Test Suite #############################
90 context "Shell input shape tests" do
91 pwd = File.expand_path(File.dirname(__FILE__)) + '/'
92+ hide_mode = 0
93
94 # Run once at the beginning of this test suite
95 startup do
96@@ -41,6 +42,11 @@
97 $SUT.execute_shell_command 'killall unity-2d-panel'
98 $SUT.execute_shell_command 'killall unity-2d-panel'
99
100+ hide_mode = $SUT.execute_shell_command 'gsettings get com.canonical.Unity2d.Launcher hide-mode'
101+
102+ # Set hide mode to intellihide
103+ $SUT.execute_shell_command 'gsettings set com.canonical.Unity2d.Launcher hide-mode 2'
104+
105 # Need panel running as position of shell depends on it
106 @@panel = $SUT.run(:name => UNITY_2D_PANEL,
107 :arguments => "-testability" )
108@@ -51,6 +57,7 @@
109
110 # Run once at the end of this test suite
111 shutdown do
112+ $SUT.execute_shell_command 'gsettings set com.canonical.Unity2d.Launcher hide-mode ' + hide_mode
113 end
114
115 # Run before each test case begins
116
117=== modified file 'tests/shell/input_shaping_rtl.rb'
118--- tests/shell/input_shaping_rtl.rb 2012-02-03 11:00:51 +0000
119+++ tests/shell/input_shaping_rtl.rb 2012-02-13 15:11:18 +0000
120@@ -33,6 +33,7 @@
121 ############################# Test Suite #############################
122 context "Shell input shape tests" do
123 pwd = File.expand_path(File.dirname(__FILE__)) + '/'
124+ hide_mode = 0
125
126 # Run once at the beginning of this test suite
127 startup do
128@@ -41,6 +42,11 @@
129 $SUT.execute_shell_command 'killall unity-2d-panel'
130 $SUT.execute_shell_command 'killall unity-2d-panel'
131
132+ hide_mode = $SUT.execute_shell_command 'gsettings get com.canonical.Unity2d.Launcher hide-mode'
133+
134+ # Set hide mode to intellihide
135+ $SUT.execute_shell_command 'gsettings set com.canonical.Unity2d.Launcher hide-mode 2'
136+
137 # Need panel running as position of shell depends on it
138 @@panel = $SUT.run(:name => UNITY_2D_PANEL,
139 :arguments => "-testability" )
140@@ -51,6 +57,7 @@
141
142 # Run once at the end of this test suite
143 shutdown do
144+ $SUT.execute_shell_command 'gsettings set com.canonical.Unity2d.Launcher hide-mode ' + hide_mode
145 end
146
147 # Run before each test case begins
148
149=== modified file 'tests/spread/spread-tests.rb'
150--- tests/spread/spread-tests.rb 2012-01-27 09:06:28 +0000
151+++ tests/spread/spread-tests.rb 2012-02-13 15:11:18 +0000
152@@ -86,11 +86,15 @@
153 # References
154 # * None
155 test "Super+s shows the launcher and the spread" do
156+ hide_mode = $SUT.execute_shell_command('gsettings get com.canonical.Unity2d.Launcher hide-mode').to_i
157+
158 verify_not(2, 'There should not be a Spread declarative view on startup') {
159 @app_spread.SpreadView()
160 }
161 xid = TmpWindow.open_window_at(10,100)
162- verify_equal(-LAUNCHER_WIDTH, TIMEOUT, 'The launcher should not be visible with an overlapping window') {
163+
164+ verify_equal((hide_mode == 0) ? 0 :-LAUNCHER_WIDTH, TIMEOUT,
165+ 'The launcher should not be visible with an overlapping window (unless Launcher in always-show mode)') {
166 @app_shell.Launcher()['x_absolute'].to_i
167 }
168 XDo::Keyboard.super_s

Subscribers

People subscribed via source and target branches