diff options
| author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2014-01-23 12:16:00 +0100 |
|---|---|---|
| committer | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2014-01-23 12:16:00 +0100 |
| commit | ea31f68283591a57f11e5794a11b9e043b4e793c (patch) | |
| tree | 64dfef8f28bb8b5b3b9a7c6ad0af544545dfe45d /tests | |
| parent | b4e9355e9553e245d743d36cfc62b9845f80e294 (diff) | |
| parent | a7979ed15c2581910fead827657ab75791f4efb2 (diff) | |
Merging with trunk, again
(bzr r3566.5.256)
Diffstat (limited to 'tests')
8 files changed, 38 insertions, 4 deletions
diff --git a/tests/autopilot/unity/emulators/launcher.py b/tests/autopilot/unity/emulators/launcher.py index 0f6999791..657fed53e 100644 --- a/tests/autopilot/unity/emulators/launcher.py +++ b/tests/autopilot/unity/emulators/launcher.py @@ -128,9 +128,9 @@ class Launcher(UnityIntrospectionObject, KeybindingsHelper): # Only try 10 times (5 secs.) before giving up. for i in xrange(0, 10): - mouse_x = target_x = icon.center.x + self.x + mouse_x = target_x = icon.center.x mouse_y = target_y = icon.center.y - if target_y > h: + if target_y > h + y: mouse_y = h + y - autoscroll_offset elif target_y < 0: mouse_y = y + autoscroll_offset diff --git a/tests/autopilot/unity/tests/launcher/test_icon_behavior.py b/tests/autopilot/unity/tests/launcher/test_icon_behavior.py index 564d5b1d8..c002da376 100644 --- a/tests/autopilot/unity/tests/launcher/test_icon_behavior.py +++ b/tests/autopilot/unity/tests/launcher/test_icon_behavior.py @@ -29,6 +29,10 @@ class LauncherIconsTests(LauncherTestCase): def setUp(self): super(LauncherIconsTests, self).setUp() + + if not self.launcher_instance: + self.skipTest("Cannot run test with no Launcher on monitor") + self.set_unity_option('launcher_hide_mode', 0) def ensure_expo_launcher_icon(self): @@ -367,6 +371,10 @@ class LauncherDragIconsBehavior(LauncherTestCase): def setUp(self): super(LauncherDragIconsBehavior, self).setUp() + + if not self.launcher_instance: + self.skipTest("Cannot run test with no Launcher on monitor") + self.set_unity_option('launcher_hide_mode', 0) def ensure_calc_icon_not_in_launcher(self): diff --git a/tests/autopilot/unity/tests/launcher/test_keynav.py b/tests/autopilot/unity/tests/launcher/test_keynav.py index fabc3f849..3bd457500 100644 --- a/tests/autopilot/unity/tests/launcher/test_keynav.py +++ b/tests/autopilot/unity/tests/launcher/test_keynav.py @@ -21,6 +21,12 @@ logger = logging.getLogger(__name__) class LauncherKeyNavTests(LauncherTestCase): """Test the launcher key navigation""" + def setUp(self): + super(LauncherKeyNavTests, self).setUp() + + if not self.launcher_instance: + self.skipTest("Cannot run test with no Launcher on monitor") + def start_keynav_with_cleanup_cancel(self): """Start keynav mode safely. diff --git a/tests/autopilot/unity/tests/launcher/test_reveal.py b/tests/autopilot/unity/tests/launcher/test_reveal.py index 922cc1efd..f9f1bdfc1 100644 --- a/tests/autopilot/unity/tests/launcher/test_reveal.py +++ b/tests/autopilot/unity/tests/launcher/test_reveal.py @@ -25,6 +25,10 @@ class LauncherRevealTests(LauncherTestCase): def setUp(self): super(LauncherRevealTests, self).setUp() + + if not self.launcher_instance: + self.skipTest("Cannot run test with no Launcher on monitor") + # these automatically reset to the original value, as implemented in AutopilotTestCase self.set_unity_option('launcher_capture_mouse', True) self.set_unity_option('launcher_hide_mode', 1) diff --git a/tests/autopilot/unity/tests/launcher/test_scroll.py b/tests/autopilot/unity/tests/launcher/test_scroll.py index a274135fa..6ac3e4e94 100644 --- a/tests/autopilot/unity/tests/launcher/test_scroll.py +++ b/tests/autopilot/unity/tests/launcher/test_scroll.py @@ -44,7 +44,7 @@ class LauncherScrollTests(LauncherTestCase): launcher_instance = self.get_launcher() (x, y, w, h) = launcher_instance.geometry - icons = self.unity.launcher.model.get_launcher_icons() + icons = self.unity.launcher.model.get_launcher_icons_for_monitor(self.launcher_monitor) num_icons = self.unity.launcher.model.num_launcher_icons() last_icon = icons[num_icons - 1] @@ -76,12 +76,14 @@ class LauncherScrollTests(LauncherTestCase): launcher_instance = self.get_launcher() (x, y, w, h) = launcher_instance.geometry - icons = self.unity.launcher.model.get_launcher_icons() + icons = self.unity.launcher.model.get_launcher_icons_for_monitor(self.launcher_monitor) num_icons = self.unity.launcher.model.num_launcher_icons() first_icon = icons[0] last_icon = icons[num_icons - 1] + launcher_instance.move_mouse_over_launcher() + # Move to the last icon in order to expand the top of the Launcher launcher_instance.move_mouse_to_icon(last_icon) diff --git a/tests/autopilot/unity/tests/launcher/test_shortcut.py b/tests/autopilot/unity/tests/launcher/test_shortcut.py index 28d661395..a625c9d10 100644 --- a/tests/autopilot/unity/tests/launcher/test_shortcut.py +++ b/tests/autopilot/unity/tests/launcher/test_shortcut.py @@ -24,6 +24,10 @@ class LauncherShortcutTests(LauncherTestCase): def setUp(self): super(LauncherShortcutTests, self).setUp() + + if not self.launcher_instance: + self.skipTest("Cannot run test with no Launcher on monitor") + self.launcher_instance.keyboard_reveal_launcher() self.addCleanup(self.launcher_instance.keyboard_unreveal_launcher) sleep(2) diff --git a/tests/autopilot/unity/tests/launcher/test_switcher.py b/tests/autopilot/unity/tests/launcher/test_switcher.py index 06f82792b..d93025ae0 100644 --- a/tests/autopilot/unity/tests/launcher/test_switcher.py +++ b/tests/autopilot/unity/tests/launcher/test_switcher.py @@ -24,6 +24,12 @@ logger = logging.getLogger(__name__) class LauncherSwitcherTests(LauncherTestCase): """ Tests the functionality of the launcher's switcher capability""" + def setUp(self): + super(LauncherSwitcherTests, self).setUp() + + if not self.launcher_instance: + self.skipTest("Cannot run test with no Launcher on monitor") + def start_switcher_with_cleanup_cancel(self): """Start switcher mode safely. diff --git a/tests/autopilot/unity/tests/launcher/test_tooltips.py b/tests/autopilot/unity/tests/launcher/test_tooltips.py index 4ea8e53a3..ad54c2c15 100644 --- a/tests/autopilot/unity/tests/launcher/test_tooltips.py +++ b/tests/autopilot/unity/tests/launcher/test_tooltips.py @@ -17,6 +17,10 @@ class LauncherTooltipTests(LauncherTestCase): def setUp(self): super(LauncherTooltipTests, self).setUp() + + if not self.launcher_instance: + self.skipTest("Cannot run test with no Launcher on monitor") + self.set_unity_option('launcher_hide_mode', 0) self.launcher_instance.move_mouse_to_right_of_launcher() self.icons = self.unity.launcher.model.get_launcher_icons(visible_only=True) |
