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

Unified Diff: telemetry/telemetry/core/cros_interface.py

Issue 1864383002: Support for TakeScreenshot in cros_platform. (Closed) Base URL: https://github.com/catapult-project/catapult.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: telemetry/telemetry/core/cros_interface.py
diff --git a/telemetry/telemetry/core/cros_interface.py b/telemetry/telemetry/core/cros_interface.py
index da8a899fb894646bd9730df478850fe0a37754ba..e0bca7cfc8f4da2770df63d45d28aa2e3b1bb944 100644
--- a/telemetry/telemetry/core/cros_interface.py
+++ b/telemetry/telemetry/core/cros_interface.py
@@ -477,7 +477,10 @@ class CrOSInterface(object):
mount_prefix = 'guestfs' if is_guest else '/home/.shadow/'
return mount and mount.startswith(mount_prefix)
- def TakeScreenShot(self, screenshot_prefix):
+ def TakeScreenshot(self, file_path):
+ self.RunCmdOnDevice(['/usr/local/autotest/bin/screenshot.py', file_path])
+
+ def TakeScreenshotWithPrefix(self, screenshot_prefix):
"""Takes a screenshot, useful for debugging failures."""
# TODO(achuith): Find a better location for screenshots. Cros autotests
# upload everything in /var/log so use /var/log/screenshots for now.
@@ -491,9 +494,7 @@ class CrOSInterface(object):
screenshot_file = ('%s%s-%d%s' %
(SCREENSHOT_DIR, screenshot_prefix, i, SCREENSHOT_EXT))
if not self.FileExistsOnDevice(screenshot_file):
- self.RunCmdOnDevice([
- '/usr/local/autotest/bin/screenshot.py', screenshot_file
- ])
+ self.TakeScreenshot(screenshot_file)
return
logging.warning('screenshot directory full.')

Powered by Google App Engine
This is Rietveld 408576698