Chromium Code Reviews| 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 170 -1) | 170 -1) |
| 171 | 171 |
| 172 def test_get_test_set(self): | 172 def test_get_test_set(self): |
| 173 # Handle some corner cases for this routine not covered by other tests. | 173 # Handle some corner cases for this routine not covered by other tests. |
| 174 self.parse_exp(self.get_basic_expectations()) | 174 self.parse_exp(self.get_basic_expectations()) |
| 175 s = self._exp.get_test_set(WONTFIX) | 175 s = self._exp.get_test_set(WONTFIX) |
| 176 self.assertEqual(s, | 176 self.assertEqual(s, |
| 177 set([self.get_test('failures/expected/crash.html'), | 177 set([self.get_test('failures/expected/crash.html'), |
| 178 self.get_test('failures/expected/image_checksum.html')])) | 178 self.get_test('failures/expected/image_checksum.html')])) |
| 179 | 179 |
| 180 def test_needs_rebaseline_reftest(self): | |
| 181 try: | |
| 182 filesystem = self._port.host.filesystem | |
| 183 filesystem.write_text_file(filesystem.join(self._port.layout_tests_d ir(), 'failures/expected/needsrebaseline.html'), 'content') | |
| 184 filesystem.write_text_file(filesystem.join(self._port.layout_tests_d ir(), 'failures/expected/needsrebaseline-expected.html'), 'content') | |
| 185 filesystem.write_text_file(filesystem.join(self._port.layout_tests_d ir(), 'failures/expected/needsmanualrebaseline.html'), 'content') | |
| 186 filesystem.write_text_file(filesystem.join(self._port.layout_tests_d ir(), 'failures/expected/needsmanualrebaseline-expected.html'), 'content') | |
| 187 self.parse_exp("""Bug(user) failures/expected/needsrebaseline.html [ NeedsRebaseline ] | |
| 188 Bug(user) failures/expected/needsmanualrebaseline.html [ NeedsManualRebaseline ] """, is_lint_mode=True) | |
| 189 self.assertFalse(True, "ParseError wasn't raised") | |
| 190 except ParseError, e: | |
| 191 warnings = """expectations:1 A reftest cannot be marked as NeedsReba seline/NeedsManualRebaseline failures/expected/needsrebaseline.html | |
| 192 expectations:2 A reftest cannot be marked as NeedsRebaseline/NeedsManualRebaseli ne failures/expected/needsmanualrebaseline.html""" | |
| 193 self.assertEqual(str(e), warnings) | |
|
Dirk Pranke
2014/01/13 21:53:45
looks like there's a bunch of boilerplate in this
| |
| 194 | |
| 180 def test_parse_warning(self): | 195 def test_parse_warning(self): |
| 181 try: | 196 try: |
| 182 filesystem = self._port.host.filesystem | 197 filesystem = self._port.host.filesystem |
| 183 filesystem.write_text_file(filesystem.join(self._port.layout_tests_d ir(), 'disabled-test.html-disabled'), 'content') | 198 filesystem.write_text_file(filesystem.join(self._port.layout_tests_d ir(), 'disabled-test.html-disabled'), 'content') |
| 184 self.get_test('disabled-test.html-disabled'), | 199 self.get_test('disabled-test.html-disabled'), |
| 185 self.parse_exp("Bug(user) [ FOO ] failures/expected/text.html [ Fail ure ]\n" | 200 self.parse_exp("Bug(user) [ FOO ] failures/expected/text.html [ Fail ure ]\n" |
| 186 "Bug(user) non-existent-test.html [ Failure ]\n" | 201 "Bug(user) non-existent-test.html [ Failure ]\n" |
| 187 "Bug(user) disabled-test.html-disabled [ ImageOnlyFailure ]", is _lint_mode=True) | 202 "Bug(user) disabled-test.html-disabled [ ImageOnlyFailure ]", is _lint_mode=True) |
| 188 self.assertFalse(True, "ParseError wasn't raised") | 203 self.assertFalse(True, "ParseError wasn't raised") |
| 189 except ParseError, e: | 204 except ParseError, e: |
| (...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 852 | 867 |
| 853 def disabled_test_string_whitespace_stripping(self): | 868 def disabled_test_string_whitespace_stripping(self): |
| 854 # FIXME: Re-enable this test once we rework the code to no longer suppor t the old syntax. | 869 # FIXME: Re-enable this test once we rework the code to no longer suppor t the old syntax. |
| 855 self.assert_round_trip('\n', '') | 870 self.assert_round_trip('\n', '') |
| 856 self.assert_round_trip(' [ FOO ] bar [ BAZ ]', '[ FOO ] bar [ BAZ ]') | 871 self.assert_round_trip(' [ FOO ] bar [ BAZ ]', '[ FOO ] bar [ BAZ ]') |
| 857 self.assert_round_trip('[ FOO ] bar [ BAZ ]', '[ FOO ] bar [ BAZ ]') | 872 self.assert_round_trip('[ FOO ] bar [ BAZ ]', '[ FOO ] bar [ BAZ ]') |
| 858 self.assert_round_trip('[ FOO ] bar [ BAZ ] # Qux.', '[ FOO ] bar [ BAZ ] # Qux.') | 873 self.assert_round_trip('[ FOO ] bar [ BAZ ] # Qux.', '[ FOO ] bar [ BAZ ] # Qux.') |
| 859 self.assert_round_trip('[ FOO ] bar [ BAZ ] # Qux.', '[ FOO ] ba r [ BAZ ] # Qux.') | 874 self.assert_round_trip('[ FOO ] bar [ BAZ ] # Qux.', '[ FOO ] ba r [ BAZ ] # Qux.') |
| 860 self.assert_round_trip('[ FOO ] bar [ BAZ ] # Qux.', '[ FOO ] bar [ BAZ ] # Qux.') | 875 self.assert_round_trip('[ FOO ] bar [ BAZ ] # Qux.', '[ FOO ] bar [ BAZ ] # Qux.') |
| 861 self.assert_round_trip('[ FOO ] bar [ BAZ ] # Qux.', '[ FO O ] bar [ BAZ ] # Qux.') | 876 self.assert_round_trip('[ FOO ] bar [ BAZ ] # Qux.', '[ FO O ] bar [ BAZ ] # Qux.') |
| OLD | NEW |