Beispiel #1
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 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 ensure_dash_not_running(self):
     if process_helpers.is_job_running('unity8-dash'):
         process_helpers.stop_job('unity8-dash')
Beispiel #4
0
 def ensure_dash_not_running(self):
     if process_helpers.is_job_running('unity8-dash'):
         process_helpers.stop_job('unity8-dash')
 def stop_service(self):
     logger.info("Stopping unity-mock-indicator-service")
     process_helpers.stop_job('unity-mock-indicator-service')
 def stop_application(self):
     process_helpers.stop_job('unity8-dash')
 def stop_unity(self):
     process_helpers.stop_job('unity8')