on xenial help sign in
Back out un-baked merge from earlier
6415302Christopher Lee
tests/autopilot/unity8/shell/tests/__init__.py+9−1
@@ -160,6 +160,7 @@ class UnityTestCase(AutopilotTestCase):
160
160
161 if self._lightdm_mock_type is None:
161 if self._lightdm_mock_type is None:
162 self.patch_lightdm_mock()
162 self.patch_lightdm_mock()
163+ self._setup_extra_mock_environment_patch()
163
164
164 app_proxy = self.launch_test_application(
165 app_proxy = self.launch_test_application(
165 binary_path,
166 binary_path,
@@ -180,7 +181,10 @@ class UnityTestCase(AutopilotTestCase):
180 def patch_lightdm_mock(self, mock_type='single'):
181 def patch_lightdm_mock(self, mock_type='single'):
181 self._lightdm_mock_type = mock_type
182 self._lightdm_mock_type = mock_type
182 logger.info("Setting up LightDM mock type '%s'", mock_type)
183 logger.info("Setting up LightDM mock type '%s'", mock_type)
184+ new_ld_library_path = "%s:%s" % (
185+ get_default_extra_mock_libraries(),
183− new_ld_library_path = self._get_lightdm_mock_path(mock_type)
186+ self._get_lightdm_mock_path(mock_type)
187+ )
184 logger.info("New library path: %s", new_ld_library_path)
188 logger.info("New library path: %s", new_ld_library_path)
185
189
186 self.patch_environment('LD_LIBRARY_PATH', new_ld_library_path)
190 self.patch_environment('LD_LIBRARY_PATH', new_ld_library_path)
@@ -198,6 +202,10 @@ class UnityTestCase(AutopilotTestCase):
198 )
202 )
199 return lightdm_mock_path
203 return lightdm_mock_path
200
204
205+ def _setup_extra_mock_environment_patch(self):
206+ mocks_library_path = get_mocks_library_path()
207+ self.patch_environment('QML2_IMPORT_PATH', mocks_library_path)
208+
201 def _set_proxy(self, proxy):
209 def _set_proxy(self, proxy):
202 """Keep a copy of the proxy object, so we can use it to get common
210 """Keep a copy of the proxy object, so we can use it to get common
203 parts of the shell later on.
211 parts of the shell later on.