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

Unified Diff: build/android/pylib/local/device/local_device_instrumentation_test_run.py

Issue 1981043004: Added the --screenshot option. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: changed file name Created 4 years, 7 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: 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..d31c8b65f1ce81b2788c18575f111b7c5e0b59e7 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,12 @@ 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 = test_display_name + str(time_ms()) + '.png'
jbudorick 2016/05/18 23:34:42 file_name = '%s%s.png' % (test_display_name, time)
BigBossZhiling 2016/05/19 00:43:10 Done.
+ saved_dir = device.TakeScreenshot(
+ os.path.join(self._test_instance.screenshot_dir, file_name))
+ logging.info('Saved screenshot for %s to %s.',
+ test_display_name, saved_dir)
logging.info('detected failure in %s. raw output:', test_display_name)
for l in output:
logging.info(' %s', l)

Powered by Google App Engine
This is Rietveld 408576698