Merge lp:~aacid/unity-2d/unity-2d-shell-shaped_testability_tests into lp:~unity-2d-team/unity-2d/unity-2d-shell-shaped

Proposed by Albert Astals Cid
Status: Rejected
Rejected by: Michał Sawicz
Proposed branch: lp:~aacid/unity-2d/unity-2d-shell-shaped_testability_tests
Merge into: lp:~unity-2d-team/unity-2d/unity-2d-shell-shaped
Diff against target: 228 lines (+30/-32)
3 files modified
tests/launcher/autohide_show_tests.rb (+22/-22)
tests/launcher/visual_verification.rb (+6/-6)
tests/run-tests.rb (+2/-4)
To merge this branch: bzr merge lp:~aacid/unity-2d/unity-2d-shell-shaped_testability_tests
Reviewer Review Type Date Requested Status
Michał Sawicz Abstain
Ugo Riboni Pending
Review via email: mp+88705@code.launchpad.net

Description of the change

Fix the testability tests so that they run in the shell, also fix some code so that the test pass

To post a comment you must log in.
918. By Albert Astals Cid

Tauler -> Dash home, :-/

Revision history for this message
Michał Sawicz (saviq) wrote :
review: Abstain
919. By Albert Astals Cid

Merge

Revision history for this message
Michał Sawicz (saviq) wrote :

Lets do that against unity-2d-shell (non-shaped).

review: Abstain

Unmerged revisions

919. By Albert Astals Cid

Merge

918. By Albert Astals Cid

Tauler -> Dash home, :-/

917. By Albert Astals Cid

Small pixel pushing to pass the visual test

916. By Albert Astals Cid

Adapt the tests to unity-2d-shell

Also fix a test regression where the launcher has to be 65 wide and not 66

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 10:43:24 +0000
4@@ -45,8 +45,8 @@
5
6 # Run once at the beginning of this test suite
7 startup do
8- system 'killall unity-2d-launcher > /dev/null 2>&1'
9- system 'killall unity-2d-launcher > /dev/null 2>&1'
10+ system 'killall unity-2d-shell > /dev/null 2>&1'
11+ system 'killall unity-2d-shell > /dev/null 2>&1'
12
13 # Minimize all windows
14 XDo::XWindow.toggle_minimize_all
15@@ -63,18 +63,18 @@
16
17 # Execute the application
18 @sut = TDriver.sut(:Id => "sut_qt")
19- @app = @sut.run( :name => UNITY_2D_LAUNCHER,
20+ @app = @sut.run( :name => UNITY_2D_SHELL,
21 :arguments => "-testability",
22 :sleeptime => 2 )
23 # Make certain application is ready for testing
24- verify(10){ @app.Unity2dPanel() }
25+ verify(10){ @app.Launcher() }
26 end
27
28 # Run after each test case completes
29 teardown do
30 #@app.close
31 #Need to kill Launcher as it does not shutdown when politely asked
32- system "pkill -nf unity-2d-launcher"
33+ system "pkill -nf unity-2d-shell"
34 end
35
36 #####################################################################################
37@@ -82,10 +82,10 @@
38
39 test "Position with Empty Desktop" do
40 # check width before proceeding
41- assert_equal( Integer(@app.Unity2dPanel()['width']), WIDTH,
42+ assert_equal( Integer(@app.Launcher()['width']), WIDTH,
43 "Launcher is not #{WIDTH} pixels wide on screen!" )
44
45- assert_equal( Integer(@app.Unity2dPanel()['x_absolute']), 0, \
46+ assert_equal( Integer(@app.Launcher()['x_absolute']), 0, \
47 'Launcher hiding on empty desktop, should be visible' )
48 end
49
50@@ -93,7 +93,7 @@
51 # Open Terminal with position 100x100
52 xid = open_window_at(100,100)
53 sleep 0.5
54- assert_equal( Integer(@app.Unity2dPanel()['x_absolute']), 0, \
55+ assert_equal( Integer(@app.Launcher()['x_absolute']), 0, \
56 'Launcher hiding when window not in the way, should be visible' )
57 xid.close!
58 end
59@@ -102,7 +102,7 @@
60 # Open Terminal with position 40x100
61 xid = open_window_at(40,100)
62 sleep 0.5
63- assert_equal( Integer(@app.Unity2dPanel()['x_absolute']), -WIDTH, \
64+ assert_equal( Integer(@app.Launcher()['x_absolute']), -WIDTH, \
65 'Launcher visible when window in the way, should be hidden' )
66 xid.close!
67 end
68@@ -111,15 +111,15 @@
69 # Open Terminal with position 100x100
70 xid = open_window_at(100,100)
71 sleep 0.5
72- assert_equal( Integer(@app.Unity2dPanel()['x_absolute']), 0, \
73+ assert_equal( Integer(@app.Launcher()['x_absolute']), 0, \
74 'Launcher hiding when window not in the way, should be visible' )
75 xid.move(WIDTH-1,100)
76 sleep 1
77- assert_equal( Integer(@app.Unity2dPanel()['x_absolute']), -WIDTH, \
78+ assert_equal( Integer(@app.Launcher()['x_absolute']), -WIDTH, \
79 'Launcher visible when window in the way, should be hidden' )
80 xid.move(WIDTH,100)
81 sleep 0.5
82- assert_equal( Integer(@app.Unity2dPanel()['x_absolute']), 0, \
83+ assert_equal( Integer(@app.Launcher()['x_absolute']), 0, \
84 'Launcher hiding when window not in the way, should be visible' )
85 xid.close!
86 end
87@@ -127,19 +127,19 @@
88 test "Reveal hidden Launcher with mouse" do
89 xid = open_window_at(10,100)
90 sleep 0.5
91- assert_equal( Integer(@app.Unity2dPanel()['x_absolute']), -WIDTH, \
92+ assert_equal( Integer(@app.Launcher()['x_absolute']), -WIDTH, \
93 'Launcher visible with window in the way, should be hidden' )
94 XDo::Mouse.move(0,200)
95 sleep 1
96- assert_equal( Integer(@app.Unity2dPanel()['x_absolute']), 0, \
97+ assert_equal( Integer(@app.Launcher()['x_absolute']), 0, \
98 'Launcher hiding when mouse at left edge of screen' )
99 XDo::Mouse.move(WIDTH-1,200)
100 sleep 2
101- assert_equal( Integer(@app.Unity2dPanel()['x_absolute']), 0, \
102+ assert_equal( Integer(@app.Launcher()['x_absolute']), 0, \
103 'Launcher should still be visible as mouse over it' )
104 XDo::Mouse.move(WIDTH,200)
105 sleep 2
106- assert_equal( Integer(@app.Unity2dPanel()['x_absolute']), -WIDTH, \
107+ assert_equal( Integer(@app.Launcher()['x_absolute']), -WIDTH, \
108 'Launcher visible with window in the way and mouse moved out, should be hidden' )
109 xid.close!
110 end
111@@ -147,11 +147,11 @@
112 test "Hold Super key down to reveal launcher and shortcut keys" do
113 xid = open_window_at(10,100)
114 sleep 0.5
115- assert_equal( Integer(@app.Unity2dPanel()['x_absolute']), -WIDTH, \
116+ assert_equal( Integer(@app.Launcher()['x_absolute']), -WIDTH, \
117 'Launcher visible with window in the way, should be hidden' )
118 XDo::Keyboard.key_down('SUPER')
119 sleep 2
120- assert_equal( Integer(@app.Unity2dPanel()['x_absolute']), 0, \
121+ assert_equal( Integer(@app.Launcher()['x_absolute']), 0, \
122 'Launcher hiding when Super Key held, should be visible' )
123
124 assert_equal( @app.LauncherList( :name => 'main' ) \
125@@ -161,7 +161,7 @@
126 'Shortcut on Home Folder icon not displaying with Super key held' )
127 XDo::Keyboard.key_up('SUPER')
128 sleep 2
129- assert_equal( Integer(@app.Unity2dPanel()['x_absolute']), -WIDTH, \
130+ assert_equal( Integer(@app.Launcher()['x_absolute']), -WIDTH, \
131 'Launcher visible with window in the way and mouse moved out, should be hidden' )
132 xid.close!
133 end
134@@ -169,11 +169,11 @@
135 test "Press Alt+F1 to focus Launcher" do
136 xid = open_window_at(10,100)
137 sleep 0.5
138- assert_equal( Integer(@app.Unity2dPanel()['x_absolute']), -WIDTH, \
139+ assert_equal( Integer(@app.Launcher()['x_absolute']), -WIDTH, \
140 'Launcher visible with window in the way, should be hidden' )
141 XDo::Keyboard.alt_F1 #Must use uppercase F to indicate function keys
142 sleep 0.5
143- assert_equal( Integer(@app.Unity2dPanel()['x_absolute']), 0, \
144+ assert_equal( Integer(@app.Launcher()['x_absolute']), 0, \
145 'Launcher hiding after Alt+F1 pressed, should be visible' )
146
147 assert_equal( @app.LauncherList( :name => 'main' ) \
148@@ -182,7 +182,7 @@
149 'Dash icon not highlighted after Alt+F1 pressed' )
150 XDo::Keyboard.escape
151 sleep 2
152- assert_equal( Integer(@app.Unity2dPanel()['x_absolute']), -WIDTH, \
153+ assert_equal( Integer(@app.Launcher()['x_absolute']), -WIDTH, \
154 'Launcher visible with window in the way and mouse moved out, should be hidden' )
155 xid.close!
156 end
157
158=== modified file 'tests/launcher/visual_verification.rb'
159--- tests/launcher/visual_verification.rb 2011-12-12 22:57:15 +0000
160+++ tests/launcher/visual_verification.rb 2012-01-17 10:43:24 +0000
161@@ -30,8 +30,8 @@
162
163 # Run once at the beginning of this test suite
164 startup do
165- system 'killall unity-2d-launcher > /dev/null 2>&1'
166- system 'killall unity-2d-launcher > /dev/null 2>&1'
167+ system 'killall unity-2d-shell > /dev/null 2>&1'
168+ system 'killall unity-2d-shell > /dev/null 2>&1'
169 end
170
171 # Run once at the end of this test suite
172@@ -42,7 +42,7 @@
173 setup do
174 # Execute the application
175 @sut = TDriver.sut(:Id => "sut_qt")
176- @app = @sut.run( :name => UNITY_2D_LAUNCHER,
177+ @app = @sut.run( :name => UNITY_2D_SHELL,
178 :arguments => "-testability",
179 :sleeptime => 2 )
180 end
181@@ -51,7 +51,7 @@
182 teardown do
183 #@app.close
184 #Need to kill Launcher as it does not shutdown when politely asked
185- system "pkill -nf unity-2d-launcher"
186+ system "pkill -nf unity-2d-shell"
187 end
188
189 #####################################################################################
190@@ -60,7 +60,7 @@
191 test "Visually compare Dash tile with reference" do
192 expected_image = pwd + 'verification/dash-tile.png'
193
194- dash_tile = @app.Unity2dPanel() \
195+ dash_tile = @app.Launcher() \
196 .LauncherList( :name => 'main' ) \
197 .QDeclarativeItem( :name => 'Dash home' ) \
198 .QDeclarativeItem()
199@@ -73,7 +73,7 @@
200 test "Check Dash Tile location in Launcher" do
201 expected_image = pwd + 'verification/dash-tile.png'
202
203- tile_list = @app.Unity2dPanel().LauncherList( :name => 'main' )
204+ tile_list = @app.Launcher().LauncherList( :name => 'main' )
205
206 # Given the reference image, locate the matching visual in the LauncherList
207 coordinates = tile_list.find_on_screen(expected_image, 4)
208
209=== modified file 'tests/run-tests.rb'
210--- tests/run-tests.rb 2011-12-12 22:51:48 +0000
211+++ tests/run-tests.rb 2012-01-17 10:43:24 +0000
212@@ -41,15 +41,13 @@
213 if File.exists?(binary_dir_file)
214 binary_dir = File.open(binary_dir_file).first.strip
215 puts 'Running tests on applications contained within ' + binary_dir
216- UNITY_2D_LAUNCHER = binary_dir + '/launcher/app/unity-2d-launcher'
217+ UNITY_2D_SHELL = binary_dir + '/shell/app/unity-2d-shell'
218 UNITY_2D_PANEL = binary_dir + '/panel/app/unity-2d-panel'
219- UNITY_2D_PLACES = binary_dir + '/places/app/unity-2d-places'
220 UNITY_2D_SPREAD = binary_dir + '/spread/app/unity-2d-spread'
221 else
222 puts 'NOTICE: source not configured, tests will be carried out on *installed* applications!'
223- UNITY_2D_LAUNCHER = 'unity-2d-launcher'
224+ UNITY_2D_SHELL = 'unity-2d-shell'
225 UNITY_2D_PANEL = 'unity-2d-panel'
226- UNITY_2D_PLACES = 'unity-2d-places'
227 UNITY_2D_SPREAD = 'unity-2d-spread'
228 end
229

Subscribers

People subscribed via source and target branches