on xenial help sign in
Make addition for big screen test, there might be a better way to do this.
78e0bc9Christopher Lee
tests/autopilot/unity8/shell/tests/__init__.py+8−4
@@ -82,10 +82,14 @@ class Unity8TestCase(AutopilotTestCase):
82 self.patch_environment("GRID_UNIT_PX", str(self.grid_size))
82 self.patch_environment("GRID_UNIT_PX", str(self.grid_size))
83
83
84 def _geo_larger_than_display(self, width, height):
84 def _geo_larger_than_display(self, width, height):
85+ should_scale = getattr(self, 'scale_geo', True)
86+ if should_scale:
85− screen = Display.create()
87+ screen = Display.create()
86− screen_width = screen.get_screen_width()
88+ screen_width = screen.get_screen_width()
87− screen_height = screen.get_screen_height()
89+ screen_height = screen.get_screen_height()
88− return (width > screen_width) or (height > screen_height)
90+ return (width > screen_width) or (height > screen_height)
91+ else:
92+ return False
89
93
90 def _get_scaled_down_geo(self, width, height):
94 def _get_scaled_down_geo(self, width, height):
91 divisor = 1
95 divisor = 1
tests/autopilot/unity8/shell/tests/test_big_screen_alignment.py+3−1
@@ -18,7 +18,9 @@ from unity8.shell.tests import Unity8TestCase
18# Also, this doesn't work as automatically scales the geometry . . .
18# Also, this doesn't work as automatically scales the geometry . . .
19class ScreenAlignmentTests(Unity8TestCase):
19class ScreenAlignmentTests(Unity8TestCase):
20
20
21+ scenarios = [
21− scenarios = [('Big Screen', dict(app_width=2560, app_height=1600, grid_unit_px=20))]
22+ ('Big Screen', dict(app_width=2560, app_height=1600, grid_unit_px=20, scale_geo=False))
23+ ]
22
24
23 def test_hud_not_shown_greeter(self):
25 def test_hud_not_shown_greeter(self):
24 self.launch_unity()
26 self.launch_unity()