| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 instrumentation tests on a single device.""" | 5 """Class for running instrumentation tests on a single device.""" |
| 6 | 6 |
| 7 import logging | 7 import logging |
| 8 import os | 8 import os |
| 9 import re | 9 import re |
| 10 import sys | 10 import sys |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 host_src) | 119 host_src) |
| 120 if os.path.exists(host_test_files_path): | 120 if os.path.exists(host_test_files_path): |
| 121 host_device_file_tuples += [( | 121 host_device_file_tuples += [( |
| 122 host_test_files_path, | 122 host_test_files_path, |
| 123 '%s/%s/%s' % ( | 123 '%s/%s/%s' % ( |
| 124 self.device.GetExternalStoragePath(), | 124 self.device.GetExternalStoragePath(), |
| 125 TestRunner._DEVICE_DATA_DIR, | 125 TestRunner._DEVICE_DATA_DIR, |
| 126 dst_layer))] | 126 dst_layer))] |
| 127 if host_device_file_tuples: | 127 if host_device_file_tuples: |
| 128 self.device.PushChangedFiles(host_device_file_tuples) | 128 self.device.PushChangedFiles(host_device_file_tuples) |
| 129 self.tool.CopyFiles() | 129 self.tool.CopyFiles(self.device) |
| 130 TestRunner._DEVICE_HAS_TEST_FILES[str(self.device)] = True | 130 TestRunner._DEVICE_HAS_TEST_FILES[str(self.device)] = True |
| 131 | 131 |
| 132 def _GetInstrumentationArgs(self): | 132 def _GetInstrumentationArgs(self): |
| 133 ret = {} | 133 ret = {} |
| 134 if self.options.wait_for_debugger: | 134 if self.options.wait_for_debugger: |
| 135 ret['debug'] = 'true' | 135 ret['debug'] = 'true' |
| 136 if self.coverage_dir: | 136 if self.coverage_dir: |
| 137 ret['coverage'] = 'true' | 137 ret['coverage'] = 'true' |
| 138 ret['coverageFile'] = self.coverage_device_file | 138 ret['coverageFile'] = self.coverage_device_file |
| 139 | 139 |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 except device_errors.CommandTimeoutError as e: | 505 except device_errors.CommandTimeoutError as e: |
| 506 results.AddResult(test_result.InstrumentationTestResult( | 506 results.AddResult(test_result.InstrumentationTestResult( |
| 507 test, base_test_result.ResultType.TIMEOUT, start_ms, duration_ms, | 507 test, base_test_result.ResultType.TIMEOUT, start_ms, duration_ms, |
| 508 log=str(e) or 'No information')) | 508 log=str(e) or 'No information')) |
| 509 except device_errors.DeviceUnreachableError as e: | 509 except device_errors.DeviceUnreachableError as e: |
| 510 results.AddResult(test_result.InstrumentationTestResult( | 510 results.AddResult(test_result.InstrumentationTestResult( |
| 511 test, base_test_result.ResultType.CRASH, start_ms, duration_ms, | 511 test, base_test_result.ResultType.CRASH, start_ms, duration_ms, |
| 512 log=str(e) or 'No information')) | 512 log=str(e) or 'No information')) |
| 513 self.TestTeardown(test, results) | 513 self.TestTeardown(test, results) |
| 514 return (results, None if results.DidRunPass() else test) | 514 return (results, None if results.DidRunPass() else test) |
| OLD | NEW |