1
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
3
# Copyright (C) 2014 Canonical Ltd.
5
# This file is part of ubuntu-system-settings-online-accounts.
7
# ubuntu-system-settings-online-accounts is free software: you can
8
# redistribute it and/or modify it under the terms of the GNU General Public
9
# License as published by the Free Software Foundation; version 3.
11
# ubuntu-system-settings-online-accounts is distributed in the hope that it
12
# will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
# GNU General Public License for more details.
16
# You should have received a copy of the GNU General Public License
17
# along with this program. If not, see <http://www.gnu.org/licenses/>.
23
import ubuntuuitoolkit
24
from autopilot import application
27
class LaunchBinaryOnlineAccountsUI(fixtures.Fixture):
31
self.application_proxy = self._launch_application()
33
def _launch_application(self):
34
# Increase the timeout of online-accounts-ui, to make sure it won't
35
# quit before the system settings panel asks it to open.
37
fixtures.EnvironmentVariable('OAU_DAEMON_TIMEOUT', '120'))
38
base_class = ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase
39
application_launcher = self.useFixture(
40
application.NormalApplicationLauncher(
41
emulator_base=base_class)
43
application_proxy = application_launcher.launch(
45
'--desktop_file_hint='
46
'/usr/share/applications/online-accounts-ui.desktop',
47
app_type='qt', capture_output=True)
48
system_settings = subprocess.Popen(
49
['system-settings', 'online-accounts',
50
'--desktop_file_hint='
51
'/usr/share/applications/ubuntu-system-settings.desktop'])
52
self.addCleanup(system_settings.terminate)
54
return application_proxy