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

Side by Side Diff: components/test/data/password_manager/automated_tests/environment.py

Issue 1089383002: [Password manager tests automation] Refactor test_runner. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@base
Patch Set: Created 5 years, 8 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 unified diff | Download patch
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """The testing Environment class. 5 """The testing Environment class.
6 6
7 It holds the WebsiteTest instances, provides them with credentials, 7 It holds the WebsiteTest instances, provides them with credentials,
8 provides clean browser environment, runs the tests, and gathers the 8 provides clean browser environment, runs the tests, and gathers the
9 results. 9 results.
10 """ 10 """
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 self._ClearDataForCheckbox("#delete-passwords-checkbox") 286 self._ClearDataForCheckbox("#delete-passwords-checkbox")
287 self._EnablePasswordSaving() 287 self._EnablePasswordSaving()
288 288
289 for websitetest in self.websitetests: 289 for websitetest in self.websitetests:
290 successful = True 290 successful = True
291 error = "" 291 error = ""
292 try: 292 try:
293 getattr(websitetest, test_case_name)() 293 getattr(websitetest, test_case_name)()
294 except Exception as e: 294 except Exception as e:
295 successful = False 295 successful = False
296 error = e.message 296 # httplib.CannotSendRequest doesn't define a message,
297 # so type(e).__name__ will at least log exception name as a reason.
298 # TODO(melandory): logging.exception(e) produces meaningful result
299 # for httplib.CannotSendRequest, so we can try to propagate information
300 # that reason is an exception to the logging phase.
301 error = "Exception %s %s" % (type(e).__name__, e)
297 self.tests_results.append( 302 self.tests_results.append(
298 (websitetest.name, test_case_name, successful, error)) 303 (websitetest.name, test_case_name, successful, error))
299 304
300 def Quit(self): 305 def Quit(self):
301 """Shuts down the driver.""" 306 """Shuts down the driver."""
302 self.driver.quit() 307 self.driver.quit()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698