OLD | NEW |
(Empty) | |
| 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. |
| 4 |
| 5 import logging, os, utils |
| 6 from autotest_lib.client.bin import site_login, test |
| 7 from autotest_lib.client.common_lib import site_ui |
| 8 |
| 9 class desktopui_IBusTest(test.test): |
| 10 version = 1 |
| 11 preserve_srcdir = True |
| 12 |
| 13 def setup(self): |
| 14 self.job.setup_dep(['autox']) |
| 15 self.job.setup_dep(['ibusclient']) |
| 16 |
| 17 |
| 18 def run_once(self): |
| 19 logged_in = site_login.logged_in() |
| 20 if not logged_in: |
| 21 if not site_login.attempt_login(self, 'autox_script.json'): |
| 22 raise error.TestFail('Could not login') |
| 23 try: |
| 24 dep = 'ibusclient' |
| 25 dep_dir = os.path.join(self.autodir, 'deps', dep) |
| 26 self.job.install_pkg(dep, 'dep', dep_dir) |
| 27 |
| 28 exefile = os.path.join(self.autodir, 'deps/ibusclient/ibusclient') |
| 29 cmd = site_ui.xcommand_as('DISPLAY=:0 %s' % exefile, 'chronos') |
| 30 utils.system_output(cmd, retain_output=True) |
| 31 finally: |
| 32 # If we started logged out, log back out. |
| 33 if not logged_in: |
| 34 site_login.attempt_logout() |
OLD | NEW |