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

Side by Side Diff: devil/devil/android/logcat_monitor.py

Issue 2112643004: Add device_serial (Closed) Base URL: https://chromium.googlesource.com/external/github.com/catapult-project/catapult.git@master
Patch Set: Delete unsused variables and comments. Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 # pylint: disable=unused-argument 5 # pylint: disable=unused-argument
6 6
7 import errno 7 import errno
8 import logging 8 import logging
9 import os 9 import os
10 import re 10 import re
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 self._output_file = output_file 45 self._output_file = output_file
46 self._record_file = None 46 self._record_file = None
47 self._record_file_lock = threading.Lock() 47 self._record_file_lock = threading.Lock()
48 self._record_thread = None 48 self._record_thread = None
49 self._stop_recording_event = threading.Event() 49 self._stop_recording_event = threading.Event()
50 50
51 @property 51 @property
52 def output_file(self): 52 def output_file(self):
53 return self._output_file 53 return self._output_file
54 54
55 @property
56 def get_device_serial(self):
57 return self._adb.GetDeviceSerial()
58
55 @decorators.WithTimeoutAndRetriesDefaults(10, 0) 59 @decorators.WithTimeoutAndRetriesDefaults(10, 0)
56 def WaitFor(self, success_regex, failure_regex=None, timeout=None, 60 def WaitFor(self, success_regex, failure_regex=None, timeout=None,
57 retries=None): 61 retries=None):
58 """Wait for a matching logcat line or until a timeout occurs. 62 """Wait for a matching logcat line or until a timeout occurs.
59 63
60 This will attempt to match lines in the logcat against both |success_regex| 64 This will attempt to match lines in the logcat against both |success_regex|
61 and |failure_regex| (if provided). Note that this calls re.search on each 65 and |failure_regex| (if provided). Note that this calls re.search on each
62 logcat line, not re.match, so the provided regular expressions don't have 66 logcat line, not re.match, so the provided regular expressions don't have
63 to match an entire line. 67 to match an entire line.
64 68
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 with self._record_file_lock: 237 with self._record_file_lock:
234 if self._record_file: 238 if self._record_file:
235 logging.warning( 239 logging.warning(
236 'Need to call |Close| on the logcat monitor when done!') 240 'Need to call |Close| on the logcat monitor when done!')
237 self._record_file.close() 241 self._record_file.close()
238 242
239 243
240 class LogcatMonitorCommandError(device_errors.CommandFailedError): 244 class LogcatMonitorCommandError(device_errors.CommandFailedError):
241 """Exception for errors with logcat monitor commands.""" 245 """Exception for errors with logcat monitor commands."""
242 pass 246 pass
OLDNEW
« 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