on xenial help sign in
Fix indicators_client geometry.
commit0a301ae5e08ea472fea0f572bea3108d3afd197d authorMichał Sawicz <michal.sawicz@canonical.com> dateTue 23 Jul 2013, 13:20 (13 years ago) parent34e252b
2 files changed+9−6
tests/autopilot/unity8/indicators_client/tests/__init__.py+8−5 tests/autopilot/unity8/indicators_client/tests/test_battery.py+1−1
tests/autopilot/unity8/indicators_client/tests/__init__.py+8−5
@@ -30,19 +30,22 @@ class IndicatorsTestCase(AutopilotTestCase):
3030
3131 """A common test case class that provides several useful methods for indicator tests."""
3232
33+ geometry = None
34+ grid_unit = None
35+
3336 if model() == 'Desktop':
3437 scenarios = [
35− ('with mouse', dict(input_device_class=Mouse, grid_unit="12")),
38+ ('with mouse', dict(input_device_class=Mouse, geometry="400x800", grid_unit="12")),
3639 ]
3740 else:
3841 scenarios = [
39− ('with touch', dict(input_device_class=Touch, grid_unit="0")),
42+ ('with touch', dict(input_device_class=Touch)),
4043 ]
4144
4245 def setUp(self, geometry, grid_size):
4346 self.pointing_device = Pointer(self.input_device_class.create())
4447 super(IndicatorsTestCase, self).setUp()
45− if grid_size != "0":
48+ if grid_size is not None:
4649 self.patch_environment("GRID_UNIT_PX", str(grid_size))
4750 self.grid_size = int(grid_size)
4851 else:
@@ -54,7 +57,7 @@ class IndicatorsTestCase(AutopilotTestCase):
5457 self.launch_test_local(geometry)
5558
5659 def launch_test_local(self, geometry):
57− if geometry != "0x0":
60+ if geometry is None:
5861 self.app = self.launch_test_application(get_binary_path("indicators-client"),
5962 "-geometry", geometry, app_type='qt')
6063 else:
@@ -62,7 +65,7 @@ class IndicatorsTestCase(AutopilotTestCase):
6265 app_type='qt')
6366
6467 def launch_test_installed(self, geometry):
65− if geometry != "0x0":
68+ if geometry is not None:
6669 self.app = self.launch_test_application("indicators-client", "-geometry", geometry, app_type='qt')
6770 else:
6871 self.app = self.launch_test_application("indicators-client", app_type='qt')
tests/autopilot/unity8/indicators_client/tests/test_battery.py+1−1
@@ -18,7 +18,7 @@ import math
1818
1919class TestDisplayMenus(IndicatorsTestCase):
2020 def setUp(self):
21− super(TestDisplayMenus, self).setUp("400x800", self.grid_unit)
21+ super(TestDisplayMenus, self).setUp(self.geometry, self.grid_unit)
2222
2323 # This opens the messaging menu so you don't have to do that in
2424 # every test case