Changeset 177727 in webkit
- Timestamp:
- Dec 24, 2014 4:54:11 PM (9 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r177722 r177727 1 2014-12-24 Youenn Fablet <youenn.fablet@crf.canon.fr> 2 3 W3C test importer should have an option to disable testharness.js/testharnessreport.js link conversion 4 https://bugs.webkit.org/show_bug.cgi?id=134763 5 6 Reviewed by Ryosuke Niwa. 7 8 Adding an option to disable test harness link conversion. 9 10 * Scripts/webkitpy/w3c/test_converter.py: 11 (convert_for_webkit): 12 (_W3CTestConverter.__init__): 13 (_W3CTestConverter.convert_attributes_if_needed): 14 * Scripts/webkitpy/w3c/test_importer.py: 15 (parse_args): 16 (TestImporter.import_tests): 17 1 18 2014-12-23 Alexey Proskuryakov <ap@apple.com> 2 19 -
trunk/Tools/Scripts/webkitpy/w3c/test_converter.py
r175257 r177727 38 38 39 39 40 def convert_for_webkit(new_path, filename, reference_support_info, host=Host() ):40 def convert_for_webkit(new_path, filename, reference_support_info, host=Host(), convert_test_harness_links=True): 41 41 """ Converts a file's |contents| so it will function correctly in its |new_path| in Webkit. 42 42 43 43 Returns the list of modified properties and the modified text if the file was modifed, None otherwise.""" 44 44 contents = host.filesystem.read_binary_file(filename) 45 converter = _W3CTestConverter(new_path, filename, reference_support_info, host )45 converter = _W3CTestConverter(new_path, filename, reference_support_info, host, convert_test_harness_links) 46 46 if filename.endswith('.css'): 47 47 return converter.add_webkit_prefix_to_unprefixed_properties_and_values(contents) … … 53 53 54 54 class _W3CTestConverter(HTMLParser): 55 def __init__(self, new_path, filename, reference_support_info, host=Host() ):55 def __init__(self, new_path, filename, reference_support_info, host=Host(), convert_test_harness_links=True): 56 56 HTMLParser.__init__(self) 57 57 … … 71 71 resources_relpath = self._filesystem.relpath(resources_path, new_path) 72 72 self.new_test_harness_path = resources_relpath 73 self.convert_test_harness_links = convert_test_harness_links 73 74 74 75 # These settings might vary between WebKit and Blink … … 166 167 def convert_attributes_if_needed(self, tag, attrs): 167 168 converted = self.get_starttag_text() 168 if tag in ('script', 'link'):169 if self.convert_test_harness_links and tag in ('script', 'link'): 169 170 attr_name = 'src' 170 171 if tag != 'script': -
trunk/Tools/Scripts/webkitpy/w3c/test_importer.py
r174672 r177727 121 121 def parse_args(): 122 122 parser = optparse.OptionParser(usage='usage: %prog [options] w3c_test_directory') 123 123 124 parser.add_option('-n', '--no-overwrite', dest='overwrite', action='store_false', default=True, 124 125 help='Flag to prevent duplicate test files from overwriting existing tests. By default, they will be overwritten') 126 parser.add_option('-l', '--no-links-conversion', dest='convert_test_harness_links', action='store_false', default=True, 127 help='Do not change links (testharness js or css e.g.). By default, links are converted to point to WebKit testharness files.') 128 125 129 parser.add_option('-a', '--all', action='store_true', default=False, 126 130 help='Import all tests including reftests, JS tests, and manual/pixel tests. By default, only reftests and JS tests are imported') … … 301 305 if 'html' in str(mimetype[0]) or 'xml' in str(mimetype[0]) or 'css' in str(mimetype[0]): 302 306 try: 303 converted_file = convert_for_webkit(new_path, filename=orig_filepath, reference_support_info=reference_support_info )307 converted_file = convert_for_webkit(new_path, filename=orig_filepath, reference_support_info=reference_support_info, convert_test_harness_links=self.options.convert_test_harness_links) 304 308 except: 305 309 _log.warn('Failed converting %s', orig_filepath)
Note: See TracChangeset
for help on using the changeset viewer.