| OLD | NEW |
| 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import logging, os, re, shutil, subprocess, tempfile, utils | 5 import logging, os, re, shutil, subprocess, tempfile, utils |
| 6 from autotest_lib.client.cros import constants, login | 6 import common |
| 7 import constants, login, ui |
| 7 from autotest_lib.client.bin import test | 8 from autotest_lib.client.bin import test |
| 8 from autotest_lib.client.common_lib import error, global_config | 9 from autotest_lib.client.common_lib import error, global_config |
| 9 from autotest_lib.client.cros import ui | |
| 10 | 10 |
| 11 class ChromeTestBase(test.test): | 11 class ChromeTestBase(test.test): |
| 12 home_dir = None | 12 home_dir = None |
| 13 | 13 |
| 14 def setup(self): | 14 def setup(self): |
| 15 self.job.setup_dep(['chrome_test']) | 15 self.job.setup_dep(['chrome_test']) |
| 16 # create a empty srcdir to prevent the error that checks .version file | 16 # create a empty srcdir to prevent the error that checks .version file |
| 17 if not os.path.exists(self.srcdir): | 17 if not os.path.exists(self.srcdir): |
| 18 os.mkdir(self.srcdir) | 18 os.mkdir(self.srcdir) |
| 19 | 19 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 | 92 |
| 93 def cleanup(self): | 93 def cleanup(self): |
| 94 # Allow chrome to be restarted again. | 94 # Allow chrome to be restarted again. |
| 95 os.unlink(constants.DISABLE_BROWSER_RESTART_MAGIC_FILE) | 95 os.unlink(constants.DISABLE_BROWSER_RESTART_MAGIC_FILE) |
| 96 # Reset the UI. | 96 # Reset the UI. |
| 97 login.nuke_login_manager() | 97 login.nuke_login_manager() |
| 98 login.refresh_login_screen() | 98 login.refresh_login_screen() |
| 99 if self.home_dir: | 99 if self.home_dir: |
| 100 shutil.rmtree(self.home_dir, ignore_errors=True) | 100 shutil.rmtree(self.home_dir, ignore_errors=True) |
| 101 test.test.cleanup(self) | 101 test.test.cleanup(self) |
| OLD | NEW |