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

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

Issue 2513423003: DevTools: Convert inspector-unit tests to use reusable test harness (Closed)
Patch Set: clean diff Created 4 years, 1 month 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 763 matching lines...) Expand 10 before | Expand all | Expand 10 after
774 filename_without_ext, _ = filesystem.splitext(filename) 774 filename_without_ext, _ = filesystem.splitext(filename)
775 for suffix in ['-expected', '-expected-mismatch', '-ref', '-notref']: 775 for suffix in ['-expected', '-expected-mismatch', '-ref', '-notref']:
776 if filename_without_ext.endswith(suffix): 776 if filename_without_ext.endswith(suffix):
777 return True 777 return True
778 return False 778 return False
779 779
780 @staticmethod 780 @staticmethod
781 def _has_supported_extension(filesystem, filename): 781 def _has_supported_extension(filesystem, filename):
782 """Return true if filename is one of the file extensions we want to run a test on.""" 782 """Return true if filename is one of the file extensions we want to run a test on."""
783 extension = filesystem.splitext(filename)[1] 783 extension = filesystem.splitext(filename)[1]
784 return extension in Port._supported_file_extensions 784 is_js_test = filename.endswith('-spec.js')
785 return extension in Port._supported_file_extensions or is_js_test
785 786
786 def is_test_file(self, filesystem, dirname, filename): 787 def is_test_file(self, filesystem, dirname, filename):
787 match = re.search(r'[/\\]imported[/\\]wpt([/\\].*)?$', dirname) 788 match = re.search(r'[/\\]imported[/\\]wpt([/\\].*)?$', dirname)
788 if match: 789 if match:
789 if match.group(1): 790 if match.group(1):
790 path_in_wpt = match.group(1)[1:].replace('\\', '/') + '/' + file name 791 path_in_wpt = match.group(1)[1:].replace('\\', '/') + '/' + file name
791 else: 792 else:
792 path_in_wpt = filename 793 path_in_wpt = filename
793 return self._manifest_items_for_path(path_in_wpt) is not None 794 return self._manifest_items_for_path(path_in_wpt) is not None
794 return Port._has_supported_extension( 795 return Port._has_supported_extension(
(...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after
1840 1841
1841 def __init__(self, base, args, reference_args=None): 1842 def __init__(self, base, args, reference_args=None):
1842 self.name = base 1843 self.name = base
1843 self.base = base 1844 self.base = base
1844 self.args = args 1845 self.args = args
1845 self.reference_args = args if reference_args is None else reference_args 1846 self.reference_args = args if reference_args is None else reference_args
1846 self.tests = set() 1847 self.tests = set()
1847 1848
1848 def __repr__(self): 1849 def __repr__(self):
1849 return "PhysicalTestSuite('%s', '%s', %s, %s)" % (self.name, self.base, self.args, self.reference_args) 1850 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