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

Unified Diff: build/android/pylib/android_commands.py

Issue 54123005: android: Add screen recording tool (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: -f instead of -o Created 7 years, 1 month 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
« no previous file with comments | « no previous file | build/android/pylib/cmd_helper.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/android_commands.py
diff --git a/build/android/pylib/android_commands.py b/build/android/pylib/android_commands.py
index f33534ba725065e67bef27af599c689c5f914b36..f0d4efdbab1811ddd370674f2ee65809d12ee99f 100644
--- a/build/android/pylib/android_commands.py
+++ b/build/android/pylib/android_commands.py
@@ -21,6 +21,7 @@ import time
import cmd_helper
import constants
+import screenshot
try:
from pylib import pexpect
except:
@@ -1578,14 +1579,13 @@ class AndroidCommands(object):
"""Saves a screenshot image to |host_file| on the host.
Args:
- host_file: Absolute path to the image file to store on the host.
+ host_file: Absolute path to the image file to store on the host or None to
+ use an autogenerated file name.
+
+ Returns:
+ Resulting host file name of the screenshot.
"""
- host_dir = os.path.dirname(host_file)
- if not os.path.exists(host_dir):
- os.makedirs(host_dir)
- device_file = '%s/screenshot.png' % self.GetExternalStorage()
- self.RunShellCommand('/system/bin/screencap -p %s' % device_file)
- self.PullFileFromDevice(device_file, host_file)
+ return screenshot.TakeScreenshot(self, host_file)
def PullFileFromDevice(self, device_file, host_file):
"""Download |device_file| on the device from to |host_file| on the host.
« no previous file with comments | « no previous file | build/android/pylib/cmd_helper.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698