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

Unified Diff: client/site_tests/desktopui_FailedLogin/desktopui_FailedLogin.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/desktopui_FailedLogin/desktopui_FailedLogin.py
diff --git a/client/site_tests/desktopui_FailedLogin/desktopui_FailedLogin.py b/client/site_tests/desktopui_FailedLogin/desktopui_FailedLogin.py
index 4581322b124f1fb7f57bdfa81ca423f83d8eda96..594c206ec449e3fcc9e28850e9f3b419638d200c 100644
--- a/client/site_tests/desktopui_FailedLogin/desktopui_FailedLogin.py
+++ b/client/site_tests/desktopui_FailedLogin/desktopui_FailedLogin.py
@@ -13,18 +13,17 @@ class desktopui_FailedLogin(test.test):
site_login.setup_autox(self)
def run_once(self, script):
- logged_in = site_login.logged_in()
-
# Can't test login while logged in, so logout.
- if logged_in:
- if not site_login.attempt_logout():
- raise error.TestFail('Could not terminate existing session')
- if not site_login.wait_for_browser():
- raise error.TestFail("Login manager didn't come back")
+ if site_login.logged_in():
+ site_login.attempt_logout()
# Test account information embedded into json file.
# TODO(cmasone): find better way to determine login has failed.
- if site_login.attempt_login(self, script):
+ try:
+ site_login.attempt_login(self, script)
+ except site_login.TimeoutError:
+ pass
+ else:
raise error.TestFail('Should not have logged in')
# Re-set to a good state

Powered by Google App Engine
This is Rietveld 408576698