From 47ef6f987696073a34f83982550d02e43ec49753 Mon Sep 17 00:00:00 2001 From: "frankf@chromium.org" Date: Fri, 13 Dec 2013 21:38:49 +0000 Subject: [PATCH] [Android] Don't rely on INJECT_EVENTS exception for dismissing dialogs. The failure could manifest in other ways. For example some tests downstream assert whether activity has focus. BUG=None R=dfalcantara@chromium.org Review URL: https://codereview.chromium.org/115473002 git-svn-id: http://src.chromium.org/svn/trunk/src/build@240755 4ff67af0-8c30-449e-8e8b-ad334ec8d88c --- android/pylib/instrumentation/test_runner.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/android/pylib/instrumentation/test_runner.py b/android/pylib/instrumentation/test_runner.py index d3add4e1f..e87de15b0 100644 --- a/android/pylib/instrumentation/test_runner.py +++ b/android/pylib/instrumentation/test_runner.py @@ -340,17 +340,16 @@ 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.' - 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_type = base_test_result.ResultType.FAIL + 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, result_type, start_date_ms, duration_ms, log=log) else: