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

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

Issue 1124763003: Update from https://crrev.com/327068 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: update nacl, buildtools, fix display_change_notifier_unittest Created 5 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/screenshot.py
diff --git a/build/android/pylib/screenshot.py b/build/android/pylib/screenshot.py
index e21d7560b6e5854193362701e91d7935073fca60..0fcc59048ec425aab0d7ba5124cdeeacf44e9c36 100644
--- a/build/android/pylib/screenshot.py
+++ b/build/android/pylib/screenshot.py
@@ -2,11 +2,14 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import logging
import os
-import signal
import tempfile
+import time
from pylib import cmd_helper
+from pylib import device_signal
+from pylib.device import device_errors
# TODO(jbudorick) Remove once telemetry gets switched over.
import pylib.android_commands
@@ -71,7 +74,9 @@ class VideoRecorder(object):
self._is_started = False
if not self._recorder:
return
- self._device.KillAll('screenrecord', signum=signal.SIGINT)
+ if not self._device.KillAll('screenrecord', signum=device_signal.SIGINT,
+ quiet=True):
+ logging.warning('Nothing to kill: screenrecord was not running')
self._recorder.wait()
def Pull(self, host_file=None):
@@ -82,10 +87,13 @@ class VideoRecorder(object):
Returns:
Output video file name on the host.
"""
- host_file_name = host_file or ('screen-recording-%s.mp4' %
- self._device.old_interface.GetTimestamp())
+ # TODO(jbudorick): Merge filename generation with the logic for doing so in
+ # DeviceUtils.
+ host_file_name = (
+ host_file
+ or 'screen-recording-%s.mp4' % time.strftime('%Y%m%dT%H%M%S',
+ time.localtime()))
host_file_name = os.path.abspath(host_file_name)
- self._device.old_interface.EnsureHostDirectory(host_file_name)
self._device.PullFile(self._device_file, host_file_name)
self._device.RunShellCommand('rm -f "%s"' % self._device_file)
return host_file_name

Powered by Google App Engine
This is Rietveld 408576698