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

Unified Diff: tools/telemetry/telemetry/core/platform/profiler/android_screen_recorder_profiler.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 | « build/android/screenshot.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/platform/profiler/android_screen_recorder_profiler.py
diff --git a/tools/telemetry/telemetry/core/platform/profiler/android_memreport_profiler.py b/tools/telemetry/telemetry/core/platform/profiler/android_screen_recorder_profiler.py
similarity index 50%
copy from tools/telemetry/telemetry/core/platform/profiler/android_memreport_profiler.py
copy to tools/telemetry/telemetry/core/platform/profiler/android_screen_recorder_profiler.py
index 3bf680696d505f9d1984b764c9d70497d02a2518..1fcad70db53201a536735c60f92027326bfd9fa2 100644
--- a/tools/telemetry/telemetry/core/platform/profiler/android_memreport_profiler.py
+++ b/tools/telemetry/telemetry/core/platform/profiler/android_screen_recorder_profiler.py
@@ -9,23 +9,21 @@ from telemetry.core import util
from telemetry.core.backends.chrome import android_browser_finder
from telemetry.core.platform import profiler
-class AndroidMemReportProfiler(profiler.Profiler):
- """Android-specific, collects 'memreport' graphs."""
+class AndroidScreenRecordingProfiler(profiler.Profiler):
+ """Captures a screen recording on Android."""
def __init__(self, browser_backend, platform_backend, output_path, state):
- super(AndroidMemReportProfiler, self).__init__(
+ super(AndroidScreenRecordingProfiler, self).__init__(
browser_backend, platform_backend, output_path, state)
- self._html_file = output_path + '.html'
- self._memreport = subprocess.Popen(
- [os.path.join(util.GetChromiumSrcDir(),
- 'tools', 'android', 'memdump', 'memreport.py'),
- '--manual-graph', '--package', browser_backend.package],
- stdout=file(self._html_file, 'w'),
- stdin=subprocess.PIPE)
+ self._output_path = output_path + '.mp4'
+ self._recorder = subprocess.Popen(
+ [os.path.join(util.GetChromiumSrcDir(), 'build', 'android',
+ 'screenshot.py'), '--video', '--output',
+ self._output_path], stdin=subprocess.PIPE, stdout=subprocess.PIPE)
@classmethod
def name(cls):
- return 'android-memreport'
+ return 'android-screen-recorder'
@classmethod
def is_supported(cls, browser_type):
@@ -34,8 +32,9 @@ class AndroidMemReportProfiler(profiler.Profiler):
return browser_type.startswith('android')
def CollectProfile(self):
- self._memreport.communicate(input='\n')
- self._memreport.wait()
- print 'To view the memory report, open:'
- print self._html_file
- return [self._html_file]
+ self._recorder.communicate(input='\n')
+ self._recorder.wait()
+
+ print 'Screen recording saved as %s' % self._output_path
+ print 'To view, open in Chrome or a video player'
+ return [self._output_path]
« no previous file with comments | « build/android/screenshot.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698