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

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

Issue 114563002: [Android] Dismiss crash dialogs during instrumentation test teardown. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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/android_commands.py ('k') | no next file » | 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 9c0896455a274b6d45ed855ad758f2131743b338..d3add4e1f4a8eafbc002685065d9a918db6d4a2a 100644
--- a/build/android/pylib/instrumentation/test_runner.py
+++ b/build/android/pylib/instrumentation/test_runner.py
@@ -340,15 +340,19 @@ class TestRunner(base_test_runner.BaseTestRunner):
duration_ms = int(time.time()) * 1000 - start_date_ms
status_code = raw_result.GetStatusCode()
if status_code:
+ result_type = base_test_result.ResultType.FAIL
+ if self.options.screenshot_failures:
+ self._TakeScreenshot(test)
log = raw_result.GetFailureReason()
if not log:
log = 'No information.'
- if (self.options.screenshot_failures or
- log.find('INJECT_EVENTS perm') >= 0):
- self._TakeScreenshot(test)
+ elif log.find('INJECT_EVENTS perm') >= 0:
+ package = self.adb.DismissCrashDialogIfNeeded()
+ # Assume test package convention of ".test" suffix
+ if package and package in self.test_pkg.GetPackageName():
+ result_type = base_test_result.ResultType.CRASH
result = test_result.InstrumentationTestResult(
- test, base_test_result.ResultType.FAIL, start_date_ms, duration_ms,
- log=log)
+ test, result_type, start_date_ms, duration_ms, log=log)
else:
result = test_result.InstrumentationTestResult(
test, base_test_result.ResultType.PASS, start_date_ms, duration_ms)
« no previous file with comments | « build/android/pylib/android_commands.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698