Merge lp:~townsend/unity/fix-failing-ap-tests into lp:unity

Proposed by Christopher Townsend
Status: Merged
Approved by: Stephen M. Webb
Approved revision: no longer in the source branch.
Merged at revision: 3610
Proposed branch: lp:~townsend/unity/fix-failing-ap-tests
Merge into: lp:unity
Diff against target: 185 lines (+27/-18)
7 files modified
tests/autopilot/unity/emulators/launcher.py (+2/-2)
tests/autopilot/unity/emulators/switcher.py (+2/-2)
tests/autopilot/unity/tests/launcher/test_scroll.py (+2/-2)
tests/autopilot/unity/tests/launcher/test_tooltips.py (+1/-1)
tests/autopilot/unity/tests/launcher/test_visual.py (+13/-5)
tests/autopilot/unity/tests/test_dash.py (+2/-2)
tests/autopilot/unity/tests/test_spread.py (+5/-4)
To merge this branch: bzr merge lp:~townsend/unity/fix-failing-ap-tests
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Brandon Schaefer (community) Approve
Review via email: mp+198631@code.launchpad.net

Commit message

Fix a bunch of failing AP tests due to changes in Unity.

Description of the change

Fix a bunch of failing AP tests due to changes in Unity.

To post a comment you must log in.
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

Nice catchs, and fixes!

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Francis Ginther (fginther) wrote :

Autoland failed to a change in internal ssh keys. This has been fixed, re-approving.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/autopilot/unity/emulators/launcher.py'
2--- tests/autopilot/unity/emulators/launcher.py 2013-11-14 01:56:41 +0000
3+++ tests/autopilot/unity/emulators/launcher.py 2013-12-11 19:20:38 +0000
4@@ -373,8 +373,8 @@
5 raise ValueError("'drag_type' parameter must be one of IconDragType.INSIDE, IconDragType.OUTSIDE")
6
7 icon_height = get_compiz_option("unityshell", "icon_size")
8- target_y = target.center_y
9- if target_y < icon.center_y:
10+ target_y = target.center.y
11+ if target_y < icon.center.y:
12 target_y += icon_height / 2
13 if pos == IconDragType.BEFORE:
14 target_y -= icon_height + (icon_height / 2)
15
16=== modified file 'tests/autopilot/unity/emulators/switcher.py'
17--- tests/autopilot/unity/emulators/switcher.py 2013-09-27 17:31:37 +0000
18+++ tests/autopilot/unity/emulators/switcher.py 2013-12-11 19:20:38 +0000
19@@ -250,8 +250,8 @@
20 offset = self.spread_offset
21 icon_arg = self.icon_args[index]
22
23- x = icon_arg.logical_center_x + offset
24- y = icon_arg.logical_center_y + offset
25+ x = icon_arg.logical_center.x + offset
26+ y = icon_arg.logical_center.y + offset
27
28 self._mouse.move(x,y)
29
30
31=== modified file 'tests/autopilot/unity/tests/launcher/test_scroll.py'
32--- tests/autopilot/unity/tests/launcher/test_scroll.py 2013-11-14 01:56:41 +0000
33+++ tests/autopilot/unity/tests/launcher/test_scroll.py 2013-12-11 19:20:38 +0000
34@@ -55,7 +55,7 @@
35
36 # Make sure the last icon is off the screen or else there is no
37 # scrolling.
38- self.assertThat(last_icon.center_y, Eventually(GreaterThan(h)))
39+ self.assertThat(last_icon.center.y, GreaterThan(h))
40
41 # Autoscroll to the last icon
42 launcher_instance.move_mouse_to_icon(last_icon, autoscroll_offset)
43@@ -87,7 +87,7 @@
44
45 # Make sure the first icon is off the screen or else there is no
46 # scrolling.
47- self.assertThat(first_icon.center_y, Eventually(LessThan(y)))
48+ self.assertThat(first_icon.center.y, LessThan(y))
49
50 # Autoscroll to the first icon
51 launcher_instance.move_mouse_to_icon(first_icon, autoscroll_offset)
52
53=== modified file 'tests/autopilot/unity/tests/launcher/test_tooltips.py'
54--- tests/autopilot/unity/tests/launcher/test_tooltips.py 2013-11-14 01:56:41 +0000
55+++ tests/autopilot/unity/tests/launcher/test_tooltips.py 2013-12-11 19:20:38 +0000
56@@ -77,7 +77,7 @@
57 self.assertEqual(self.get_reveal_behavior(bfb), self.NEVER)
58
59 # ... nor did it timeout instant tooltips for other icons
60- self.assertEqual(self.get_reveal_behavior(other), self.DELAYED)
61+ self.assertEqual(self.get_reveal_behavior(other), self.INSTANT)
62
63 # Tooltip reveal types
64 (INSTANT, DELAYED, NEVER) = range(3)
65
66=== modified file 'tests/autopilot/unity/tests/launcher/test_visual.py'
67--- tests/autopilot/unity/tests/launcher/test_visual.py 2013-11-14 01:56:41 +0000
68+++ tests/autopilot/unity/tests/launcher/test_visual.py 2013-12-11 19:20:38 +0000
69@@ -31,6 +31,8 @@
70 bfb = self.unity.launcher.model.get_bfb_icon()
71 self.mouse.move(bfb.center.x, bfb.center.y)
72 self.unity.dash.ensure_visible()
73+ current_monitor = self.unity.dash.monitor
74+
75 sleep(1)
76 # We can't use 'launcher_instance.switcher_start()' since it moves the mouse.
77 self.keybinding_hold_part_then_tap("launcher/switcher")
78@@ -39,18 +41,20 @@
79
80 self.keybinding_tap("launcher/switcher/next")
81 for icon in self.unity.launcher.model.get_launcher_icons():
82- self.assertThat(icon.desaturated, Eventually(Equals(False)))
83+ self.assertFalse(icon.monitors_desaturated[current_monitor])
84
85 def test_opening_dash_desaturates_icons(self):
86 """Opening the dash must desaturate all the launcher icons."""
87 self.unity.dash.ensure_visible()
88+ current_monitor = self.unity.dash.monitor
89+
90 self.addCleanup(self.unity.dash.ensure_hidden)
91
92 for icon in self.unity.launcher.model.get_launcher_icons():
93 if isinstance(icon, BFBLauncherIcon):
94- self.assertThat(icon.desaturated, Eventually(Equals(False)))
95+ self.assertFalse(icon.monitors_desaturated[current_monitor])
96 else:
97- self.assertThat(icon.desaturated, Eventually(Equals(True)))
98+ self.assertTrue(icon.monitors_desaturated[current_monitor])
99
100 def test_opening_dash_with_mouse_over_launcher_keeps_icon_saturation(self):
101 """Opening dash with mouse over launcher must not desaturate icons."""
102@@ -59,18 +63,22 @@
103 self.mouse.move(x + w/2, y + h/2)
104 sleep(.5)
105 self.unity.dash.ensure_visible()
106+ current_monitor = self.unity.dash.monitor
107+
108 self.addCleanup(self.unity.dash.ensure_hidden)
109 for icon in self.unity.launcher.model.get_launcher_icons():
110- self.assertThat(icon.desaturated, Eventually(Equals(False)))
111+ self.assertFalse(icon.monitors_desaturated[current_monitor])
112
113 def test_mouse_over_with_dash_open_desaturates_icons(self):
114 """Moving mouse over launcher with dash open must saturate icons."""
115 launcher_instance = self.get_launcher()
116 self.unity.dash.ensure_visible()
117+ current_monitor = self.unity.dash.monitor
118+
119 self.addCleanup(self.unity.dash.ensure_hidden)
120 sleep(.5)
121 x,y,w,h = launcher_instance.geometry
122 self.mouse.move(x + w/2, y + h/2)
123 sleep(.5)
124 for icon in self.unity.launcher.model.get_launcher_icons():
125- self.assertThat(icon.desaturated, Eventually(Equals(False)))
126+ self.assertFalse(icon.monitors_desaturated[current_monitor])
127
128=== modified file 'tests/autopilot/unity/tests/test_dash.py'
129--- tests/autopilot/unity/tests/test_dash.py 2013-08-27 17:25:35 +0000
130+++ tests/autopilot/unity/tests/test_dash.py 2013-12-11 19:20:38 +0000
131@@ -310,7 +310,7 @@
132 self.assertThat(scopebar.active_scope, Eventually(Equals(focused_icon)))
133
134 # scopebar should lose focus after activation.
135- self.assertThat(scopebar.focused_scope_icon, Eventually(Equals("")))
136+ self.assertFalse(hasattr(scopebar, 'focused_scope_icon'))
137
138 def test_focus_returns_to_searchbar(self):
139 """This test makes sure that the focus is returned to the searchbar of the newly
140@@ -326,7 +326,7 @@
141 self.keyboard.press_and_release("Enter")
142
143 self.assertThat(scopebar.active_scope, Eventually(Equals(focused_icon)))
144- self.assertThat(scopebar.focused_scope_icon, Eventually(Equals("")))
145+ self.assertFalse(hasattr(scopebar, 'focused_scope_icon'))
146
147 # Now we make sure if the newly activated scope searchbar have the focus.
148 self.keyboard.type("HasFocus")
149
150=== modified file 'tests/autopilot/unity/tests/test_spread.py'
151--- tests/autopilot/unity/tests/test_spread.py 2013-11-14 01:56:41 +0000
152+++ tests/autopilot/unity/tests/test_spread.py 2013-12-11 19:20:38 +0000
153@@ -22,6 +22,7 @@
154
155 def setUp(self):
156 super(SpreadTests, self).setUp()
157+ self.monitor = self.display.get_primary_screen()
158 self.launcher = self.unity.launcher.get_launcher_for_monitor(self.display.get_primary_screen())
159
160 def start_test_application_windows(self, app_name, num_windows=2):
161@@ -67,14 +68,14 @@
162
163 def assertLauncherIconsSaturated(self):
164 for icon in self.unity.launcher.model.get_launcher_icons():
165- self.assertThat(icon.desaturated, Eventually(Equals(False)))
166+ self.assertFalse(icon.monitors_desaturated[self.monitor])
167
168 def assertLauncherIconsDesaturated(self, also_active=True):
169 for icon in self.unity.launcher.model.get_launcher_icons():
170 if isinstance(icon, BFBLauncherIcon) or (not also_active and icon.active):
171- self.assertThat(icon.desaturated, Eventually(Equals(False)))
172+ self.assertFalse(icon.monitors_desaturated[self.monitor])
173 else:
174- self.assertThat(icon.desaturated, Eventually(Equals(True)))
175+ self.assertTrue(icon.monitors_desaturated[self.monitor])
176
177 def test_scale_application_windows(self):
178 """All the windows of an application must be scaled when application
179@@ -189,4 +190,4 @@
180 self.assertThat(icon.get_tooltip().active, Eventually(Equals(True)))
181
182 self.initiate_spread_for_screen()
183- self.assertThat(icon.get_tooltip().active, Eventually(Equals(False)))
184\ No newline at end of file
185+ self.assertThat(icon.get_tooltip().active, Eventually(Equals(False)))