| OLD | NEW |
| 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """Class for running uiautomator tests on a single device.""" | 5 """Class for running uiautomator tests on a single device.""" |
| 6 | 6 |
| 7 from devil.android.sdk import intent | 7 from devil.android.sdk import intent |
| 8 from pylib import constants | 8 from pylib import constants |
| 9 from pylib import flag_changer | 9 from pylib import flag_changer |
| 10 from pylib.instrumentation import test_options as instr_test_options | 10 from pylib.instrumentation import test_options as instr_test_options |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 activity=self._activity, | 71 activity=self._activity, |
| 72 package=self._package), | 72 package=self._package), |
| 73 blocking=True, | 73 blocking=True, |
| 74 force_stop=True) | 74 force_stop=True) |
| 75 cmd = ['uiautomator', 'runtest', | 75 cmd = ['uiautomator', 'runtest', |
| 76 self.test_pkg.UIAUTOMATOR_PATH + self.test_pkg.GetPackageName(), | 76 self.test_pkg.UIAUTOMATOR_PATH + self.test_pkg.GetPackageName(), |
| 77 '-e', 'class', test, | 77 '-e', 'class', test, |
| 78 '-e', 'test_package', self._package] | 78 '-e', 'test_package', self._package] |
| 79 return self.device.RunShellCommand(cmd, timeout=timeout, retries=0) | 79 return self.device.RunShellCommand(cmd, timeout=timeout, retries=0) |
| 80 | 80 |
| 81 # pylint: disable=unused-argument |
| 81 #override | 82 #override |
| 82 def _GenerateTestResult(self, test, _result_code, _result_bundle, statuses, | 83 def _GenerateTestResult(self, test, _result_code, _result_bundle, statuses, |
| 83 start_ms, duration_ms): | 84 start_ms, duration_ms): |
| 84 # uiautomator emits its summary status with INSTRUMENTATION_STATUS_CODE, | 85 # uiautomator emits its summary status with INSTRUMENTATION_STATUS_CODE, |
| 85 # not INSTRUMENTATION_CODE, so we have to drop if off the list of statuses. | 86 # not INSTRUMENTATION_CODE, so we have to drop if off the list of statuses. |
| 86 summary_code, summary_bundle = statuses[-1] | 87 summary_code, summary_bundle = statuses[-1] |
| 87 return super(TestRunner, self)._GenerateTestResult( | 88 return super(TestRunner, self)._GenerateTestResult( |
| 88 test, summary_code, summary_bundle, statuses[:-1], start_ms, | 89 test, summary_code, summary_bundle, statuses[:-1], start_ms, |
| 89 duration_ms) | 90 duration_ms) |
| OLD | NEW |