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

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: Remove unit test for previous MANIFEST.json regeneration behavior 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 726 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 urls = self._wpt_manifest().file_path_to_url_paths(match.group(1)) 737 urls = self._wpt_manifest().file_path_to_url_paths(match.group(1))
738 for url in urls: 738 for url in urls:
739 tests.append(file_path[0:match.start(1)] + url) 739 tests.append(file_path[0:match.start(1)] + url)
740 return tests 740 return tests
741 741
742 @memoized 742 @memoized
743 def _wpt_manifest(self): 743 def _wpt_manifest(self):
744 manifest_path = self._filesystem.join(self.layout_tests_dir(), 'external ', 'wpt', 'MANIFEST.json') 744 manifest_path = self._filesystem.join(self.layout_tests_dir(), 'external ', 'wpt', 'MANIFEST.json')
745 return WPTManifest(self._filesystem.read_text_file(manifest_path)) 745 return WPTManifest(self._filesystem.read_text_file(manifest_path))
746 746
747 def _manifest_items_for_path(self, path_in_wpt):
foolip 2017/02/16 07:20:26 Looks like this is unused now?
748 """Returns a manifest item for the given WPT path, or None if not found.
749
750 The format of a manifest item depends on
751 https://github.com/w3c/wpt-tools/blob/master/manifest/item.py
752 and is assumed to be a list of the format [url, extras],
753 or [url, references, extras] for reftests, or None if not found.
754
755 For most testharness tests, the returned manifest_items is expected
756 to look like this:: [["/some/test/path.html", {}]]
757 """
758 items = self._wpt_manifest()['items']
759 if path_in_wpt in items['manual']:
760 return items['manual'][path_in_wpt]
761 elif path_in_wpt in items['reftest']:
762 return items['reftest'][path_in_wpt]
763 elif path_in_wpt in items['testharness']:
764 return items['testharness'][path_in_wpt]
765 return None
766
747 def is_slow_wpt_test(self, test_file): 767 def is_slow_wpt_test(self, test_file):
748 match = re.match(r'external/wpt/(.*)', test_file) 768 match = re.match(r'external/wpt/(.*)', test_file)
749 if not match: 769 if not match:
750 return False 770 return False
751 return self._wpt_manifest().is_slow_test(match.group(1)) 771 return self._wpt_manifest().is_slow_test(match.group(1))
752 772
753 ALL_TEST_TYPES = ['audio', 'harness', 'pixel', 'ref', 'text', 'unknown'] 773 ALL_TEST_TYPES = ['audio', 'harness', 'pixel', 'ref', 'text', 'unknown']
754 774
755 def test_type(self, test_name): 775 def test_type(self, test_name):
756 fs = self._filesystem 776 fs = self._filesystem
(...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after
1625 1645
1626 def __init__(self, base, args, reference_args=None): 1646 def __init__(self, base, args, reference_args=None):
1627 self.name = base 1647 self.name = base
1628 self.base = base 1648 self.base = base
1629 self.args = args 1649 self.args = args
1630 self.reference_args = args if reference_args is None else reference_args 1650 self.reference_args = args if reference_args is None else reference_args
1631 self.tests = set() 1651 self.tests = set()
1632 1652
1633 def __repr__(self): 1653 def __repr__(self):
1634 return "PhysicalTestSuite('%s', '%s', %s, %s)" % (self.name, self.base, self.args, self.reference_args) 1654 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