| OLD | NEW | 
|---|
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 """Runs host-driven tests on a particular device.""" | 5 """Runs host-driven tests on a particular device.""" | 
| 6 | 6 | 
| 7 import logging | 7 import logging | 
| 8 import sys | 8 import sys | 
| 9 import time | 9 import time | 
| 10 import traceback | 10 import traceback | 
| 11 | 11 | 
| 12 from pylib.base import base_test_result | 12 from pylib.base import base_test_result | 
| 13 from pylib.base import base_test_runner | 13 from pylib.base import base_test_runner | 
|  | 14 from pylib.host_driven import test_case | 
| 14 from pylib.instrumentation import test_result | 15 from pylib.instrumentation import test_result | 
| 15 | 16 | 
| 16 import test_case |  | 
| 17 |  | 
| 18 | 17 | 
| 19 class HostDrivenExceptionTestResult(test_result.InstrumentationTestResult): | 18 class HostDrivenExceptionTestResult(test_result.InstrumentationTestResult): | 
| 20   """Test result corresponding to a python exception in a host-driven test.""" | 19   """Test result corresponding to a python exception in a host-driven test.""" | 
| 21 | 20 | 
| 22   def __init__(self, test_name, start_date_ms, exc_info): | 21   def __init__(self, test_name, start_date_ms, exc_info): | 
| 23     """Constructs a HostDrivenExceptionTestResult object. | 22     """Constructs a HostDrivenExceptionTestResult object. | 
| 24 | 23 | 
| 25     Args: | 24     Args: | 
| 26       test_name: name of the test which raised an exception. | 25       test_name: name of the test which raised an exception. | 
| 27       start_date_ms: the starting time for the test. | 26       start_date_ms: the starting time for the test. | 
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 125         # until the test is fixed. | 124         # until the test is fixed. | 
| 126         exc_info = sys.exc_info() | 125         exc_info = sys.exc_info() | 
| 127         results = base_test_result.TestRunResults() | 126         results = base_test_result.TestRunResults() | 
| 128         results.AddResult(HostDrivenExceptionTestResult( | 127         results.AddResult(HostDrivenExceptionTestResult( | 
| 129             test.tagged_name, start_date_ms, exc_info)) | 128             test.tagged_name, start_date_ms, exc_info)) | 
| 130 | 129 | 
| 131     if not results.DidRunPass(): | 130     if not results.DidRunPass(): | 
| 132       return results, test | 131       return results, test | 
| 133     else: | 132     else: | 
| 134       return results, None | 133       return results, None | 
| OLD | NEW | 
|---|