~azzar1/unity/fix-1059562-6.0

« back to all changes in this revision

Viewing changes to tests/autopilot/unity/tests/__init__.py

UnityShell: enable closing on middle-click, fix scaled decoration sizes, fix theming issues, added scale autopilot tests. Fixes: https://bugs.launchpad.net/bugs/1052821, https://bugs.launchpad.net/bugs/1053225, https://bugs.launchpad.net/bugs/1055605, https://bugs.launchpad.net/bugs/1055609, https://bugs.launchpad.net/bugs/1055610. Approved by Brandon Schaefer.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
from testtools.content import text_content
21
21
from testtools.matchers import Equals
22
22
 
 
23
from unity.emulators.screen import Screen
23
24
from unity.emulators.dash import Dash
24
25
from unity.emulators.hud import Hud
25
26
from unity.emulators.launcher import LauncherController
114
115
        return True
115
116
 
116
117
    @property
 
118
    def screen(self):
 
119
        if not getattr(self, '__screen', None):
 
120
            self.__screen = self._get_screen()
 
121
        return self.__screen
 
122
 
 
123
    @property
117
124
    def dash(self):
118
125
        if not getattr(self, '__dash', None):
119
126
            self.__dash = Dash()
155
162
            self.__workspace = WorkspaceManager()
156
163
        return self.__workspace
157
164
 
 
165
    def _get_screen(self):
 
166
        screens = Screen.get_all_instances()
 
167
        self.assertThat(len(screens), Equals(1))
 
168
        return screens[0]
 
169
 
158
170
    def _get_launcher_controller(self):
159
171
        controllers = LauncherController.get_all_instances()
160
172
        self.assertThat(len(controllers), Equals(1))