summaryrefslogtreecommitdiff
path: root/tests
diff options
authorBrandon Schaefer <brandontschaefer@gmail.com>2012-07-26 23:09:07 -0400
committerTarmac <>2012-07-26 23:09:07 -0400
commit0d0b998a22cc38adcb223c95078e771a31a11533 (patch)
tree2bd34a277c79cb7137508449a918b2d7705ccc6c /tests
parent0d83b00c120d0c6e263a48d4e7ef923c1ccc7787 (diff)
parent41bee1697648319abdb3c2bf0e3bad0575405af8 (diff)
The switcher in detail mode will now focus the last active window, instead of the current one. If the current focus window activated the switcher.. Fixes: https://bugs.launchpad.net/bugs/1029215. Approved by Christopher Lee.
(bzr r2524)
Diffstat (limited to 'tests')
-rw-r--r--tests/autopilot/unity/tests/test_switcher.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/autopilot/unity/tests/test_switcher.py b/tests/autopilot/unity/tests/test_switcher.py
index f3a301959..9cd23bd43 100644
--- a/tests/autopilot/unity/tests/test_switcher.py
+++ b/tests/autopilot/unity/tests/test_switcher.py
@@ -308,6 +308,20 @@ class SwitcherDetailsModeTests(SwitcherTestCase):
self.switcher.next_icon()
self.assertThat(self.switcher.selection_index, Eventually(Equals(0)))
+ def test_detail_mode_selects_last_active_window(self):
+ """The active selection in detail mode must be the last focused window.
+ If it was the currently active application type.
+ """
+ calc_win1, calc_win2 = self.start_applications("Calculator", "Calculator")
+ self.assertVisibleWindowStack([calc_win2, calc_win1])
+
+ self.switcher.initiate()
+ self.keyboard.press_and_release(self.initiate_keycode)
+ sleep(0.5)
+ self.switcher.select()
+
+ self.assertProperty(calc_win1, is_focused=True)
+
class SwitcherWorkspaceTests(SwitcherTestCase):
"""Test Switcher behavior with respect to multiple workspaces."""
@@ -339,7 +353,6 @@ class SwitcherWorkspaceTests(SwitcherTestCase):
self.workspace.switch_to(2)
char_map = self.start_app("Character Map")
-
self.switcher.initiate(SwitcherMode.ALL)
self.addCleanup(self.switcher.terminate)