OLD | NEW |
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 Loading... |
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() |
OLD | NEW |