Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(281)

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base.py

Issue 2644783003: Regenerate MANIFEST.json when WPT tests are run (Closed)
Patch Set: wip - work on what we discussed in the bug Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 733 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 urls = self._wpt_manifest().file_path_to_url_paths(match.group(1)) 744 urls = self._wpt_manifest().file_path_to_url_paths(match.group(1))
745 for url in urls: 745 for url in urls:
746 tests.append(file_path[0:match.start(1)] + url) 746 tests.append(file_path[0:match.start(1)] + url)
747 return tests 747 return tests
748 748
749 @memoized 749 @memoized
750 def _wpt_manifest(self): 750 def _wpt_manifest(self):
751 manifest_path = self._filesystem.join(self.layout_tests_dir(), 'external ', 'wpt', 'MANIFEST.json') 751 manifest_path = self._filesystem.join(self.layout_tests_dir(), 'external ', 'wpt', 'MANIFEST.json')
752 return WPTManifest(self._filesystem.read_text_file(manifest_path)) 752 return WPTManifest(self._filesystem.read_text_file(manifest_path))
753 753
754 def _manifest_items_for_path(self, path_in_wpt):
755 """Returns a manifest item for the given WPT path, or None if not found.
756
757 The format of a manifest item depends on
758 https://github.com/w3c/wpt-tools/blob/master/manifest/item.py
759 and is assumed to be a list of the format [url, extras],
760 or [url, references, extras] for reftests, or None if not found.
761
762 For most testharness tests, the returned manifest_items is expected
763 to look like this:: [["/some/test/path.html", {}]]
764 """
765 items = self._wpt_manifest()['items']
766 if path_in_wpt in items['manual']:
767 return items['manual'][path_in_wpt]
768 elif path_in_wpt in items['reftest']:
769 return items['reftest'][path_in_wpt]
770 elif path_in_wpt in items['testharness']:
771 return items['testharness'][path_in_wpt]
772 return None
jeffcarp 2017/02/21 19:33:16 This isn't part of my CL, not sure how it got in h
qyearsley 2017/02/21 22:47:57 This part was changed in https://codereview.chromi
773
754 def is_slow_wpt_test(self, test_file): 774 def is_slow_wpt_test(self, test_file):
755 match = re.match(r'external/wpt/(.*)', test_file) 775 match = re.match(r'external/wpt/(.*)', test_file)
756 if not match: 776 if not match:
757 return False 777 return False
758 return self._wpt_manifest().is_slow_test(match.group(1)) 778 return self._wpt_manifest().is_slow_test(match.group(1))
759 779
760 ALL_TEST_TYPES = ['audio', 'harness', 'pixel', 'ref', 'text', 'unknown'] 780 ALL_TEST_TYPES = ['audio', 'harness', 'pixel', 'ref', 'text', 'unknown']
761 781
762 def test_type(self, test_name): 782 def test_type(self, test_name):
763 fs = self._filesystem 783 fs = self._filesystem
(...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after
1635 1655
1636 def __init__(self, base, args, reference_args=None): 1656 def __init__(self, base, args, reference_args=None):
1637 self.name = base 1657 self.name = base
1638 self.base = base 1658 self.base = base
1639 self.args = args 1659 self.args = args
1640 self.reference_args = args if reference_args is None else reference_args 1660 self.reference_args = args if reference_args is None else reference_args
1641 self.tests = set() 1661 self.tests = set()
1642 1662
1643 def __repr__(self): 1663 def __repr__(self):
1644 return "PhysicalTestSuite('%s', '%s', %s, %s)" % (self.name, self.base, self.args, self.reference_args) 1664 return "PhysicalTestSuite('%s', '%s', %s, %s)" % (self.name, self.base, self.args, self.reference_args)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698