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

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

Issue 403323002: Automatic password manager tests now rely on being killed by the bot on timeout (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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: components/test/data/password_manager/tests.py
diff --git a/components/test/data/password_manager/tests.py b/components/test/data/password_manager/tests.py
index bdefcaa5dcaa9592d42a94b76586f95663e1dbc1..8e59b93b145b35afd2dd3ff806d81a9d5e79140d 100644
--- a/components/test/data/password_manager/tests.py
+++ b/components/test/data/password_manager/tests.py
@@ -407,6 +407,23 @@ def Tests(environment):
environment.AddWebsiteTest(Yahoo("yahoo", username_not_auto=True),
disabled=True)
+def resultsToXml(environment_tests_results):
+ """Convert the test results to an xml string.
+
+ Args:
+ environment_tests_results: A list of the TestResults that are going to be
+ converted.
+ Returns:
+ A string containing the result of the tests in the xml format.
+ """
+ xml = "<result>"
+ for test_result in environment_tests_results:
+ xml += ("<test name='%s' successful='%s' type='%s'>%s</test>"
+ % (test_result.name, str(test_result.successful),
+ test_result.test_type, test_result.message))
+ xml += "</result>"
+ return xml
+
def saveResults(environment_tests_results, environment_save_path):
"""Save the test results in an xml file.
@@ -419,14 +436,8 @@ def saveResults(environment_tests_results, environment_save_path):
Exception: An exception is raised if the file is not found.
"""
if environment_save_path:
- xml = "<result>"
- for test_result in environment_tests_results:
- xml += ("<test name='%s' successful='%s' type='%s'>%s</test>"
- % (test_result.name, str(test_result.successful),
- test_result.test_type, test_result.message))
- xml += "</result>"
with open(environment_save_path, "w") as save_file:
- save_file.write(xml)
+ save_file.write(resultsToXml(environment_tests_results))
def RunTests(chrome_path, chromedriver_path, profile_path,
environment_passwords_path, enable_automatic_password_saving,

Powered by Google App Engine
This is Rietveld 408576698