| 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 15 matching lines...) Expand all Loading... |
| 26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 | 28 |
| 29 import cPickle | 29 import cPickle |
| 30 | 30 |
| 31 from webkitpy.layout_tests.models import test_expectations | 31 from webkitpy.layout_tests.models import test_expectations |
| 32 | 32 |
| 33 | 33 |
| 34 def is_reftest_failure(failure_list): | 34 def is_reftest_failure(failure_list): |
| 35 failure_types = [type(f) for f in failure_list] | 35 failure_types = [type(f) for f in failure_list] |
| 36 return set((FailureReftestMismatch, FailureReftestMismatchDidNotOccur, Failu
reReftestNoImagesGenerated)).intersection(failure_types) | 36 return set((FailureReftestMismatch, FailureReftestMismatchDidNotOccur, Failu
reReftestNoImagesGenerated)).intersection( |
| 37 failure_types) |
| 37 | 38 |
| 38 # FIXME: This is backwards. Each TestFailure subclass should know what | 39 # FIXME: This is backwards. Each TestFailure subclass should know what |
| 39 # test_expectation type it corresponds too. Then this method just | 40 # test_expectation type it corresponds too. Then this method just |
| 40 # collects them all from the failure list and returns the worst one. | 41 # collects them all from the failure list and returns the worst one. |
| 41 | 42 |
| 42 | 43 |
| 43 def determine_result_type(failure_list): | 44 def determine_result_type(failure_list): |
| 44 """Takes a set of test_failures and returns which result type best fits | 45 """Takes a set of test_failures and returns which result type best fits |
| 45 the list of failures. "Best fits" means we use the worst type of failure. | 46 the list of failures. "Best fits" means we use the worst type of failure. |
| 46 | 47 |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 # Convenient collection of all failure classes for anything that might | 250 # Convenient collection of all failure classes for anything that might |
| 250 # need to enumerate over them all. | 251 # need to enumerate over them all. |
| 251 ALL_FAILURE_CLASSES = (FailureTimeout, FailureCrash, FailureMissingResult, | 252 ALL_FAILURE_CLASSES = (FailureTimeout, FailureCrash, FailureMissingResult, |
| 252 FailureTestHarnessAssertion, | 253 FailureTestHarnessAssertion, |
| 253 FailureTextMismatch, FailureMissingImageHash, | 254 FailureTextMismatch, FailureMissingImageHash, |
| 254 FailureMissingImage, FailureImageHashMismatch, | 255 FailureMissingImage, FailureImageHashMismatch, |
| 255 FailureImageHashIncorrect, FailureReftestMismatch, | 256 FailureImageHashIncorrect, FailureReftestMismatch, |
| 256 FailureReftestMismatchDidNotOccur, FailureReftestNoImages
Generated, | 257 FailureReftestMismatchDidNotOccur, FailureReftestNoImages
Generated, |
| 257 FailureMissingAudio, FailureAudioMismatch, | 258 FailureMissingAudio, FailureAudioMismatch, |
| 258 FailureEarlyExit) | 259 FailureEarlyExit) |
| OLD | NEW |