Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(237)

Unified Diff: client/cros/chrome_test.py

Issue 6677172: Add option to not nuke Chrome to chrome_test.py (Closed) Base URL: http://git.chromium.org/git/autotest.git@master
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/cros/chrome_test.py
diff --git a/client/cros/chrome_test.py b/client/cros/chrome_test.py
index 6c9f13a4bddae90d904fb5381eb8c60964d31970..693e4f299b6ee27e47a881e7a1a1458c8dcb45b0 100644
--- a/client/cros/chrome_test.py
+++ b/client/cros/chrome_test.py
@@ -10,6 +10,7 @@ from autotest_lib.client.common_lib import error, global_config
class ChromeTestBase(test.test):
home_dir = None
+ chrome_restart_disabled = False
def setup(self):
self.job.setup_dep(['chrome_test'])
@@ -17,8 +18,17 @@ class ChromeTestBase(test.test):
if not os.path.exists(self.srcdir):
os.mkdir(self.srcdir)
+ def nuke_chrome(self):
+ try:
+ open(constants.DISABLE_BROWSER_RESTART_MAGIC_FILE, 'w').close()
+ self.chrome_restart_disabled = True
+ except IOError, e:
+ logging.debug(e)
+ raise error.TestError('Failed to disable browser restarting.')
+ login.nuke_process_by_name(name=constants.BROWSER, with_prejudice=True)
+
- def initialize(self):
+ def initialize(self, nuke_browser_norestart = True):
Nirnimesh 2011/04/05 22:45:50 remove space around =
self.home_dir = tempfile.mkdtemp()
os.chmod(self.home_dir, stat.S_IROTH | stat.S_IWOTH |stat.S_IXOTH)
dep = 'chrome_test'
@@ -26,12 +36,8 @@ class ChromeTestBase(test.test):
self.job.install_pkg(dep, 'dep', dep_dir)
self.cr_source_dir = '%s/test_src' % dep_dir
self.test_binary_dir = '%s/out/Release' % self.cr_source_dir
- try:
- open(constants.DISABLE_BROWSER_RESTART_MAGIC_FILE, 'w').close()
- except IOError, e:
- logging.debug(e)
- raise error.TestError('Failed to disable browser restarting.')
- login.nuke_process_by_name(name=constants.BROWSER, with_prejudice=True)
+ if (nuke_browser_norestart):
+ self.nuke_chrome()
try:
setup_cmd = '/bin/sh %s/%s' % (self.test_binary_dir,
'setup_test_links.sh')
@@ -93,8 +99,9 @@ class ChromeTestBase(test.test):
def cleanup(self):
- # Allow chrome to be restarted again.
- os.unlink(constants.DISABLE_BROWSER_RESTART_MAGIC_FILE)
+ if self.chrome_restart_disabled:
+ # Allow chrome to be restarted again.
+ os.unlink(constants.DISABLE_BROWSER_RESTART_MAGIC_FILE)
# Reset the UI.
login.nuke_login_manager()
login.refresh_login_screen()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698