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

Unified Diff: components/test/data/password_manager/websitetest.py

Issue 562013003: Never run the password manager python tests in the password internals page tab (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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: components/test/data/password_manager/websitetest.py
diff --git a/components/test/data/password_manager/websitetest.py b/components/test/data/password_manager/websitetest.py
index bee10ddba9da8d727b124f6861ac2de21a19c720..81a9cf57183a92e8a0946749e380c25bb05267d6 100644
--- a/components/test/data/password_manager/websitetest.py
+++ b/components/test/data/password_manager/websitetest.py
@@ -304,18 +304,20 @@ class WebsiteTest:
not like we expected or if the password is saved.
"""
logging.info("\nWrong Login Test for %s \n" % self.name)
- correct_password = self.password
- self.password = self.password + "1"
- self.LoginWhenNotAutofilled()
- self.password = correct_password
- self.Wait(2)
- self.environment.SwitchToInternals()
- self.environment.CheckForNewMessage(
- environment.MESSAGE_SAVE,
- False,
- "Error: password manager thinks that a login with wrong password was "
- "successful for the following website : %s \n" % self.name)
- self.environment.SwitchFromInternals()
+ try:
+ correct_password = self.password
+ self.password = self.password + "1"
+ self.LoginWhenNotAutofilled()
+ self.password = correct_password
+ self.Wait(2)
+ self.environment.SwitchToInternals()
+ self.environment.CheckForNewMessage(
+ environment.MESSAGE_SAVE,
+ False,
+ "Error: password manager thinks that a login with wrong password was "
+ "successful for the following website : %s \n" % self.name)
+ finally:
+ self.environment.SwitchFromInternals()
def SuccessfulLoginTest(self):
"""Does the successful login when the password is not expected to be
@@ -330,17 +332,19 @@ class WebsiteTest:
saved.
"""
logging.info("\nSuccessful Login Test for %s \n" % self.name)
- self.LoginWhenNotAutofilled()
- self.Wait(2)
- self.environment.SwitchToInternals()
- self.environment.CheckForNewMessage(
- environment.MESSAGE_SAVE,
- True,
- "Error: password manager hasn't detected a successful login for the "
- "following website : %s \n"
- % self.name)
- self.environment.SwitchFromInternals()
- self.Logout()
+ try:
+ self.LoginWhenNotAutofilled()
+ self.Wait(2)
+ self.environment.SwitchToInternals()
+ self.environment.CheckForNewMessage(
+ environment.MESSAGE_SAVE,
+ True,
+ "Error: password manager hasn't detected a successful login for the "
+ "following website : %s \n"
+ % self.name)
+ finally:
+ self.environment.SwitchFromInternals()
+ self.Logout()
def SuccessfulLoginWithAutofilledPasswordTest(self):
"""Does the successful login when the password is expected to be autofilled
@@ -356,17 +360,19 @@ class WebsiteTest:
"""
logging.info("\nSuccessful Login With Autofilled Password"
" Test %s \n" % self.name)
- self.LoginWhenAutofilled()
- self.Wait(2)
- self.environment.SwitchToInternals()
- self.environment.CheckForNewMessage(
- environment.MESSAGE_SAVE,
- True,
- "Error: password manager hasn't detected a successful login for the "
- "following website : %s \n"
- % self.name)
- self.environment.SwitchFromInternals()
- self.Logout()
+ try:
+ self.LoginWhenAutofilled()
+ self.Wait(2)
+ self.environment.SwitchToInternals()
+ self.environment.CheckForNewMessage(
+ environment.MESSAGE_SAVE,
+ True,
+ "Error: password manager hasn't detected a successful login for the "
+ "following website : %s \n"
+ % self.name)
+ finally:
+ self.environment.SwitchFromInternals()
+ self.Logout()
def PromptTest(self):
"""Does the prompt test: Tries to login with a wrong password and
@@ -381,25 +387,27 @@ class WebsiteTest:
password or is shown for a wrong one.
"""
logging.info("\nPrompt Test for %s \n" % self.name)
- correct_password = self.password
- self.password = self.password + "1"
- self.LoginWhenNotAutofilled()
- self.password = correct_password
- self.Wait(2)
- self.environment.SwitchToInternals()
- self.environment.CheckForNewMessage(
- environment.MESSAGE_ASK,
- False,
- "Error: password manager thinks that a login with wrong password was "
- "successful for the following website : %s \n" % self.name)
- self.environment.SwitchFromInternals()
-
- self.LoginWhenNotAutofilled()
- self.Wait(2)
- self.environment.SwitchToInternals()
- self.environment.CheckForNewMessage(
- environment.MESSAGE_ASK,
- True,
- "Error: password manager hasn't detected a successful login for the "
- "following website : %s \n" % self.name)
- self.environment.SwitchFromInternals()
+ try:
+ correct_password = self.password
+ self.password = self.password + "1"
+ self.LoginWhenNotAutofilled()
+ self.password = correct_password
+ self.Wait(2)
+ self.environment.SwitchToInternals()
+ self.environment.CheckForNewMessage(
+ environment.MESSAGE_ASK,
+ False,
+ "Error: password manager thinks that a login with wrong password was "
+ "successful for the following website : %s \n" % self.name)
+ self.environment.SwitchFromInternals()
+
+ self.LoginWhenNotAutofilled()
+ self.Wait(2)
+ self.environment.SwitchToInternals()
+ self.environment.CheckForNewMessage(
+ environment.MESSAGE_ASK,
+ True,
+ "Error: password manager hasn't detected a successful login for the "
+ "following website : %s \n" % self.name)
+ finally:
+ self.environment.SwitchFromInternals()
« 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