| 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 shutil | 10 import shutil |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 Args: | 59 Args: |
| 60 options: An options object with the following required attributes: | 60 options: An options object with the following required attributes: |
| 61 - build_type: 'Release' or 'Debug'. | 61 - build_type: 'Release' or 'Debug'. |
| 62 - install_apk: Re-installs the apk if opted. | 62 - install_apk: Re-installs the apk if opted. |
| 63 - save_perf_json: Whether or not to save the JSON file from UI perf | 63 - save_perf_json: Whether or not to save the JSON file from UI perf |
| 64 tests. | 64 tests. |
| 65 - screenshot_failures: Take a screenshot for a test failure | 65 - screenshot_failures: Take a screenshot for a test failure |
| 66 - tool: Name of the Valgrind tool. | 66 - tool: Name of the Valgrind tool. |
| 67 - wait_for_debugger: blocks until the debugger is connected. | 67 - wait_for_debugger: blocks until the debugger is connected. |
| 68 - disable_assertions: Whether to disable java assertions on the device. | 68 - disable_assertions: Whether to disable java assertions on the device. |
| 69 - push_deps: If True, push all dependencies to the device. |
| 69 device: Attached android device. | 70 device: Attached android device. |
| 70 shard_index: Shard index. | 71 shard_index: Shard index. |
| 71 test_pkg: A TestPackage object. | 72 test_pkg: A TestPackage object. |
| 72 ports_to_forward: A list of port numbers for which to set up forwarders. | 73 ports_to_forward: A list of port numbers for which to set up forwarders. |
| 73 Can be optionally requested by a test case. | 74 Can be optionally requested by a test case. |
| 74 """ | 75 """ |
| 75 super(TestRunner, self).__init__(device, options.tool, options.build_type) | 76 super(TestRunner, self).__init__(device, options.tool, options.build_type, |
| 77 options.push_deps) |
| 76 self._lighttp_port = constants.LIGHTTPD_RANDOM_PORT_FIRST + shard_index | 78 self._lighttp_port = constants.LIGHTTPD_RANDOM_PORT_FIRST + shard_index |
| 77 | 79 |
| 78 self.build_type = options.build_type | 80 self.build_type = options.build_type |
| 79 self.test_data = options.test_data | 81 self.test_data = options.test_data |
| 80 self.save_perf_json = options.save_perf_json | 82 self.save_perf_json = options.save_perf_json |
| 81 self.screenshot_failures = options.screenshot_failures | 83 self.screenshot_failures = options.screenshot_failures |
| 82 self.wait_for_debugger = options.wait_for_debugger | 84 self.wait_for_debugger = options.wait_for_debugger |
| 83 self.disable_assertions = options.disable_assertions | 85 self.disable_assertions = options.disable_assertions |
| 84 self.test_pkg = test_pkg | 86 self.test_pkg = test_pkg |
| 85 self.ports_to_forward = ports_to_forward | 87 self.ports_to_forward = ports_to_forward |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 duration_ms = 0 | 349 duration_ms = 0 |
| 348 message = str(e) | 350 message = str(e) |
| 349 if not message: | 351 if not message: |
| 350 message = 'No information.' | 352 message = 'No information.' |
| 351 results.AddResult(test_result.InstrumentationTestResult( | 353 results.AddResult(test_result.InstrumentationTestResult( |
| 352 test, base_test_result.ResultType.CRASH, start_date_ms, duration_ms, | 354 test, base_test_result.ResultType.CRASH, start_date_ms, duration_ms, |
| 353 log=message)) | 355 log=message)) |
| 354 raw_result = None | 356 raw_result = None |
| 355 self.TestTeardown(test, raw_result) | 357 self.TestTeardown(test, raw_result) |
| 356 return (results, None if results.DidRunPass() else test) | 358 return (results, None if results.DidRunPass() else test) |
| OLD | NEW |