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

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

Issue 1074003002: Catch screenrecord errors to avoid CommandFailedError. BUG=474684 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added missing imports Created 5 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/screenshot.py
diff --git a/build/android/pylib/screenshot.py b/build/android/pylib/screenshot.py
index e21d7560b6e5854193362701e91d7935073fca60..aa95d9ced6f97f566deafde5199b63011a7557ee 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')
jbudorick 2015/04/09 22:51:14 nit: Kill -> kill
raywilliams 2015/04/10 15:05:45 Done. For some reason, I always default to making
self._recorder.wait()
def Pull(self, host_file=None):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698