| 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,
|
|
|