def _get_fake_scopes_library_path(self):
        if unity8.running_installed_tests():
            mock_path = 'qml/scopefakes/'
        else:
            mock_path = os.path.join('../lib/',
                                     sysconfig.get_config_var('MULTIARCH'),
                                     'unity8/qml/scopefakes/')
        lib_path = unity8.get_lib_path()
        ld_library_path = os.path.abspath(os.path.join(lib_path, mock_path))

        if not os.path.exists(ld_library_path):
            raise RuntimeError('Expected library path does not exists: %s.' %
                               (ld_library_path))
        return ld_library_path
示例#2
0
    def launch_unity(self, mode="full-greeter", *args):
        """
            Launch the unity shell, return a proxy object for it.

        :param str mode: The type of greeter/shell mode to use
        :param args: A list of aguments to pass to unity8

        """
        binary_path = get_binary_path()
        lib_path = get_lib_path()

        logger.info(
            "Lib path is '%s', binary path is '%s'",
            lib_path,
            binary_path
        )

        self.patch_lightdm_mock()

        if self._qml_mock_enabled:
            self._environment['QML2_IMPORT_PATH'] = (
                get_qml_import_path_with_mock()
            )

        if self._data_dirs_mock_enabled:
            self._patch_data_dirs()

        unity8_cli_args_list = ["--mode={}".format(mode)]
        if len(args) != 0:
            unity8_cli_args_list += args

        app_proxy = self._launch_unity_with_upstart(
            binary_path,
            self.unity_geometry_args + unity8_cli_args_list
        )

        self._set_proxy(app_proxy)

        # Ensure that the dash is visible before we return:
        logger.debug("Unity started, waiting for it to be ready.")
        self.wait_for_unity()
        logger.debug("Unity loaded and ready.")

        if model() == 'Desktop':
            # On desktop, close the dash because it's opened in a separate
            # window and it gets in the way.
            process_helpers.stop_job('unity8-dash')

        return app_proxy
    def _get_fake_scopes_library_path(self):
        if unity8.running_installed_tests():
            mock_path = 'qml/scopefakes/'
        else:
            mock_path = os.path.join(
                '../lib/', sysconfig.get_config_var('MULTIARCH'),
                'unity8/qml/scopefakes/')
        lib_path = unity8.get_lib_path()
        ld_library_path = os.path.abspath(os.path.join(lib_path, mock_path))

        if not os.path.exists(ld_library_path):
            raise RuntimeError(
                'Expected library path does not exists: %s.' % (
                    ld_library_path))
        return ld_library_path
示例#4
0
    def launch_unity(self, mode="full-greeter", *args):
        """
            Launch the unity shell, return a proxy object for it.

        :param str mode: The type of greeter/shell mode to use
        :param args: A list of aguments to pass to unity8

        """
        binary_path = get_binary_path()
        lib_path = get_lib_path()

        logger.info("Lib path is '%s', binary path is '%s'", lib_path,
                    binary_path)

        self.patch_lightdm_mock()

        if self._qml_mock_enabled:
            self._environment['QML2_IMPORT_PATH'] = (
                get_qml_import_path_with_mock())

        if self._data_dirs_mock_enabled:
            self._patch_data_dirs()

        unity8_cli_args_list = ["--mode={}".format(mode)]
        if len(args) != 0:
            unity8_cli_args_list += args

        app_proxy = self._launch_unity_with_upstart(
            binary_path, self.unity_geometry_args + unity8_cli_args_list)

        self._set_proxy(app_proxy)

        # Ensure that the dash is visible before we return:
        logger.debug("Unity started, waiting for it to be ready.")
        self.wait_for_unity()
        logger.debug("Unity loaded and ready.")

        if model() == 'Desktop':
            # On desktop, close the dash because it's opened in a separate
            # window and it gets in the way.
            process_helpers.stop_job('unity8-dash')

        return app_proxy