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

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

Issue 11366068: Take screenshots using /system/bin/screencap instead of monkeyrunner. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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/constants.py » ('j') | build/android/pylib/run_java_tests.py » ('J')
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 c40870e40137971d8f3330ed66eddb7d9c1b4464..e03632821322608f75afeff4fa1ddf80e8b77ad2 100644
--- a/build/android/pylib/android_commands.py
+++ b/build/android/pylib/android_commands.py
@@ -1066,6 +1066,17 @@ class AndroidCommands(object):
return False
+ def TakeScreenshot(self, host_file):
+ """Saves a screenshot image to |host_file| on the host.
+
+ Args:
+ host_file: Absolute path to the image file to store on the host.
+ """
+ device_file = '%s/screenshot.png' % self.GetExternalStorage()
+ self.RunShellCommand('/system/bin/screencap -p %s' % device_file)
+ assert self._adb.Pull(device_file, host_file)
+ assert os.path.exists(host_file)
+
class NewLineNormalizer(object):
"""A file-like object to normalize EOLs to '\n'.
« no previous file with comments | « no previous file | build/android/pylib/constants.py » ('j') | build/android/pylib/run_java_tests.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698