| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 collections | 5 import collections |
| 6 import copy | 6 import copy |
| 7 import logging | 7 import logging |
| 8 import os | 8 import os |
| 9 import pickle | 9 import pickle |
| 10 import re | 10 import re |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 if current_result: | 123 if current_result: |
| 124 results.append(current_result) | 124 results.append(current_result) |
| 125 current_result = test_result.InstrumentationTestResult( | 125 current_result = test_result.InstrumentationTestResult( |
| 126 test_name, base_test_result.ResultType.UNKNOWN, start_ms, duration_ms) | 126 test_name, base_test_result.ResultType.UNKNOWN, start_ms, duration_ms) |
| 127 else: | 127 else: |
| 128 if status_code == instrumentation_parser.STATUS_CODE_OK: | 128 if status_code == instrumentation_parser.STATUS_CODE_OK: |
| 129 if bundle.get('test_skipped', '').lower() in ('true', '1', 'yes'): | 129 if bundle.get('test_skipped', '').lower() in ('true', '1', 'yes'): |
| 130 current_result.SetType(base_test_result.ResultType.SKIP) | 130 current_result.SetType(base_test_result.ResultType.SKIP) |
| 131 elif current_result.GetType() == base_test_result.ResultType.UNKNOWN: | 131 elif current_result.GetType() == base_test_result.ResultType.UNKNOWN: |
| 132 current_result.SetType(base_test_result.ResultType.PASS) | 132 current_result.SetType(base_test_result.ResultType.PASS) |
| 133 elif status_code == instrumentation_parser.STATUS_CODE_SKIP: |
| 134 current_result.SetType(base_test_result.ResultType.SKIP) |
| 133 else: | 135 else: |
| 134 if status_code not in (instrumentation_parser.STATUS_CODE_ERROR, | 136 if status_code not in (instrumentation_parser.STATUS_CODE_ERROR, |
| 135 instrumentation_parser.STATUS_CODE_FAILURE): | 137 instrumentation_parser.STATUS_CODE_FAILURE): |
| 136 logging.error('Unrecognized status code %d. Handling as an error.', | 138 logging.error('Unrecognized status code %d. Handling as an error.', |
| 137 status_code) | 139 status_code) |
| 138 current_result.SetType(base_test_result.ResultType.FAIL) | 140 current_result.SetType(base_test_result.ResultType.FAIL) |
| 139 if 'stack' in bundle: | 141 if 'stack' in bundle: |
| 140 current_result.SetLog(bundle['stack']) | 142 current_result.SetLog(bundle['stack']) |
| 141 | 143 |
| 142 if current_result: | 144 if current_result: |
| (...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 690 @staticmethod | 692 @staticmethod |
| 691 def GenerateTestResults( | 693 def GenerateTestResults( |
| 692 result_code, result_bundle, statuses, start_ms, duration_ms): | 694 result_code, result_bundle, statuses, start_ms, duration_ms): |
| 693 return GenerateTestResults(result_code, result_bundle, statuses, | 695 return GenerateTestResults(result_code, result_bundle, statuses, |
| 694 start_ms, duration_ms) | 696 start_ms, duration_ms) |
| 695 | 697 |
| 696 #override | 698 #override |
| 697 def TearDown(self): | 699 def TearDown(self): |
| 698 if self._isolate_delegate: | 700 if self._isolate_delegate: |
| 699 self._isolate_delegate.Clear() | 701 self._isolate_delegate.Clear() |
| OLD | NEW |