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 test |
| 7 from autotest_lib.client.common_lib import error, site_ui |
| 8 |
| 9 class desktopui_BrowserTest(test.test): |
| 10 version = 1 |
| 11 |
| 12 def setup(self): |
| 13 self.job.setup_dep(['chrome_test']) |
| 14 # create a empty srcdir to prevent the error that checks .version file |
| 15 if not os.path.exists(self.srcdir): |
| 16 os.mkdir(self.srcdir) |
| 17 |
| 18 |
| 19 def run_once(self): |
| 20 dep = 'chrome_test' |
| 21 dep_dir = os.path.join(self.autodir, 'deps', dep) |
| 22 self.job.install_pkg(dep, 'dep', dep_dir) |
| 23 |
| 24 chrome_dir = '/opt/google/chrome' |
| 25 test_binary_dir = '%s/test_src/out/Release' % dep_dir |
| 26 |
| 27 try: |
| 28 setup_cmd = '%s/%s' % (test_binary_dir, |
| 29 'setup_test_links.sh') |
| 30 utils.system(setup_cmd) |
| 31 |
| 32 cmd = '%s/%s' % (test_binary_dir, 'browser_tests') |
| 33 cmd = site_ui.xcommand(cmd) |
| 34 logging.info("Running %s" % cmd) |
| 35 utils.system(cmd) |
| 36 except error.CmdError, e: |
| 37 logging.debug(e) |
| 38 raise error.TestFail('browser_test failed.') |
OLD | NEW |