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 time | 10 import time |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 55 |
56 Args: | 56 Args: |
57 test_options: An InstrumentationOptions object. | 57 test_options: An InstrumentationOptions object. |
58 device: Attached android device. | 58 device: Attached android device. |
59 shard_index: Shard index. | 59 shard_index: Shard index. |
60 test_pkg: A TestPackage object. | 60 test_pkg: A TestPackage object. |
61 ports_to_forward: A list of port numbers for which to set up forwarders. | 61 ports_to_forward: A list of port numbers for which to set up forwarders. |
62 Can be optionally requested by a test case. | 62 Can be optionally requested by a test case. |
63 """ | 63 """ |
64 super(TestRunner, self).__init__(device, test_options.tool, | 64 super(TestRunner, self).__init__(device, test_options.tool, |
65 test_options.build_type, | |
66 test_options.push_deps, | 65 test_options.push_deps, |
67 test_options.cleanup_test_files) | 66 test_options.cleanup_test_files) |
68 self._lighttp_port = constants.LIGHTTPD_RANDOM_PORT_FIRST + shard_index | 67 self._lighttp_port = constants.LIGHTTPD_RANDOM_PORT_FIRST + shard_index |
69 | 68 |
70 self.options = test_options | 69 self.options = test_options |
71 self.test_pkg = test_pkg | 70 self.test_pkg = test_pkg |
72 self.ports_to_forward = ports_to_forward | 71 self.ports_to_forward = ports_to_forward |
73 | 72 |
74 #override | 73 #override |
75 def InstallTestPackage(self): | 74 def InstallTestPackage(self): |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 duration_ms = 0 | 335 duration_ms = 0 |
337 message = str(e) | 336 message = str(e) |
338 if not message: | 337 if not message: |
339 message = 'No information.' | 338 message = 'No information.' |
340 results.AddResult(test_result.InstrumentationTestResult( | 339 results.AddResult(test_result.InstrumentationTestResult( |
341 test, base_test_result.ResultType.CRASH, start_date_ms, duration_ms, | 340 test, base_test_result.ResultType.CRASH, start_date_ms, duration_ms, |
342 log=message)) | 341 log=message)) |
343 raw_result = None | 342 raw_result = None |
344 self.TestTeardown(test, raw_result) | 343 self.TestTeardown(test, raw_result) |
345 return (results, None if results.DidRunPass() else test) | 344 return (results, None if results.DidRunPass() else test) |
OLD | NEW |