summaryrefslogtreecommitdiff
diff options
authorThomi Richards <thomi.richards@canonical.com>2012-02-07 15:08:19 +1300
committerThomi Richards <thomi.richards@canonical.com>2012-02-07 15:08:19 +1300
commit3a3384f01fc71906cc59ca7f2d78f37181d357de (patch)
treeff1e909279d4bece6c6f4d00cb49bf7886d3d18f
parent07b2f8209e88b6efece47b848cff2b1758587431 (diff)
completed tests.
(bzr r1882.2.18)
-rw-r--r--tests/autopilot/autopilot/tests/test_invisible_windows.py32
1 files changed, 21 insertions, 11 deletions
diff --git a/tests/autopilot/autopilot/tests/test_invisible_windows.py b/tests/autopilot/autopilot/tests/test_invisible_windows.py
index 307d765a4..44e06d438 100644
--- a/tests/autopilot/autopilot/tests/test_invisible_windows.py
+++ b/tests/autopilot/autopilot/tests/test_invisible_windows.py
@@ -17,7 +17,6 @@ from time import sleep
from autopilot.utilities import make_window_skip_taskbar
from autopilot.emulators.unity import Launcher, Switcher
from autopilot.emulators.bamf import Bamf
-from autopilot.emulators.X11 import Mouse
class InvisibleWindowTests(TestCase):
"""Test unity's handling of windows with the Skip-Tasklist flag set."""
@@ -72,18 +71,29 @@ class InvisibleWindowTests(TestCase):
launcher.reveal_launcher(0)
icons = launcher.get_launcher_icons()
# launcher.grab_switcher()
- found = False
- # current_icon = None
+ calc_icon = None
for icon in icons:
if icon.tooltip_text == 'Calculator':
- found = True
- launcher.lock_to_launcher(icon)
- self.addCleanup(launcher.unlock_from_launcher, icon)
+ calc_icon = icon
break
- self.assertTrue(found, "Could not find calculator in launcher.")
- # launcher.switcher_enter_quicklist()
- # quicklist = current_icon.get_quicklist()
- # self.assertTrue(quicklist.active)
+ self.assertIsNotNone(calc_icon, "Could not find calculator in launcher.")
+ launcher.lock_to_launcher(calc_icon)
+ self.addCleanup(launcher.unlock_from_launcher, calc_icon)
- # launcher.end_switcher(cancel=True)
+ # make calc window skip the taskbar:
+ apps = b.get_running_applications_by_title('Calculator')
+ self.assertEqual(1, len(apps))
+ windows = apps[0].get_windows()
+ self.assertEqual(1, len(windows))
+ make_window_skip_taskbar(windows[0].x_win)
+
+ # clicking on launcher icon should start a new instance:
+ launcher.click_launcher_icon(calc_icon)
+ sleep(1)
+
+ # should now be one app with two windows:
+ apps = b.get_running_applications_by_title('Calculator')
+ self.assertEqual(1, len(apps))
+ windows = apps[0].get_windows()
+ self.assertEqual(2, len(windows))