Bug 999071 - Empty ANR file during testing instead of deleting it; r=gbrown

This commit is contained in:
Jim Chen 2014-04-24 17:49:02 -04:00
parent b807184a9a
commit 91db7d8775

View File

@ -98,10 +98,12 @@ class RemoteAutomation(Automation):
return status
def deleteANRs(self):
# delete ANR traces.txt file; usually need root permissions
# empty ANR traces.txt file; usually need root permissions
# we make it empty and writable so we can test the ANR reporter later
traces = "/data/anr/traces.txt"
try:
self._devicemanager.shellCheckOutput(['rm', traces], root=True)
self._devicemanager.shellCheckOutput(['echo', '', '>', traces], root=True)
self._devicemanager.shellCheckOutput(['chmod', '666', traces], root=True)
except DMError:
print "Error deleting %s" % traces
pass