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

Unified Diff: build/android/pylib/instrumentation/test_runner.py

Issue 1407613004: [Android] Clear application state on instrumentation test failure. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 | build/android/pylib/local/device/local_device_instrumentation_test_run.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/instrumentation/test_runner.py
diff --git a/build/android/pylib/instrumentation/test_runner.py b/build/android/pylib/instrumentation/test_runner.py
index 9473566b0a0434ff8fcb0778299fe10d3df5ab51..ae6fb831009eabe3cffd493d84ab9b3b22b5f136 100644
--- a/build/android/pylib/instrumentation/test_runner.py
+++ b/build/android/pylib/instrumentation/test_runner.py
@@ -196,20 +196,21 @@ class TestRunner(base_test_runner.BaseTestRunner):
self.tool.CleanUpEnvironment()
- # The logic below relies on the test passing.
- if not result or not result.DidRunPass():
+ if not result:
return
-
- self.TearDownPerfMonitoring(test)
-
- if self.flags and self._IsFreTest(test):
- self.flags.AddFlags(['--disable-fre'])
-
- if self.coverage_dir:
- self.device.PullFile(
- self.coverage_device_file, self.coverage_host_file)
- self.device.RunShellCommand(
- 'rm -f %s' % self.coverage_device_file)
+ if result.DidRunPass():
+ self.TearDownPerfMonitoring(test)
+
+ if self.flags and self._IsFreTest(test):
+ self.flags.AddFlags(['--disable-fre'])
+
+ if self.coverage_dir:
+ self.device.PullFile(
+ self.coverage_device_file, self.coverage_host_file)
+ self.device.RunShellCommand(
+ 'rm -f %s' % self.coverage_device_file)
+ elif self.package_info:
+ self.device.ClearApplicationState(self.package_info.package)
def TearDownPerfMonitoring(self, test):
"""Cleans up performance monitoring if the specified test required it.
« no previous file with comments | « no previous file | build/android/pylib/local/device/local_device_instrumentation_test_run.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698