=== modified file 'autopilot/application/__init__.py'
--- autopilot/application/__init__.py	2014-01-24 04:18:10 +0000
+++ autopilot/application/__init__.py	2017-03-03 23:28:24 +0000
@@ -20,15 +20,11 @@
 """Base package for application launching and environment management."""
 
 from autopilot.application._launcher import (
-    ClickApplicationLauncher,
     get_application_launcher_wrapper,
     NormalApplicationLauncher,
-    UpstartApplicationLauncher,
 )
 
 __all__ = [
-    'ClickApplicationLauncher',
     'get_application_launcher_wrapper',
     'NormalApplicationLauncher',
-    'UpstartApplicationLauncher',
 ]

=== modified file 'autopilot/application/_launcher.py'
--- autopilot/application/_launcher.py	2014-08-06 05:39:37 +0000
+++ autopilot/application/_launcher.py	2017-03-03 23:28:24 +0000
@@ -20,7 +20,7 @@
 """Base module for application launchers."""
 
 import fixtures
-from gi.repository import GLib, UbuntuAppLaunch
+from gi.repository import GLib
 import json
 import logging
 import os
@@ -55,143 +55,6 @@
         raise NotImplementedError("Sub-classes must implement this method.")
 
 
-class UpstartApplicationLauncher(ApplicationLauncher):
-
-    """A launcher class that launched applicaitons with UpstartAppLaunch."""
-
-    Timeout = object()
-    Failed = object()
-    Started = object()
-    Stopped = object()
-
-    def __init__(self, case_addDetail, **kwargs):
-        super(UpstartApplicationLauncher, self).__init__(case_addDetail)
-
-        self.emulator_base = kwargs.pop('emulator_base', None)
-        self.dbus_bus = kwargs.pop('dbus_bus', 'session')
-        self.dbus_application_name = kwargs.pop('application_name', None)
-
-        _raise_on_unknown_kwargs(kwargs)
-
-    def launch(self, app_id, app_uris=[]):
-        state = {}
-        state['loop'] = self._get_glib_loop()
-        state['expected_app_id'] = app_id
-        state['message'] = ''
-
-        UbuntuAppLaunch.observer_add_app_failed(self._on_failed, state)
-        UbuntuAppLaunch.observer_add_app_started(self._on_started, state)
-        UbuntuAppLaunch.observer_add_app_focus(self._on_started, state)
-        GLib.timeout_add_seconds(10.0, self._on_timeout, state)
-
-        self._launch_app(app_id, app_uris)
-        state['loop'].run()
-        UbuntuAppLaunch.observer_delete_app_failed(self._on_failed)
-        UbuntuAppLaunch.observer_delete_app_started(self._on_started)
-        UbuntuAppLaunch.observer_delete_app_focus(self._on_started)
-        self._maybe_add_application_cleanups(state)
-        self._check_status_error(
-            state.get('status', None),
-            state.get('message', '')
-        )
-        return self._get_pid_for_launched_app(app_id)
-
-    @staticmethod
-    def _on_failed(launched_app_id, failure_type, state):
-        if launched_app_id == state['expected_app_id']:
-            if failure_type == UbuntuAppLaunch.AppFailed.CRASH:
-                state['message'] = 'Application crashed.'
-            elif failure_type == UbuntuAppLaunch.AppFailed.START_FAILURE:
-                state['message'] = 'Application failed to start.'
-            state['status'] = UpstartApplicationLauncher.Failed
-            state['loop'].quit()
-
-    @staticmethod
-    def _on_started(launched_app_id, state):
-        if launched_app_id == state['expected_app_id']:
-            state['status'] = UpstartApplicationLauncher.Started
-            state['loop'].quit()
-
-    @staticmethod
-    def _on_stopped(stopped_app_id, state):
-        if stopped_app_id == state['expected_app_id']:
-            state['status'] = UpstartApplicationLauncher.Stopped
-            state['loop'].quit()
-
-    @staticmethod
-    def _on_timeout(state):
-        state['status'] = UpstartApplicationLauncher.Timeout
-        state['loop'].quit()
-
-    def _maybe_add_application_cleanups(self, state):
-        if state.get('status', None) == UpstartApplicationLauncher.Started:
-            app_id = state['expected_app_id']
-            self.addCleanup(self._stop_application, app_id)
-            self.addCleanup(self._attach_application_log, app_id)
-
-    def _attach_application_log(self, app_id):
-        log_path = UbuntuAppLaunch.application_log_path(app_id)
-        if log_path:
-            self.case_addDetail(
-                "Application Log",
-                content_from_file(log_path)
-            )
-
-    def _stop_application(self, app_id):
-        state = {}
-        state['loop'] = self._get_glib_loop()
-        state['expected_app_id'] = app_id
-
-        UbuntuAppLaunch.observer_add_app_stop(self._on_stopped, state)
-        GLib.timeout_add_seconds(10.0, self._on_timeout, state)
-
-        UbuntuAppLaunch.stop_application(app_id)
-        state['loop'].run()
-        UbuntuAppLaunch.observer_delete_app_stop(self._on_stopped)
-
-        if state.get('status', None) == UpstartApplicationLauncher.Timeout:
-            _logger.error(
-                "Timed out waiting for Application with app_id '%s' to stop.",
-                app_id
-            )
-
-    @staticmethod
-    def _get_glib_loop():
-        return GLib.MainLoop()
-
-    @staticmethod
-    def _get_pid_for_launched_app(app_id):
-        return UbuntuAppLaunch.get_primary_pid(app_id)
-
-    @staticmethod
-    def _launch_app(app_name, app_uris):
-        UbuntuAppLaunch.start_application_test(app_name, app_uris)
-
-    @staticmethod
-    def _check_status_error(status, extra_message=''):
-        message_parts = []
-        if status == UpstartApplicationLauncher.Timeout:
-            message_parts.append(
-                "Timed out while waiting for application to launch"
-            )
-        elif status == UpstartApplicationLauncher.Failed:
-            message_parts.append("Application Launch Failed")
-        if message_parts and extra_message:
-            message_parts.append(extra_message)
-        if message_parts:
-            raise RuntimeError(': '.join(message_parts))
-
-
-class ClickApplicationLauncher(UpstartApplicationLauncher):
-
-    def launch(self, package_id, app_name, app_uris):
-        app_id = _get_click_app_id(package_id, app_name)
-        return self._do_upstart_launch(app_id, app_uris)
-
-    def _do_upstart_launch(self, app_id, app_uris):
-        return super(ClickApplicationLauncher, self).launch(app_id, app_uris)
-
-
 class NormalApplicationLauncher(ApplicationLauncher):
     def __init__(self, case_addDetail, **kwargs):
         super(NormalApplicationLauncher, self).__init__(case_addDetail)
@@ -269,35 +132,6 @@
     return process
 
 
-def _get_click_app_id(package_id, app_name=None):
-    for pkg in _get_click_manifest():
-        if pkg['name'] == package_id:
-            if app_name is None:
-                # py3 dict.keys isn't indexable.
-                app_name = list(pkg['hooks'].keys())[0]
-            elif app_name not in pkg['hooks']:
-                raise RuntimeError(
-                    "Application '{}' is not present within the click "
-                    "package '{}'.".format(app_name, package_id))
-
-            return "{0}_{1}_{2}".format(package_id, app_name, pkg['version'])
-    raise RuntimeError(
-        "Unable to find package '{}' in the click manifest."
-        .format(package_id)
-    )
-
-
-def _get_click_manifest():
-    """Return the click package manifest as a python list."""
-    # get the whole click package manifest every time - it seems fast enough
-    # but this is a potential optimisation point for the future:
-    click_manifest_str = subprocess.check_output(
-        ["click", "list", "--manifest"],
-        universal_newlines=True
-    )
-    return json.loads(click_manifest_str)
-
-
 def _get_application_environment(app_type=None, app_path=None):
     if app_type is None and app_path is None:
         raise ValueError("Must specify either app_type or app_path.")

=== modified file 'autopilot/testcase.py'
--- autopilot/testcase.py	2014-08-06 05:39:37 +0000
+++ autopilot/testcase.py	2017-03-03 23:28:24 +0000
@@ -57,10 +57,8 @@
 from testtools.matchers import Equals
 
 from autopilot.application import (
-    ClickApplicationLauncher,
     get_application_launcher_wrapper,
     NormalApplicationLauncher,
-    UpstartApplicationLauncher,
 )
 from autopilot.display import Display
 from autopilot.globals import get_debug_profile_fixture
@@ -263,86 +261,6 @@
 
         return self._launch_test_application(launcher, application, *arguments)
 
-    def launch_click_package(self, package_id, app_name=None, app_uris=[],
-                             **kwargs):
-        """Launch a click package application with introspection enabled.
-
-        This method takes care of launching a click package with introspection
-        exabled. You probably want to use this method if your application is
-        packaged in a click application, or is started via upstart.
-
-        Usage is similar to the
-        :py:meth:`AutopilotTestCase.launch_test_application`::
-
-            app_proxy = self.launch_click_package(
-                "com.ubuntu.dropping-letters"
-            )
-
-        :param package_id: The Click package name you want to launch. For
-            example: ``com.ubuntu.dropping-letters``
-        :param app_name: Currently, only one application can be packaged in a
-            click package, and this parameter can be left at None. If
-            specified, it should be the application name you wish to launch.
-        :param app_uris: Parameters used to launch the click package. This
-            parameter will be left empty if not used.
-
-        :keyword emulator_base: If set, specifies the base class to be used for
-            all emulators for this loaded application.
-
-        :raises RuntimeError: If the specified package_id cannot be found in
-            the click package manifest.
-        :raises RuntimeError: If the specified app_name cannot be found within
-            the specified click package.
-
-        :returns: proxy object for the launched package application
-
-        """
-        if isinstance(app_uris, (six.text_type, six.binary_type)):
-            app_uris = [app_uris]
-        _logger.info(
-            "Attempting to launch click application '%s' from click package "
-            " '%s' and URIs '%s'",
-            app_name if app_name is not None else "(default)",
-            package_id,
-            ','.join(app_uris)
-        )
-        launcher = self.useFixture(
-            ClickApplicationLauncher(self.addDetail, **kwargs)
-        )
-        return self._launch_test_application(launcher, package_id, app_name,
-                                             app_uris)
-
-    def launch_upstart_application(self, application_name, uris=[], **kwargs):
-        """Launch an application with upstart.
-
-        This method launched an application via the ``ubuntu-app-launch``
-        library, on platforms that support it.
-
-        Usage is similar to the
-        :py:meth:`AutopilotTestCase.launch_test_application`::
-
-            app_proxy = self.launch_upstart_application("gallery-app")
-
-        :param application_name: The name of the application to launch.
-        :keyword emulator_base: If set, specifies the base class to be used for
-            all emulators for this loaded application.
-
-        :raises RuntimeError: If the specified application cannot be launched.
-        :raises ValueError: If unknown keyword arguments are specified.
-        """
-        if isinstance(uris, (six.text_type, six.binary_type)):
-            uris = [uris]
-        _logger.info(
-            "Attempting to launch application '%s' with URIs '%s' via "
-            "upstart-app-launch",
-            application_name,
-            ','.join(uris)
-        )
-        launcher = self.useFixture(
-            UpstartApplicationLauncher(self.addDetail, **kwargs)
-        )
-        return self._launch_test_application(launcher, application_name, uris)
-
     # Wrapper function tying the newer ApplicationLauncher behaviour with the
     # previous (to be depreciated) behaviour
     def _launch_test_application(self, launcher_instance, application, *args):

=== modified file 'autopilot/tests/unit/test_application_launcher.py'
--- autopilot/tests/unit/test_application_launcher.py	2014-08-06 05:39:37 +0000
+++ autopilot/tests/unit/test_application_launcher.py	2017-03-03 23:28:24 +0000
@@ -42,9 +42,7 @@
 from mock import Mock, patch
 
 from autopilot.application import (
-    ClickApplicationLauncher,
     NormalApplicationLauncher,
-    UpstartApplicationLauncher,
 )
 from autopilot.application._environment import (
     GtkApplicationEnvironment,
@@ -59,8 +57,6 @@
     _get_app_env_from_string_hint,
     _get_application_environment,
     _get_application_path,
-    _get_click_app_id,
-    _get_click_manifest,
     _is_process_running,
     _kill_process,
 )
@@ -171,500 +167,6 @@
             )
 
 
-class ClickApplicationLauncherTests(TestCase):
-
-    def test_raises_exception_on_unknown_kwargs(self):
-        self.assertThat(
-            lambda: ClickApplicationLauncher(self.addDetail, unknown=True),
-            raises(ValueError("Unknown keyword arguments: 'unknown'."))
-        )
-
-    def test_application_name_kwarg_stored(self):
-        app_name = self.getUniqueString()
-        launcher = ClickApplicationLauncher(
-            self.addDetail,
-            application_name=app_name
-        )
-
-        self.assertThat(
-            launcher.dbus_application_name, Equals(app_name)
-        )
-
-    def test_click_launch_calls_upstart_launch(self):
-        launcher = ClickApplicationLauncher(self.addDetail)
-        token = self.getUniqueString()
-        with patch.object(launcher, '_do_upstart_launch') as p_dul:
-            with patch.object(_l, '_get_click_app_id') as p_gcai:
-                p_gcai.return_value = token
-                launcher.launch('some_app_id', 'some_app_name', [])
-                p_dul.assert_called_once_with(token, [])
-
-    def test_upcalls_to_upstart(self):
-        class FakeUpstartBase(_l.ApplicationLauncher):
-            launch_call_args = []
-
-            def launch(self, *args):
-                FakeUpstartBase.launch_call_args = list(args)
-
-        patcher = patch.object(
-            _l.ClickApplicationLauncher,
-            '__bases__',
-            (FakeUpstartBase,)
-        )
-        with patcher:
-            # Prevent mock from trying to delete __bases__
-            patcher.is_local = True
-            launcher = ClickApplicationLauncher(self.addDetail)
-            launcher._do_upstart_launch('app_id', [])
-        self.assertEqual(
-            FakeUpstartBase.launch_call_args,
-            ['app_id', []])
-
-
-class ClickFunctionTests(TestCase):
-
-    def test_get_click_app_id_raises_runtimeerror_on_empty_manifest(self):
-        """_get_click_app_id must raise a RuntimeError if the requested
-        package id is not found in the click manifest.
-
-        """
-        with patch.object(_l, '_get_click_manifest', return_value=[]):
-            self.assertThat(
-                lambda: _get_click_app_id("com.autopilot.testing"),
-                raises(
-                    RuntimeError(
-                        "Unable to find package 'com.autopilot.testing' in "
-                        "the click manifest."
-                    )
-                )
-            )
-
-    def test_get_click_app_id_raises_runtimeerror_on_missing_package(self):
-        with patch.object(_l, '_get_click_manifest') as cm:
-            cm.return_value = [
-                {
-                    'name': 'com.not.expected.name',
-                    'hooks': {'bar': {}}, 'version': '1.0'
-                }
-            ]
-
-            self.assertThat(
-                lambda: _get_click_app_id("com.autopilot.testing"),
-                raises(
-                    RuntimeError(
-                        "Unable to find package 'com.autopilot.testing' in "
-                        "the click manifest."
-                    )
-                )
-            )
-
-    def test_get_click_app_id_raises_runtimeerror_on_wrong_app(self):
-        """get_click_app_id must raise a RuntimeError if the requested
-        application is not found within the click package.
-
-        """
-        with patch.object(_l, '_get_click_manifest') as cm:
-            cm.return_value = [{'name': 'com.autopilot.testing', 'hooks': {}}]
-
-            self.assertThat(
-                lambda: _get_click_app_id("com.autopilot.testing", "bar"),
-                raises(
-                    RuntimeError(
-                        "Application 'bar' is not present within the click "
-                        "package 'com.autopilot.testing'."
-                    )
-                )
-            )
-
-    def test_get_click_app_id_returns_id(self):
-        with patch.object(_l, '_get_click_manifest') as cm:
-            cm.return_value = [
-                {
-                    'name': 'com.autopilot.testing',
-                    'hooks': {'bar': {}}, 'version': '1.0'
-                }
-            ]
-
-            self.assertThat(
-                _get_click_app_id("com.autopilot.testing", "bar"),
-                Equals("com.autopilot.testing_bar_1.0")
-            )
-
-    def test_get_click_app_id_returns_id_without_appid_passed(self):
-        with patch.object(_l, '_get_click_manifest') as cm:
-            cm.return_value = [
-                {
-                    'name': 'com.autopilot.testing',
-                    'hooks': {'bar': {}}, 'version': '1.0'
-                }
-            ]
-
-            self.assertThat(
-                _get_click_app_id("com.autopilot.testing"),
-                Equals("com.autopilot.testing_bar_1.0")
-            )
-
-
-class UpstartApplicationLauncherTests(TestCase):
-
-    def test_can_construct_UpstartApplicationLauncher(self):
-        UpstartApplicationLauncher(self.addDetail)
-
-    def test_default_values_are_set(self):
-        launcher = UpstartApplicationLauncher(self.addDetail)
-        self.assertThat(launcher.emulator_base, Equals(None))
-        self.assertThat(launcher.dbus_bus, Equals('session'))
-
-    def test_can_set_emulator_base(self):
-        mock_emulator_base = Mock()
-        launcher = UpstartApplicationLauncher(
-            self.addDetail,
-            emulator_base=mock_emulator_base
-        )
-
-        self.assertThat(launcher.emulator_base, Equals(mock_emulator_base))
-
-    def test_can_set_dbus_bus(self):
-        launcher = UpstartApplicationLauncher(
-            self.addDetail,
-            dbus_bus='system'
-        )
-
-        self.assertThat(launcher.dbus_bus, Equals('system'))
-
-    def test_raises_exception_on_unknown_kwargs(self):
-        self.assertThat(
-            lambda: UpstartApplicationLauncher(self.addDetail, unknown=True),
-            raises(ValueError("Unknown keyword arguments: 'unknown'."))
-        )
-
-    def test_on_failed_only_sets_status_on_correct_app_id(self):
-        state = {
-            'expected_app_id': 'gedit',
-        }
-
-        UpstartApplicationLauncher._on_failed('some_game', None, state)
-
-        self.assertThat(state, Not(Contains('status')))
-
-    def assertFunctionSetsCorrectStateAndQuits(self, observer, expected_state):
-        """Assert that the observer observer sets the correct state id.
-
-        :param observer: The observer callable you want to test.
-        :param expected_state: The state id the observer callable must set.
-
-        """
-        expected_app_id = self.getUniqueString()
-        state = {
-            'expected_app_id': expected_app_id,
-            'loop': Mock()
-        }
-
-        if observer == UpstartApplicationLauncher._on_failed:
-            observer(expected_app_id, None, state)
-        elif observer == UpstartApplicationLauncher._on_started or \
-                observer == UpstartApplicationLauncher._on_stopped:
-            observer(expected_app_id, state)
-        else:
-            observer(state)
-
-        self.assertThat(
-            state['status'],
-            Equals(expected_state)
-        )
-        state['loop'].quit.assert_called_once_with()
-
-    def test_on_failed_sets_status_with_correct_app_id(self):
-        self.assertFunctionSetsCorrectStateAndQuits(
-            UpstartApplicationLauncher._on_failed,
-            UpstartApplicationLauncher.Failed
-        )
-
-    def test_on_started_sets_status_with_correct_app_id(self):
-        self.assertFunctionSetsCorrectStateAndQuits(
-            UpstartApplicationLauncher._on_started,
-            UpstartApplicationLauncher.Started
-        )
-
-    def test_on_timeout_sets_status_and_exits_loop(self):
-        self.assertFunctionSetsCorrectStateAndQuits(
-            UpstartApplicationLauncher._on_timeout,
-            UpstartApplicationLauncher.Timeout
-        )
-
-    def test_on_started_only_sets_status_on_correct_app_id(self):
-        state = {
-            'expected_app_id': 'gedit',
-        }
-
-        UpstartApplicationLauncher._on_started('some_game', state)
-
-        self.assertThat(state, Not(Contains('status')))
-
-    def test_on_stopped_only_sets_status_on_correct_app_id(self):
-        state = {
-            'expected_app_id': 'gedit',
-        }
-
-        UpstartApplicationLauncher._on_stopped('some_game', state)
-        self.assertThat(state, Not(Contains('status')))
-
-    def test_on_stopped_sets_status_and_exits_loop(self):
-        self.assertFunctionSetsCorrectStateAndQuits(
-            UpstartApplicationLauncher._on_stopped,
-            UpstartApplicationLauncher.Stopped
-        )
-
-    def test_get_pid_calls_upstart_module(self):
-        expected_return = self.getUniqueInteger()
-        with patch.object(_l, 'UbuntuAppLaunch') as mock_ual:
-            mock_ual.get_primary_pid.return_value = expected_return
-            observed = UpstartApplicationLauncher._get_pid_for_launched_app(
-                'gedit'
-            )
-
-            mock_ual.get_primary_pid.assert_called_once_with('gedit')
-            self.assertThat(expected_return, Equals(observed))
-
-    def test_launch_app_calls_upstart_module(self):
-        with patch.object(_l, 'UbuntuAppLaunch') as mock_ual:
-            UpstartApplicationLauncher._launch_app(
-                'gedit',
-                ['some', 'uris']
-            )
-
-            mock_ual.start_application_test.assert_called_once_with(
-                'gedit',
-                ['some', 'uris']
-            )
-
-    def test_check_error_raises_RuntimeError_on_timeout(self):
-        fn = lambda: UpstartApplicationLauncher._check_status_error(
-            UpstartApplicationLauncher.Timeout
-        )
-        self.assertThat(
-            fn,
-            raises(
-                RuntimeError(
-                    "Timed out while waiting for application to launch"
-                )
-            )
-        )
-
-    def test_check_error_raises_RuntimeError_on_failure(self):
-        fn = lambda: UpstartApplicationLauncher._check_status_error(
-            UpstartApplicationLauncher.Failed
-        )
-        self.assertThat(
-            fn,
-            raises(
-                RuntimeError(
-                    "Application Launch Failed"
-                )
-            )
-        )
-
-    def test_check_error_raises_RuntimeError_with_extra_message(self):
-        fn = lambda: UpstartApplicationLauncher._check_status_error(
-            UpstartApplicationLauncher.Failed,
-            "extra message"
-        )
-        self.assertThat(
-            fn,
-            raises(
-                RuntimeError(
-                    "Application Launch Failed: extra message"
-                )
-            )
-        )
-
-    def test_check_error_does_nothing_on_None(self):
-        UpstartApplicationLauncher._check_status_error(None)
-
-    def test_get_loop_returns_glib_mainloop_instance(self):
-        loop = UpstartApplicationLauncher._get_glib_loop()
-        self.assertThat(loop, IsInstance(GLib.MainLoop))
-
-    def test_launch(self):
-        launcher = UpstartApplicationLauncher(self.addDetail)
-        with patch.object(launcher, '_launch_app') as patched_launch:
-            with patch.object(launcher, '_get_glib_loop'):
-                launcher.launch('gedit')
-
-                patched_launch.assert_called_once_with('gedit', [])
-
-    def assertFailedObserverSetsExtraMessage(self, fail_type, expected_msg):
-        """Assert that the on_failed observer must set the expected message
-        for a particular failure_type."""
-        expected_app_id = self.getUniqueString()
-        state = {
-            'expected_app_id': expected_app_id,
-            'loop': Mock()
-        }
-        UpstartApplicationLauncher._on_failed(
-            expected_app_id,
-            fail_type,
-            state
-        )
-        self.assertEqual(expected_msg, state['message'])
-
-    def test_on_failed_sets_message_for_app_crash(self):
-        self.assertFailedObserverSetsExtraMessage(
-            _l.UbuntuAppLaunch.AppFailed.CRASH,
-            'Application crashed.'
-        )
-
-    def test_on_failed_sets_message_for_app_start_failure(self):
-        self.assertFailedObserverSetsExtraMessage(
-            _l.UbuntuAppLaunch.AppFailed.START_FAILURE,
-            'Application failed to start.'
-        )
-
-    def test_add_application_cleanups_adds_both_cleanup_actions(self):
-        token = self.getUniqueString()
-        state = {
-            'status': UpstartApplicationLauncher.Started,
-            'expected_app_id': token,
-        }
-        launcher = UpstartApplicationLauncher(Mock())
-        launcher.setUp()
-        launcher._maybe_add_application_cleanups(state)
-        self.assertThat(
-            launcher._cleanups._cleanups,
-            Contains(
-                (launcher._attach_application_log, (token,), {})
-            )
-        )
-        self.assertThat(
-            launcher._cleanups._cleanups,
-            Contains(
-                (launcher._stop_application, (token,), {})
-            )
-        )
-
-    def test_add_application_cleanups_does_nothing_when_app_timedout(self):
-        state = {
-            'status': UpstartApplicationLauncher.Timeout,
-        }
-        launcher = UpstartApplicationLauncher(Mock())
-        launcher.setUp()
-        launcher._maybe_add_application_cleanups(state)
-        self.assertThat(launcher._cleanups._cleanups, HasLength(0))
-
-    def test_add_application_cleanups_does_nothing_when_app_failed(self):
-        state = {
-            'status': UpstartApplicationLauncher.Failed,
-        }
-        launcher = UpstartApplicationLauncher(Mock())
-        launcher.setUp()
-        launcher._maybe_add_application_cleanups(state)
-        self.assertThat(launcher._cleanups._cleanups, HasLength(0))
-
-    def test_attach_application_log_does_nothing_wth_no_log_specified(self):
-        app_id = self.getUniqueString()
-        case_addDetail = Mock()
-        launcher = UpstartApplicationLauncher(case_addDetail)
-        with patch.object(_l.UbuntuAppLaunch, 'application_log_path') as p:
-            p.return_value = None
-            launcher._attach_application_log(app_id)
-
-            p.assert_called_once_with(app_id)
-            self.assertEqual(0, case_addDetail.call_count)
-
-    def test_attach_application_log_attaches_log_file(self):
-        token = self.getUniqueString()
-        case_addDetail = Mock()
-        launcher = UpstartApplicationLauncher(case_addDetail)
-        app_id = self.getUniqueString()
-        with tempfile.NamedTemporaryFile(mode='w') as f:
-            f.write(token)
-            f.flush()
-            with patch.object(_l.UbuntuAppLaunch, 'application_log_path',
-                              return_value=f.name):
-                launcher._attach_application_log(app_id)
-
-                self.assertEqual(1, case_addDetail.call_count)
-                content_name, content_obj = case_addDetail.call_args[0]
-                self.assertEqual("Application Log", content_name)
-                self.assertThat(content_obj.as_text(), Contains(token))
-
-    def test_stop_adds_app_stopped_observer(self):
-        mock_add_detail = Mock()
-        mock_glib_loop = Mock()
-        patch_get_loop = patch.object(
-            UpstartApplicationLauncher,
-            '_get_glib_loop',
-            new=mock_glib_loop,
-        )
-        mock_UAL = Mock()
-        patch_UAL = patch.object(_l, 'UbuntuAppLaunch', new=mock_UAL)
-        launcher = UpstartApplicationLauncher(mock_add_detail)
-        app_id = self.getUniqueString()
-        with ExitStack() as patches:
-            patches.enter_context(patch_get_loop)
-            patches.enter_context(patch_UAL)
-
-            launcher._stop_application(app_id)
-            call_args = mock_UAL.observer_add_app_stop.call_args[0]
-            self.assertThat(
-                call_args[0],
-                Equals(UpstartApplicationLauncher._on_stopped)
-            )
-            self.assertThat(call_args[1]['expected_app_id'], Equals(app_id))
-
-    def test_stop_calls_libUAL_stop_function(self):
-        mock_add_detail = Mock()
-        mock_glib_loop = Mock()
-        patch_get_loop = patch.object(
-            UpstartApplicationLauncher,
-            '_get_glib_loop',
-            new=mock_glib_loop,
-        )
-        mock_UAL = Mock()
-        patch_UAL = patch.object(_l, 'UbuntuAppLaunch', new=mock_UAL)
-        launcher = UpstartApplicationLauncher(mock_add_detail)
-        app_id = self.getUniqueString()
-        with ExitStack() as patches:
-            patches.enter_context(patch_get_loop)
-            patches.enter_context(patch_UAL)
-
-            launcher._stop_application(app_id)
-            mock_UAL.stop_application.assert_called_once_with(app_id)
-
-    def test_stop_logs_error_on_timeout(self):
-        mock_add_detail = Mock()
-        mock_glib_loop = Mock()
-        patch_get_loop = patch.object(
-            UpstartApplicationLauncher,
-            '_get_glib_loop',
-            new=mock_glib_loop,
-        )
-        mock_UAL = Mock()
-
-        # we replace the add_observer function with one that can set the
-        # tiemout state, so we can ibject the timeout condition within the
-        # glib loop. This is ugly, but necessary.
-        def fake_add_observer(fn, state):
-            state['status'] = UpstartApplicationLauncher.Timeout
-        mock_UAL.observer_add_app_stop = fake_add_observer
-        patch_UAL = patch.object(_l, 'UbuntuAppLaunch', new=mock_UAL)
-        launcher = UpstartApplicationLauncher(mock_add_detail)
-        app_id = self.getUniqueString()
-        mock_logger = Mock()
-        patch_logger = patch.object(_l, '_logger', new=mock_logger)
-        with ExitStack() as patches:
-            patches.enter_context(patch_get_loop)
-            patches.enter_context(patch_UAL)
-            patches.enter_context(patch_logger)
-
-            launcher._stop_application(app_id)
-
-            mock_logger.error.assert_called_once_with(
-                "Timed out waiting for Application with app_id '%s' to stop.",
-                app_id
-            )
-
-
 class ApplicationLauncherInternalTests(TestCase):
 
     def test_get_app_env_from_string_hint_returns_qt_env(self):
@@ -873,24 +375,6 @@
                 get_application_launcher_wrapper(""), Equals(None)
             )
 
-    def test_get_click_manifest_returns_python_object(self):
-        example_manifest = """
-            [{
-                "description": "Calculator application",
-                "framework": "ubuntu-sdk-13.10",
-                "hooks": {
-                    "calculator": {
-                        "apparmor": "apparmor/calculator.json",
-                        "desktop": "ubuntu-calculator-app.desktop"
-                    }
-                },
-                "icon": "calculator64.png"
-            }]
-        """
-        with patch.object(_l.subprocess, 'check_output') as check_output:
-            check_output.return_value = example_manifest
-            self.assertThat(_get_click_manifest(), IsInstance(list))
-
     @patch.object(_l.psutil, 'pid_exists')
     def test_is_process_running_checks_with_pid(self, pid_exists):
         pid_exists.return_value = True

=== modified file 'debian/control'
--- debian/control	2014-08-06 06:05:02 +0000
+++ debian/control	2017-03-03 23:28:24 +0000
@@ -10,7 +10,6 @@
                gir1.2-gconf-2.0,
                gir1.2-gtk-3.0,
                gir1.2-ibus-1.0,
-               gir1.2-ubuntu-app-launch-2,
                graphviz,
                liblttng-ust-dev,
                python-all-dev (>= 2.6),
@@ -44,7 +43,6 @@
 Depends: ${misc:Depends},
          ${python:Depends},
          python-gi,
-         gir1.2-ubuntu-app-launch-2,
          python-contextlib2,
          python-dbus,
          python-decorator,

