@@ -95,7 +95,6 @@ class Unity8TestCase(AutopilotTestCase):
9595
9696 def launch_unity(self):
9797 """Launch the unity8 shell, return a proxy object for it."""
98− # first, work out which binary to launch:
9998 binary_path = get_unity8_binary_path()
10099 lib_path = get_lib_path()
101100
@@ -106,8 +105,6 @@ class Unity8TestCase(AutopilotTestCase):
106105
107106 # we now have a path to the unity8 binary, and lib_path points to the
108107 # directory where we need to patch some environment variables.
109−
110− # do the environment variable patching:
111108 self._patch_environment(lib_path)
112109
113110 # launch the shell:
@@ -121,9 +118,7 @@ class Unity8TestCase(AutopilotTestCase):
121118 self._set_proxy(app_proxy)
122119
123120 # Ensure that the dash is visible before we return:
124− logger.info("Waiting for the dash to load...")
125121 self.assertThat(self.get_dash().showScopeOnLoaded, Eventually(Equals("")))
126− logger.info("dash loaded!")
127122 return app_proxy
128123
129124 def _patch_environment(self, lib_path):
@@ -155,73 +150,3 @@ class Unity8TestCase(AutopilotTestCase):
155150 @property
156151 def main_window(self):
157152 return MainWindow(self._proxy)
158−
159−
160−class ShellTestCase(AutopilotTestCase):
161−
162− """A common test case class that provides several useful methods for shell tests."""
163−
164− libdir = "/usr/lib/{0}/unity8".format(sysconfig.get_config_var('MULTIARCH'))
165− lightdm_mock = "full"
166−
167− def setUp(self, geometry, grid_size):
168− super(ShellTestCase, self).setUp()
169− # Lets assume we are installed system wide if this file is somewhere in /usr
170− if grid_size != "0":
171− os.environ['GRID_UNIT_PX'] = grid_size
172− self.grid_size = int(grid_size)
173− else:
174− self.grid_size = int(os.environ['GRID_UNIT_PX'])
175− # launch the local binary if it exists, system binary otherwise
176− local_path = os.path.abspath(
177− os.path.join(
178− os.path.dirname(__file__),
179− "../../../../../builddir/unity8"
180− )
181− )
182− if os.path.exists(local_path):
183− self.launch_test_local(geometry)
184− else:
185− self.launch_test_installed(geometry)
186−
187− def launch_test_local(self, geometry):
188− # TODO: This assumed we're launching the tests from the autopilot test root
189− # dir, which may not always be the case.
190− os.environ['LD_LIBRARY_PATH'] = "../../builddir/tests/mocks/libusermetrics:../../builddir/tests/mocks/LightDM" + self.lightdm_mock
191− os.environ['QML2_IMPORT_PATH'] = "../../builddir/tests/mocks"
192− if geometry != "0x0":
193− self.app = self.launch_test_application(
194− "../../builddir/unity8", "-geometry", geometry, "-frameless", app_type='qt')
195− else:
196− self.app = self.launch_test_application(
197− "../../builddir/unity8", "-fullscreen", app_type='qt')
198−
199− def launch_test_installed(self, geometry):
200− os.environ['LD_LIBRARY_PATH'] = "{0}/qml/mocks/libusermetrics:{0}/qml/mocks/LightDM/{1}".format(self.libdir, self.lightdm_mock)
201− os.environ['QML2_IMPORT_PATH'] = "{0}/qml/mocks".format(self.libdir)
202− if model() == 'Desktop' and geometry != "0x0":
203− self.app = self.launch_test_application(
204− "unity8", "-geometry", geometry, "-frameless", app_type='qt')
205− else:
206− self.app = self.launch_test_application(
207− "unity8", "-fullscreen", app_type='qt')
208−
209− def skipWrapper(*args, **kwargs):
210− pass
211−
212− def form_factor(self):
213− return FormFactors.Desktop
214−
215− def __getattribute__(self, attr_name):
216− attr = object.__getattribute__(self, attr_name);
217− if attr_name.startswith("test_"):
218− try:
219− if self.form_factor() in attr.blacklist:
220− return self.skipWrapper
221− except:
222− pass
223− return attr
224−
225− @property
226− def main_window(self):
227− return MainWindow(self.app)