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

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

Issue 445503004: Dismiss multiple error dialogs when running tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Sami's comment Created 6 years, 4 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 | tools/telemetry/telemetry/core/backends/chrome/android_browser_backend.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 3f9ac68511dfc3475c86e4f1c7ffdc6f67023e57..3ff0744620b561257f63516cdd9ec9e596b7be7e 100644
--- a/build/android/pylib/instrumentation/test_runner.py
+++ b/build/android/pylib/instrumentation/test_runner.py
@@ -392,10 +392,16 @@ class TestRunner(base_test_runner.BaseTestRunner):
if not log:
log = 'No information.'
result_type = base_test_result.ResultType.FAIL
- package = self.device.old_interface.DismissCrashDialogIfNeeded()
- # Assume test package convention of ".test" suffix
- if package and package in self.test_pkg.GetPackageName():
- result_type = base_test_result.ResultType.CRASH
+ # Dismiss any error dialogs. Limit the number in case we have an error
+ # loop or we are failing to dismiss.
+ for _ in xrange(10):
+ package = self.device.old_interface.DismissCrashDialogIfNeeded()
+ if not package:
+ break
+ # Assume test package convention of ".test" suffix
+ if package in self.test_pkg.GetPackageName():
+ result_type = base_test_result.ResultType.CRASH
+ break
result = test_result.InstrumentationTestResult(
test, result_type, start_date_ms, duration_ms, log=log)
else:
« no previous file with comments | « no previous file | tools/telemetry/telemetry/core/backends/chrome/android_browser_backend.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698