From 84a6b2c6d2c6844e894cda9858398c4f62c03307 Mon Sep 17 00:00:00 2001 From: Wes Kocher Date: Thu, 23 Apr 2015 16:26:38 -0700 Subject: [PATCH] Backed out changeset 619f030b0d23 (bug 1156812) for android m7 orange --- testing/mozbase/docs/mozdevice.rst | 4 +- testing/mozbase/mozdevice/mozdevice/adb.py | 45 +++++++--------------- 2 files changed, 15 insertions(+), 34 deletions(-) diff --git a/testing/mozbase/docs/mozdevice.rst b/testing/mozbase/docs/mozdevice.rst index d5f60e20f9b3..eb4325815958 100644 --- a/testing/mozbase/docs/mozdevice.rst +++ b/testing/mozbase/docs/mozdevice.rst @@ -169,8 +169,8 @@ Device Shell methods Informational methods +++++++++++++++++++++ -.. automethod:: ADBDevice.clear_logcat -.. automethod:: ADBDevice.get_logcat +.. automethod:: ADBDevice.clear_logcat(self, timeout=None) +.. automethod:: ADBDevice.get_logcat(self, filterSpecs=["dalvikvm:I", "ConnectivityService:S", "WifiMonitor:S", "WifiStateTracker:S", "wpa_supplicant:S", "NetworkStateTracker:S"], format="time", filter_out_regexps=[], timeout=None) .. automethod:: ADBDevice.get_prop(self, prop, timeout=None) .. automethod:: ADBDevice.get_state(self, timeout=None) diff --git a/testing/mozbase/mozdevice/mozdevice/adb.py b/testing/mozbase/mozdevice/mozdevice/adb.py index 9ad297526ca5..02e0cc5cd000 100644 --- a/testing/mozbase/mozdevice/mozdevice/adb.py +++ b/testing/mozbase/mozdevice/mozdevice/adb.py @@ -1104,18 +1104,7 @@ class ADBDevice(ADBCommand): # Informational methods - def _get_logcat_buffer_args(self, buffers): - valid_buffers = set(['radio', 'main', 'events']) - invalid_buffers = set(buffers).difference(valid_buffers) - if invalid_buffers: - raise ADBError('Invalid logcat buffers %s not in %s ' % ( - list(invalid_buffers), list(valid_buffers))) - args = [] - for b in buffers: - args.extend(['-b', b]) - return args - - def clear_logcat(self, timeout=None, buffers=["main"]): + def clear_logcat(self, timeout=None): """Clears logcat via adb logcat -c. :param timeout: optional integer specifying the maximum time in @@ -1124,28 +1113,23 @@ class ADBDevice(ADBCommand): adb call. The total time spent may exceed this value. If it is not specified, the value set in the ADBDevice constructor is used. - :param buffers: list of log buffers to clear. Valid buffers are - "radio", "events", and "main". Defaults to "main". :raises: * ADBTimeoutError * ADBError """ - buffers = self._get_logcat_buffer_args(buffers) - cmds = ["logcat", "-c"] + buffers - self.command_output(cmds, timeout=timeout) + self.command_output(["logcat", "-c"], timeout=timeout) def get_logcat(self, - filter_specs=[ - "dalvikvm:I", - "ConnectivityService:S", - "WifiMonitor:S", - "WifiStateTracker:S", - "wpa_supplicant:S", - "NetworkStateTracker:S"], - format="time", - filter_out_regexps=[], - timeout=None, - buffers=["main"]): + filter_specs=[ + "dalvikvm:I", + "ConnectivityService:S", + "WifiMonitor:S", + "WifiStateTracker:S", + "wpa_supplicant:S", + "NetworkStateTracker:S"], + format="time", + filter_out_regexps=[], + timeout=None): """Returns the contents of the logcat file as a list of strings. :param filter_specs: optional list containing logcat messages to @@ -1159,15 +1143,12 @@ class ADBDevice(ADBCommand): This timeout is per adb call. The total time spent may exceed this value. If it is not specified, the value set in the ADBDevice constructor is used. - :param buffers: list of log buffers to retrieve. Valid buffers are - "radio", "events", and "main". Defaults to "main". :returns: list of lines logcat output. :raises: * ADBTimeoutError * ADBError """ - buffers = self._get_logcat_buffer_args(buffers) - cmds = ["logcat", "-v", format, "-d"] + buffers + filter_specs + cmds = ["logcat", "-v", format, "-d"] + filter_specs lines = self.command_output(cmds, timeout=timeout).split('\r') for regex in filter_out_regexps: