Merge lp:~townsend/unity/fix-lp1436095-trusty into lp:unity/7.2

Proposed by Christopher Townsend
Status: Merged
Approved by: Stephen M. Webb
Approved revision: no longer in the source branch.
Merged at revision: 3829
Proposed branch: lp:~townsend/unity/fix-lp1436095-trusty
Merge into: lp:unity/7.2
Diff against target: 32 lines (+15/-6)
1 file modified
tests/autopilot/unity/tests/test_spread.py (+15/-6)
To merge this branch: bzr merge lp:~townsend/unity/fix-lp1436095-trusty
Reviewer Review Type Date Requested Status
Stephen M. Webb (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+259292@code.launchpad.net

Commit message

AP tests: accounted for arbitrarily-raised exceptions in checking scaled windows

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Stephen M. Webb (bregma) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tests/autopilot/unity/tests/test_spread.py'
--- tests/autopilot/unity/tests/test_spread.py 2014-03-05 22:14:16 +0000
+++ tests/autopilot/unity/tests/test_spread.py 2015-05-15 19:56:54 +0000
@@ -59,13 +59,22 @@
59 self.assertThat(lambda: self.unity.screen.spread_filter, Eventually(NotEquals(None)))59 self.assertThat(lambda: self.unity.screen.spread_filter, Eventually(NotEquals(None)))
60 return self.unity.screen.spread_filter60 return self.unity.screen.spread_filter
6161
62 def assertWindowIsScaledEquals(self, xid, scaled):62 def assertWindowIsScaledEquals(self, xid, is_scaled):
63 """Assert weather a window is scaled"""63 """Assert weather a window is scaled"""
64 # Add a short delay to ensure the Spread has finished.64 def scaled_windows_for_screen_contains_xid():
65 sleep(0.5)65 """Predicates the window is in the list of scaled windows for the screen.
6666 The DBus introspection object actually raises an exception if you try to look
67 refresh_fn = lambda: xid in [w.xid for w in self.unity.screen.scaled_windows]67 at a window in the scaled_windows list and it's not a scaled window. Buggzorz.
68 self.assertThat(refresh_fn, Eventually(Equals(scaled)))68 """
69 scaled_windows = self.unity.screen.scaled_windows
70 for w in scaled_windows:
71 try:
72 if xid == w.xid:
73 return True
74 except:
75 pass
76 return False
77 self.assertThat(scaled_windows_for_screen_contains_xid, Eventually(Equals(is_scaled)))
6978
70 def assertWindowIsClosed(self, xid):79 def assertWindowIsClosed(self, xid):
71 """Assert that a window is not in the list of the open windows"""80 """Assert that a window is not in the list of the open windows"""

Subscribers

People subscribed via source and target branches

to status/vote changes: