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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 return test_expectations.SKIP | 61 return test_expectations.SKIP |
62 elif (FailureMissingResult in failure_types or | 62 elif (FailureMissingResult in failure_types or |
63 FailureMissingImage in failure_types or | 63 FailureMissingImage in failure_types or |
64 FailureMissingImageHash in failure_types or | 64 FailureMissingImageHash in failure_types or |
65 FailureMissingAudio in failure_types): | 65 FailureMissingAudio in failure_types): |
66 return test_expectations.MISSING | 66 return test_expectations.MISSING |
67 else: | 67 else: |
68 is_text_failure = (FailureTextMismatch in failure_types or | 68 is_text_failure = (FailureTextMismatch in failure_types or |
69 FailureTestHarnessAssertion in failure_types) | 69 FailureTestHarnessAssertion in failure_types) |
70 is_image_failure = (FailureImageHashIncorrect in failure_types or | 70 is_image_failure = (FailureImageHashIncorrect in failure_types or |
71 FailureImageHashMismatch in failure_types) | 71 FailureImageHashMismatch in failure_types or |
| 72 is_reftest_failure(failure_list)) |
72 is_audio_failure = (FailureAudioMismatch in failure_types) | 73 is_audio_failure = (FailureAudioMismatch in failure_types) |
73 if is_text_failure and is_image_failure: | 74 if is_text_failure and is_image_failure: |
74 return test_expectations.IMAGE_PLUS_TEXT | 75 return test_expectations.IMAGE_PLUS_TEXT |
75 elif is_text_failure: | 76 elif is_text_failure: |
76 return test_expectations.TEXT | 77 return test_expectations.TEXT |
77 elif is_image_failure or is_reftest_failure(failure_list): | 78 elif is_image_failure: |
78 return test_expectations.IMAGE | 79 return test_expectations.IMAGE |
79 elif is_audio_failure: | 80 elif is_audio_failure: |
80 return test_expectations.AUDIO | 81 return test_expectations.AUDIO |
81 else: | 82 else: |
82 raise ValueError("unclassifiable set of failures: " | 83 raise ValueError("unclassifiable set of failures: " |
83 + str(failure_types)) | 84 + str(failure_types)) |
84 | 85 |
85 | 86 |
86 class TestFailure(object): | 87 class TestFailure(object): |
87 """Abstract base class that defines the failure interface.""" | 88 """Abstract base class that defines the failure interface.""" |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 # Convenient collection of all failure classes for anything that might | 249 # Convenient collection of all failure classes for anything that might |
249 # need to enumerate over them all. | 250 # need to enumerate over them all. |
250 ALL_FAILURE_CLASSES = (FailureTimeout, FailureCrash, FailureMissingResult, | 251 ALL_FAILURE_CLASSES = (FailureTimeout, FailureCrash, FailureMissingResult, |
251 FailureTestHarnessAssertion, | 252 FailureTestHarnessAssertion, |
252 FailureTextMismatch, FailureMissingImageHash, | 253 FailureTextMismatch, FailureMissingImageHash, |
253 FailureMissingImage, FailureImageHashMismatch, | 254 FailureMissingImage, FailureImageHashMismatch, |
254 FailureImageHashIncorrect, FailureReftestMismatch, | 255 FailureImageHashIncorrect, FailureReftestMismatch, |
255 FailureReftestMismatchDidNotOccur, FailureReftestNoImages
Generated, | 256 FailureReftestMismatchDidNotOccur, FailureReftestNoImages
Generated, |
256 FailureMissingAudio, FailureAudioMismatch, | 257 FailureMissingAudio, FailureAudioMismatch, |
257 FailureEarlyExit) | 258 FailureEarlyExit) |
OLD | NEW |