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

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

Issue 10689132: [android] Upstream / sync most of build/android and build/android/pylib. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/pylib/constants.py ('k') | build/android/pylib/fake_dns.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/debug_info.py
diff --git a/build/android/pylib/debug_info.py b/build/android/pylib/debug_info.py
index 91e2d1b588af7bb315cdb1b5a2186d4eb35748de..4678c20d9e767070dbb9b8289cc5761d2bbb2d28 100644
--- a/build/android/pylib/debug_info.py
+++ b/build/android/pylib/debug_info.py
@@ -134,8 +134,8 @@ class GTestDebugInfo(object):
It will be part of filename of the screen shot. Empty
string is acceptable.
Returns:
- Returns True if successfully taking screen shot from device, otherwise
- returns False.
+ Returns the file name on the host of the screenshot if successful,
+ None otherwise.
"""
self.InitStorage()
assert isinstance(identifier_mark, str)
@@ -148,9 +148,9 @@ class GTestDebugInfo(object):
if re_success.findall(cmd_helper.GetCmdOutput([screenshot_path, '-s',
self.device, shot_path])):
logging.info("Successfully took a screen shot to %s" % shot_path)
- return True
+ return shot_path
logging.error('Failed to take screen shot from device %s' % self.device)
- return False
+ return None
def ListCrashFiles(self):
"""Collects crash files from current specified device.
@@ -167,11 +167,19 @@ class GTestDebugInfo(object):
if not self.collect_new_crashes:
return
current_crash_files = self.ListCrashFiles()
- files = [f for f in current_crash_files if f not in self.old_crash_files]
- logging.info('New crash file(s):%s' % ' '.join(files))
- for f in files:
- self.adb.Adb().Pull(TOMBSTONE_DIR + f,
- os.path.join(self.GetStoragePath(), f))
+ files = []
+ for f in current_crash_files:
+ if f not in self.old_crash_files:
+ files += [f]
+ elif current_crash_files[f] != self.old_crash_files[f]:
+ # Tomestones dir can only have maximum 10 files, so we need to compare
+ # size and timestamp information of file if the file exists.
+ files += [f]
+ if files:
+ logging.info('New crash file(s):%s' % ' '.join(files))
+ for f in files:
+ self.adb.Adb().Pull(TOMBSTONE_DIR + f,
+ os.path.join(self.GetStoragePath(), f))
@staticmethod
def ZipAndCleanResults(dest_dir, dump_file_name, debug_info_list):
« no previous file with comments | « build/android/pylib/constants.py ('k') | build/android/pylib/fake_dns.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698