| 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 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 744 return tests | 744 return tests |
| 745 | 745 |
| 746 @memoized | 746 @memoized |
| 747 def _wpt_manifest(self): | 747 def _wpt_manifest(self): |
| 748 manifest_path = self._filesystem.join(self.layout_tests_dir(), 'external
', 'wpt', 'MANIFEST.json') | 748 manifest_path = self._filesystem.join(self.layout_tests_dir(), 'external
', 'wpt', 'MANIFEST.json') |
| 749 if not self._filesystem.exists(manifest_path): | 749 if not self._filesystem.exists(manifest_path): |
| 750 _log.error('Manifest not found at %s. See http://crbug.com/698294',
manifest_path) | 750 _log.error('Manifest not found at %s. See http://crbug.com/698294',
manifest_path) |
| 751 return WPTManifest('{}') | 751 return WPTManifest('{}') |
| 752 return WPTManifest(self._filesystem.read_text_file(manifest_path)) | 752 return WPTManifest(self._filesystem.read_text_file(manifest_path)) |
| 753 | 753 |
| 754 def is_wpt_test(self, test_entry): |
| 755 match = re.match(r'external/wpt(/.*)', test_entry) |
| 756 if not match: |
| 757 return False |
| 758 return self._wpt_manifest().is_test_url(match.group(1)) |
| 759 |
| 754 def is_slow_wpt_test(self, test_file): | 760 def is_slow_wpt_test(self, test_file): |
| 755 match = re.match(r'external/wpt/(.*)', test_file) | 761 match = re.match(r'external/wpt/(.*)', test_file) |
| 756 if not match: | 762 if not match: |
| 757 return False | 763 return False |
| 758 return self._wpt_manifest().is_slow_test(match.group(1)) | 764 return self._wpt_manifest().is_slow_test(match.group(1)) |
| 759 | 765 |
| 760 ALL_TEST_TYPES = ['audio', 'harness', 'pixel', 'ref', 'text', 'unknown'] | 766 ALL_TEST_TYPES = ['audio', 'harness', 'pixel', 'ref', 'text', 'unknown'] |
| 761 | 767 |
| 762 def test_type(self, test_name): | 768 def test_type(self, test_name): |
| 763 fs = self._filesystem | 769 fs = self._filesystem |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 829 if self._filesystem.isdir(self.abspath_for_test(test_name)): | 835 if self._filesystem.isdir(self.abspath_for_test(test_name)): |
| 830 return True | 836 return True |
| 831 base = self.lookup_virtual_test_base(test_name) | 837 base = self.lookup_virtual_test_base(test_name) |
| 832 return base and self._filesystem.isdir(self.abspath_for_test(base)) | 838 return base and self._filesystem.isdir(self.abspath_for_test(base)) |
| 833 | 839 |
| 834 @memoized | 840 @memoized |
| 835 def test_exists(self, test_name): | 841 def test_exists(self, test_name): |
| 836 """Returns True if the test name refers to an existing test or baseline.
""" | 842 """Returns True if the test name refers to an existing test or baseline.
""" |
| 837 # Used by test_expectations.py to determine if an entry refers to a | 843 # Used by test_expectations.py to determine if an entry refers to a |
| 838 # valid test and by printing.py to determine if baselines exist. | 844 # valid test and by printing.py to determine if baselines exist. |
| 839 return self.test_isfile(test_name) or self.test_isdir(test_name) | 845 return self.is_wpt_test(test_name) or self.test_isfile(test_name) or sel
f.test_isdir(test_name) |
| 840 | 846 |
| 841 def split_test(self, test_name): | 847 def split_test(self, test_name): |
| 842 """Splits a test name into the 'directory' part and the 'basename' part.
""" | 848 """Splits a test name into the 'directory' part and the 'basename' part.
""" |
| 843 index = test_name.rfind(self.TEST_PATH_SEPARATOR) | 849 index = test_name.rfind(self.TEST_PATH_SEPARATOR) |
| 844 if index < 1: | 850 if index < 1: |
| 845 return ('', test_name) | 851 return ('', test_name) |
| 846 return (test_name[0:index], test_name[index:]) | 852 return (test_name[0:index], test_name[index:]) |
| 847 | 853 |
| 848 def normalize_test_name(self, test_name): | 854 def normalize_test_name(self, test_name): |
| 849 """Returns a normalized version of the test name or test directory.""" | 855 """Returns a normalized version of the test name or test directory.""" |
| (...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1639 | 1645 |
| 1640 def __init__(self, base, args, reference_args=None): | 1646 def __init__(self, base, args, reference_args=None): |
| 1641 self.name = base | 1647 self.name = base |
| 1642 self.base = base | 1648 self.base = base |
| 1643 self.args = args | 1649 self.args = args |
| 1644 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 |
| 1645 self.tests = set() | 1651 self.tests = set() |
| 1646 | 1652 |
| 1647 def __repr__(self): | 1653 def __repr__(self): |
| 1648 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) |
| OLD | NEW |