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