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

Unified Diff: client/site_tests/login_CryptohomeMounted/login_CryptohomeMounted.py

Issue 1565001: test: Clean up site_login.py a bit. (Closed)
Patch Set: update one more call to attempt_logout() Created 10 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
Index: client/site_tests/login_CryptohomeMounted/login_CryptohomeMounted.py
diff --git a/client/site_tests/login_CryptohomeMounted/login_CryptohomeMounted.py b/client/site_tests/login_CryptohomeMounted/login_CryptohomeMounted.py
index 30d6dc01ec244252cb0bd2ddabc9f4fe5e2c87f0..8fecd5f0eb3b1a72463f8ed18d811d691f16e8ee 100644
--- a/client/site_tests/login_CryptohomeMounted/login_CryptohomeMounted.py
+++ b/client/site_tests/login_CryptohomeMounted/login_CryptohomeMounted.py
@@ -14,19 +14,18 @@ class login_CryptohomeMounted(test.test):
site_login.setup_autox(self)
def run_once(self, script='autox_script.json', is_control=False):
- logged_in = site_login.logged_in()
+ # Make sure that we're logged out initially -- this test is run
+ # multiple times, and we don't want to reuse the previous instance's
+ # session.
+ if site_login.logged_in():
+ site_login.attempt_logout()
- if not logged_in:
- # Test account information embedded into json file.
- if not site_login.attempt_login(self, script):
- raise error.TestFail('Could not login')
+ # Test account information embedded into json file.
+ site_login.attempt_login(self, script)
if (not is_control and
not site_cryptohome.is_mounted(allow_fail=is_control)):
raise error.TestFail('CryptohomeIsMounted should return %s' %
(not is_control))
- # If we started logged out, log back out.
- if not logged_in:
- if not site_login.attempt_logout():
- raise error.TestError('Could not log out')
+ site_login.attempt_logout()

Powered by Google App Engine
This is Rietveld 408576698