Changeset 150800 in webkit
- Timestamp:
- May 28, 2013 6:34:19 AM (11 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r150726 r150800 1 2013-05-28 Zan Dobersek <zdobersek@igalia.com> 2 3 [webkitpy] Explicitly specify the reference file extensions 4 https://bugs.webkit.org/show_bug.cgi?id=116333 5 6 Reviewed by Benjamin Poulain. 7 8 Explicitly specify the extensions that are valid for the reference files. This helps to differentiate 9 between valid reference files required by reftests and text baselines that have the same extension as 10 potential test files (specifically the current MHTML tests in the .mht files and the future .mht baselines 11 that were until this change recognized as reference files). 12 13 Covered by existing tests and the new test_is_reference_html_file test in webkitpy.port.base_unittest. 14 15 * Scripts/webkitpy/port/base.py: 16 (Port.reference_files): Iterate through the _supported_reference_extensions set. 17 (Port): Rename the _supported_file_extensions set to _supported_test_extensions. Add the 18 _supported_reference_extensions set, containing the extensions allowed for reference files. 19 (Port.is_reference_html_file): Return False if the file's extension is not a supported reference file extension. 20 (Port._has_supported_extension): Use _supported_test_extensions. 21 * Scripts/webkitpy/port/base_unittest.py: 22 (PortTest.test_is_reference_html_file): Add the unit test, testing various test cases around the 23 Port.is_reference_html_file method. 24 1 25 2013-05-26 Ryosuke Niwa <rniwa@webkit.org> 2 26 -
trunk/Tools/Scripts/webkitpy/port/base.py
r150670 r150800 572 572 reftest_list = [] 573 573 for expectation, prefix in (('==', ''), ('!=', '-mismatch')): 574 for extention in Port._supported_ file_extensions:574 for extention in Port._supported_reference_extensions: 575 575 path = self.expected_filename(test_name, prefix + extention) 576 576 if self._filesystem.exists(path): … … 607 607 608 608 # When collecting test cases, we include any file with these extensions. 609 _supported_ file_extensions = set(['.html', '.shtml', '.xml', '.xhtml', '.pl',610 '.htm', '.php', '.svg', '.mht'])609 _supported_test_extensions = set(['.html', '.shtml', '.xml', '.xhtml', '.pl', '.htm', '.php', '.svg', '.mht']) 610 _supported_reference_extensions = set(['.html', '.xml', '.xhtml', '.htm', '.svg']) 611 611 612 612 @staticmethod … … 615 615 if filename.startswith('ref-') or filename.startswith('notref-'): 616 616 return True 617 filename_wihout_ext, unused = filesystem.splitext(filename) 617 filename_wihout_ext, ext = filesystem.splitext(filename) 618 if ext not in Port._supported_reference_extensions: 619 return False 618 620 for suffix in ['-expected', '-expected-mismatch', '-ref', '-notref']: 619 621 if filename_wihout_ext.endswith(suffix): … … 625 627 """Return true if filename is one of the file extensions we want to run a test on.""" 626 628 extension = filesystem.splitext(filename)[1] 627 return extension in Port._supported_ file_extensions629 return extension in Port._supported_test_extensions 628 630 629 631 @staticmethod -
trunk/Tools/Scripts/webkitpy/port/base_unittest.py
r148502 r150800 348 348 self.assertFalse(Port._is_test_file(filesystem, '', 'notref-foo.xhr')) 349 349 350 def test_is_reference_html_file(self): 351 filesystem = MockFileSystem() 352 self.assertTrue(Port.is_reference_html_file(filesystem, '', 'foo-expected.html')) 353 self.assertTrue(Port.is_reference_html_file(filesystem, '', 'foo-expected-mismatch.xml')) 354 self.assertTrue(Port.is_reference_html_file(filesystem, '', 'foo-ref.xhtml')) 355 self.assertTrue(Port.is_reference_html_file(filesystem, '', 'foo-notref.svg')) 356 self.assertFalse(Port.is_reference_html_file(filesystem, '', 'foo.html')) 357 self.assertFalse(Port.is_reference_html_file(filesystem, '', 'foo-expected.txt')) 358 self.assertFalse(Port.is_reference_html_file(filesystem, '', 'foo-expected.shtml')) 359 self.assertFalse(Port.is_reference_html_file(filesystem, '', 'foo-expected.php')) 360 self.assertFalse(Port.is_reference_html_file(filesystem, '', 'foo-expected.mht')) 361 350 362 def test_parse_reftest_list(self): 351 363 port = self.make_port(with_tests=True)
Note: See TracChangeset
for help on using the changeset viewer.