 Chromium Code Reviews
 Chromium Code Reviews Issue 2644783003:
  Regenerate MANIFEST.json when WPT tests are run  (Closed)
    
  
    Issue 2644783003:
  Regenerate MANIFEST.json when WPT tests are run  (Closed) 
  | 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 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 731 if len(manifest_items) != 1: | 731 if len(manifest_items) != 1: | 
| 732 continue | 732 continue | 
| 733 url = manifest_items[0][0] | 733 url = manifest_items[0][0] | 
| 734 if url[1:] != path_in_wpt: | 734 if url[1:] != path_in_wpt: | 
| 735 # TODO(tkent): foo.any.js and bar.worker.js should be accessed | 735 # TODO(tkent): foo.any.js and bar.worker.js should be accessed | 
| 736 # as foo.any.html, foo.any.worker, and bar.worker with WPTServe. | 736 # as foo.any.html, foo.any.worker, and bar.worker with WPTServe. | 
| 737 continue | 737 continue | 
| 738 tests.append(file_path) | 738 tests.append(file_path) | 
| 739 return tests | 739 return tests | 
| 740 | 740 | 
| 741 def _generate_manifest(self, dest_path): | |
| 
qyearsley
2017/01/19 23:56:19
I usually like to put helper methods under the met
 | |
| 742 manifest_path = self._webkit_finder.path_from_webkit_base( | |
| 743 'Tools', 'Scripts', 'webkitpy', 'thirdparty', 'wpt', 'wpt', 'manifes t') | |
| 744 | |
| 745 if 'css' in dest_path: | |
| 746 # Do nothing for csswg-test. | |
| 747 return | |
| 748 _log.info('Generating MANIFEST.json') | |
| 749 self._executive.run_command([manifest_path, '--work', '--tests-root', de st_path]) | |
| 750 | |
| 741 @memoized | 751 @memoized | 
| 742 def _wpt_manifest(self): | 752 def _wpt_manifest(self): | 
| 753 # Regenerate manifest | |
| 
qyearsley
2017/01/19 23:56:19
Not sure if this comment is necessary, since the m
 | |
| 754 dest_path = self._webkit_finder.path_from_webkit_base('LayoutTests', 'ex ternal', 'wpt') | |
| 755 self._generate_manifest(dest_path) | |
| 756 | |
| 743 path = self._filesystem.join(self.layout_tests_dir(), 'external', 'wpt', 'MANIFEST.json') | 757 path = self._filesystem.join(self.layout_tests_dir(), 'external', 'wpt', 'MANIFEST.json') | 
| 744 return json.loads(self._filesystem.read_text_file(path)) | 758 return json.loads(self._filesystem.read_text_file(path)) | 
| 745 | 759 | 
| 746 def _manifest_items_for_path(self, path_in_wpt): | 760 def _manifest_items_for_path(self, path_in_wpt): | 
| 747 """Returns a manifest item for the given WPT path, or None if not found. | 761 """Returns a manifest item for the given WPT path, or None if not found. | 
| 748 | 762 | 
| 749 The format of a manifest item depends on | 763 The format of a manifest item depends on | 
| 750 https://github.com/w3c/wpt-tools/blob/master/manifest/item.py | 764 https://github.com/w3c/wpt-tools/blob/master/manifest/item.py | 
| 751 and is assumed to be a list of the format [url, extras], | 765 and is assumed to be a list of the format [url, extras], | 
| 752 or [url, references, extras] for reftests, or None if not found. | 766 or [url, references, extras] for reftests, or None if not found. | 
| (...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1651 | 1665 | 
| 1652 def __init__(self, base, args, reference_args=None): | 1666 def __init__(self, base, args, reference_args=None): | 
| 1653 self.name = base | 1667 self.name = base | 
| 1654 self.base = base | 1668 self.base = base | 
| 1655 self.args = args | 1669 self.args = args | 
| 1656 self.reference_args = args if reference_args is None else reference_args | 1670 self.reference_args = args if reference_args is None else reference_args | 
| 1657 self.tests = set() | 1671 self.tests = set() | 
| 1658 | 1672 | 
| 1659 def __repr__(self): | 1673 def __repr__(self): | 
| 1660 return "PhysicalTestSuite('%s', '%s', %s, %s)" % (self.name, self.base, self.args, self.reference_args) | 1674 return "PhysicalTestSuite('%s', '%s', %s, %s)" % (self.name, self.base, self.args, self.reference_args) | 
| OLD | NEW |