| OLD | NEW |
| 1 # Copyright (C) 2010 Google Inc. All rights reserved. | 1 # Copyright (C) 2010 Google Inc. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 | 44 |
| 45 Returns: | 45 Returns: |
| 46 one of the test_expectations result types - PASS, FAIL, CRASH, etc.""" | 46 one of the test_expectations result types - PASS, FAIL, CRASH, etc.""" |
| 47 | 47 |
| 48 if not failure_list or len(failure_list) == 0: | 48 if not failure_list or len(failure_list) == 0: |
| 49 return test_expectations.PASS | 49 return test_expectations.PASS |
| 50 | 50 |
| 51 failure_types = [type(f) for f in failure_list] | 51 failure_types = [type(f) for f in failure_list] |
| 52 if FailureCrash in failure_types: | 52 if FailureCrash in failure_types: |
| 53 return test_expectations.CRASH | 53 return test_expectations.CRASH |
| 54 elif FailureLeak in failure_types: |
| 55 return test_expectations.LEAK |
| 54 elif FailureTimeout in failure_types: | 56 elif FailureTimeout in failure_types: |
| 55 return test_expectations.TIMEOUT | 57 return test_expectations.TIMEOUT |
| 56 elif FailureEarlyExit in failure_types: | 58 elif FailureEarlyExit in failure_types: |
| 57 return test_expectations.SKIP | 59 return test_expectations.SKIP |
| 58 elif (FailureMissingResult in failure_types or | 60 elif (FailureMissingResult in failure_types or |
| 59 FailureMissingImage in failure_types or | 61 FailureMissingImage in failure_types or |
| 60 FailureMissingImageHash in failure_types or | 62 FailureMissingImageHash in failure_types or |
| 61 FailureMissingAudio in failure_types): | 63 FailureMissingAudio in failure_types): |
| 62 return test_expectations.MISSING | 64 return test_expectations.MISSING |
| 63 else: | 65 else: |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 | 132 |
| 131 def message(self): | 133 def message(self): |
| 132 if self.pid: | 134 if self.pid: |
| 133 return "%s crashed [pid=%d]" % (self.process_name, self.pid) | 135 return "%s crashed [pid=%d]" % (self.process_name, self.pid) |
| 134 return self.process_name + " crashed" | 136 return self.process_name + " crashed" |
| 135 | 137 |
| 136 def driver_needs_restart(self): | 138 def driver_needs_restart(self): |
| 137 return True | 139 return True |
| 138 | 140 |
| 139 | 141 |
| 142 class FailureLeak(TestFailure): |
| 143 def __init__(self, is_reftest=False, log=''): |
| 144 super(FailureLeak, self).__init__() |
| 145 self.is_reftest = is_reftest |
| 146 self.log = log |
| 147 |
| 148 def message(self): |
| 149 return "leak detected: %s" % (self.log) |
| 150 |
| 151 |
| 140 class FailureMissingResult(TestFailure): | 152 class FailureMissingResult(TestFailure): |
| 141 def message(self): | 153 def message(self): |
| 142 return "-expected.txt was missing" | 154 return "-expected.txt was missing" |
| 143 | 155 |
| 144 | 156 |
| 145 class FailureTestHarnessAssertion(TestFailure): | 157 class FailureTestHarnessAssertion(TestFailure): |
| 146 def message(self): | 158 def message(self): |
| 147 return "asserts failed" | 159 return "asserts failed" |
| 148 | 160 |
| 149 | 161 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 # Convenient collection of all failure classes for anything that might | 229 # Convenient collection of all failure classes for anything that might |
| 218 # need to enumerate over them all. | 230 # need to enumerate over them all. |
| 219 ALL_FAILURE_CLASSES = (FailureTimeout, FailureCrash, FailureMissingResult, | 231 ALL_FAILURE_CLASSES = (FailureTimeout, FailureCrash, FailureMissingResult, |
| 220 FailureTestHarnessAssertion, | 232 FailureTestHarnessAssertion, |
| 221 FailureTextMismatch, FailureMissingImageHash, | 233 FailureTextMismatch, FailureMissingImageHash, |
| 222 FailureMissingImage, FailureImageHashMismatch, | 234 FailureMissingImage, FailureImageHashMismatch, |
| 223 FailureImageHashIncorrect, FailureReftestMismatch, | 235 FailureImageHashIncorrect, FailureReftestMismatch, |
| 224 FailureReftestMismatchDidNotOccur, FailureReftestNoImages
Generated, | 236 FailureReftestMismatchDidNotOccur, FailureReftestNoImages
Generated, |
| 225 FailureMissingAudio, FailureAudioMismatch, | 237 FailureMissingAudio, FailureAudioMismatch, |
| 226 FailureEarlyExit) | 238 FailureEarlyExit) |
| OLD | NEW |