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 import logging | 5 import logging |
6 import os | 6 import os |
7 import re | 7 import re |
8 | 8 |
9 from pylib import constants | 9 from pylib import constants |
10 from pylib import pexpect | 10 from pylib import pexpect |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 break | 124 break |
125 else: # re_fail | 125 else: # re_fail |
126 results.AddResult(base_test_result.BaseTestResult( | 126 results.AddResult(base_test_result.BaseTestResult( |
127 full_test_name, base_test_result.ResultType.FAIL, log=log)) | 127 full_test_name, base_test_result.ResultType.FAIL, log=log)) |
128 except pexpect.EOF: | 128 except pexpect.EOF: |
129 logging.error('Test terminated - EOF') | 129 logging.error('Test terminated - EOF') |
130 # We're here because either the device went offline, or the test harness | 130 # We're here because either the device went offline, or the test harness |
131 # crashed without outputting the CRASHED marker (crbug.com/175538). | 131 # crashed without outputting the CRASHED marker (crbug.com/175538). |
132 if not self.device.IsOnline(): | 132 if not self.device.IsOnline(): |
133 raise device_errors.DeviceUnreachableError( | 133 raise device_errors.DeviceUnreachableError( |
134 'Device %s went offline.' % self.device.old_interface.GetDevice()) | 134 'Device %s went offline.' % str(self.device)) |
135 if full_test_name: | 135 if full_test_name: |
136 results.AddResult(base_test_result.BaseTestResult( | 136 results.AddResult(base_test_result.BaseTestResult( |
137 full_test_name, base_test_result.ResultType.CRASH, | 137 full_test_name, base_test_result.ResultType.CRASH, |
138 log=p.before.replace('\r', ''))) | 138 log=p.before.replace('\r', ''))) |
139 except pexpect.TIMEOUT: | 139 except pexpect.TIMEOUT: |
140 logging.error('Test terminated after %d second timeout.', | 140 logging.error('Test terminated after %d second timeout.', |
141 self._timeout) | 141 self._timeout) |
142 if full_test_name: | 142 if full_test_name: |
143 results.AddResult(base_test_result.BaseTestResult( | 143 results.AddResult(base_test_result.BaseTestResult( |
144 full_test_name, base_test_result.ResultType.TIMEOUT, | 144 full_test_name, base_test_result.ResultType.TIMEOUT, |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 self.tool.SetupEnvironment() | 189 self.tool.SetupEnvironment() |
190 | 190 |
191 #override | 191 #override |
192 def TearDown(self): | 192 def TearDown(self): |
193 """Cleans up the test enviroment for the test suite.""" | 193 """Cleans up the test enviroment for the test suite.""" |
194 if _TestSuiteRequiresHighPerfMode(self.test_package.suite_name): | 194 if _TestSuiteRequiresHighPerfMode(self.test_package.suite_name): |
195 self._perf_controller.SetDefaultPerfMode() | 195 self._perf_controller.SetDefaultPerfMode() |
196 self.test_package.ClearApplicationState(self.device) | 196 self.test_package.ClearApplicationState(self.device) |
197 self.tool.CleanUpEnvironment() | 197 self.tool.CleanUpEnvironment() |
198 super(TestRunner, self).TearDown() | 198 super(TestRunner, self).TearDown() |
OLD | NEW |