summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorraywilliams <raywilliams@google.com>2015-04-10 09:53:00 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-10 16:53:24 +0000
commit980327417d215625b8e7840752eb5f56aadcaed6 (patch)
treea35687cc6986f2f675160c9a62ea9b9fb349d5e1
parente7f1486059272207b54bcefb14c9d9b3c55e40d6 (diff)
downloadchromium_src-980327417d215625b8e7840752eb5f56aadcaed6.zip
chromium_src-980327417d215625b8e7840752eb5f56aadcaed6.tar.gz
chromium_src-980327417d215625b8e7840752eb5f56aadcaed6.tar.bz2
Catch screenrecord errors to avoid CommandFailedError.
BUG=474684 Review URL: https://codereview.chromium.org/1074003002 Cr-Commit-Position: refs/heads/master@{#324647}
-rw-r--r--build/android/pylib/screenshot.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/build/android/pylib/screenshot.py b/build/android/pylib/screenshot.py
index e21d756..ea939b7 100644
--- a/build/android/pylib/screenshot.py
+++ b/build/android/pylib/screenshot.py
@@ -2,11 +2,13 @@
# 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
from pylib import cmd_helper
+from pylib.device import device_errors
# TODO(jbudorick) Remove once telemetry gets switched over.
import pylib.android_commands
@@ -71,7 +73,10 @@ class VideoRecorder(object):
self._is_started = False
if not self._recorder:
return
- self._device.KillAll('screenrecord', signum=signal.SIGINT)
+ try:
+ self._device.KillAll('screenrecord', signum=signal.SIGINT)
+ except device_errors.CommandFailedError:
+ logging.warning('Nothing to kill: screenrecord was not running')
self._recorder.wait()
def Pull(self, host_file=None):