Chromium Code Reviews| Index: build/android/pylib/local/device/local_device_instrumentation_test_run.py |
| diff --git a/build/android/pylib/local/device/local_device_instrumentation_test_run.py b/build/android/pylib/local/device/local_device_instrumentation_test_run.py |
| index 2d574de1fd2017149062cb63c9c4eb12e6023bad..e3d6063f78ed0f7c7d2d646bf1edd9e7c6fe2293 100644 |
| --- a/build/android/pylib/local/device/local_device_instrumentation_test_run.py |
| +++ b/build/android/pylib/local/device/local_device_instrumentation_test_run.py |
| @@ -3,6 +3,7 @@ |
| # found in the LICENSE file. |
| import logging |
| +import os |
| import re |
| import time |
| @@ -263,6 +264,13 @@ class LocalDeviceInstrumentationTestRun( |
| if any(r.GetType() not in (base_test_result.ResultType.PASS, |
| base_test_result.ResultType.SKIP) |
| for r in results): |
| + if self._test_instance.screenshot_dir: |
| + file_name = '%s-%s.png' % (test_display_name, |
|
jbudorick
2016/05/19 18:25:25
nit: drop this onto its own line + four space inde
|
| + time.strftime('%Y%m%dT%H%M%S', time.localtime())) |
| + saved_dir = device.TakeScreenshot( |
| + os.path.join(self._test_instance.screenshot_dir, file_name)) |
|
jbudorick
2016/05/19 18:25:24
nit: four space indent
|
| + logging.info('Saved screenshot for %s to %s.', |
|
jbudorick
2016/05/19 18:25:25
nit: drop this onto its own line
|
| + test_display_name, saved_dir) |
|
jbudorick
2016/05/19 18:25:25
nit: four space indent
|
| logging.info('detected failure in %s. raw output:', test_display_name) |
| for l in output: |
| logging.info(' %s', l) |