| 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 30 matching lines...) Expand all Loading... |
| 41 import operator | 41 import operator |
| 42 import optparse | 42 import optparse |
| 43 import re | 43 import re |
| 44 import sys | 44 import sys |
| 45 | 45 |
| 46 from webkitpy.common import find_files | 46 from webkitpy.common import find_files |
| 47 from webkitpy.common import read_checksum_from_png | 47 from webkitpy.common import read_checksum_from_png |
| 48 from webkitpy.common.memoized import memoized | 48 from webkitpy.common.memoized import memoized |
| 49 from webkitpy.common.system.executive import ScriptError | 49 from webkitpy.common.system.executive import ScriptError |
| 50 from webkitpy.common.system.path import cygpath, abspath_to_uri | 50 from webkitpy.common.system.path import cygpath, abspath_to_uri |
| 51 from webkitpy.common.webkit_finder import WebKitFinder | 51 from webkitpy.common.blink_finder import BlinkFinder |
| 52 from webkitpy.layout_tests.layout_package.bot_test_expectations import BotTestEx
pectationsFactory | 52 from webkitpy.layout_tests.layout_package.bot_test_expectations import BotTestEx
pectationsFactory |
| 53 from webkitpy.layout_tests.models import test_run_results | 53 from webkitpy.layout_tests.models import test_run_results |
| 54 from webkitpy.layout_tests.models.test_configuration import TestConfiguration | 54 from webkitpy.layout_tests.models.test_configuration import TestConfiguration |
| 55 from webkitpy.layout_tests.models.test_expectations import SKIP | 55 from webkitpy.layout_tests.models.test_expectations import SKIP |
| 56 from webkitpy.layout_tests.port import driver | 56 from webkitpy.layout_tests.port import driver |
| 57 from webkitpy.layout_tests.port import server_process | 57 from webkitpy.layout_tests.port import server_process |
| 58 from webkitpy.layout_tests.port.factory import PortFactory | 58 from webkitpy.layout_tests.port.factory import PortFactory |
| 59 from webkitpy.layout_tests.servers import apache_http | 59 from webkitpy.layout_tests.servers import apache_http |
| 60 from webkitpy.layout_tests.servers import pywebsocket | 60 from webkitpy.layout_tests.servers import pywebsocket |
| 61 from webkitpy.layout_tests.servers import wptserve | 61 from webkitpy.layout_tests.servers import wptserve |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 self._architecture = 'x86' | 165 self._architecture = 'x86' |
| 166 | 166 |
| 167 # FIXME: Ideally we'd have a package-wide way to get a | 167 # FIXME: Ideally we'd have a package-wide way to get a |
| 168 # well-formed options object that had all of the necessary | 168 # well-formed options object that had all of the necessary |
| 169 # options defined on it. | 169 # options defined on it. |
| 170 self._options = options or optparse.Values() | 170 self._options = options or optparse.Values() |
| 171 | 171 |
| 172 self.host = host | 172 self.host = host |
| 173 self._executive = host.executive | 173 self._executive = host.executive |
| 174 self._filesystem = host.filesystem | 174 self._filesystem = host.filesystem |
| 175 self._webkit_finder = WebKitFinder(host.filesystem) | 175 self._blink_finder = BlinkFinder(host.filesystem) |
| 176 | 176 |
| 177 self._http_server = None | 177 self._http_server = None |
| 178 self._websocket_server = None | 178 self._websocket_server = None |
| 179 self._is_wptserve_enabled = getattr(options, 'enable_wptserve', False) | 179 self._is_wptserve_enabled = getattr(options, 'enable_wptserve', False) |
| 180 self._wpt_server = None | 180 self._wpt_server = None |
| 181 self._image_differ = None | 181 self._image_differ = None |
| 182 self._server_process_constructor = server_process.ServerProcess # overr
idable for testing | 182 self._server_process_constructor = server_process.ServerProcess # overr
idable for testing |
| 183 self._http_lock = None # FIXME: Why does this live on the port object? | 183 self._http_lock = None # FIXME: Why does this live on the port object? |
| 184 self._dump_reader = None | 184 self._dump_reader = None |
| 185 | 185 |
| 186 # Python's Popen has a bug that causes any pipes opened to a | 186 # Python's Popen has a bug that causes any pipes opened to a |
| 187 # process that can't be executed to be leaked. Since this | 187 # process that can't be executed to be leaked. Since this |
| 188 # code is specifically designed to tolerate exec failures | 188 # code is specifically designed to tolerate exec failures |
| 189 # to gracefully handle cases where wdiff is not installed, | 189 # to gracefully handle cases where wdiff is not installed, |
| 190 # the bug results in a massive file descriptor leak. As a | 190 # the bug results in a massive file descriptor leak. As a |
| 191 # workaround, if an exec failure is ever experienced for | 191 # workaround, if an exec failure is ever experienced for |
| 192 # wdiff, assume it's not available. This will leak one | 192 # wdiff, assume it's not available. This will leak one |
| 193 # file descriptor but that's better than leaking each time | 193 # file descriptor but that's better than leaking each time |
| 194 # wdiff would be run. | 194 # wdiff would be run. |
| 195 # | 195 # |
| 196 # http://mail.python.org/pipermail/python-list/ | 196 # http://mail.python.org/pipermail/python-list/ |
| 197 # 2008-August/505753.html | 197 # 2008-August/505753.html |
| 198 # http://bugs.python.org/issue3210 | 198 # http://bugs.python.org/issue3210 |
| 199 self._wdiff_available = None | 199 self._wdiff_available = None |
| 200 | 200 |
| 201 # FIXME: prettypatch.py knows this path, why is it copied here? | 201 # FIXME: prettypatch.py knows this path, why is it copied here? |
| 202 self._pretty_patch_path = self.path_from_webkit_base("Tools", "Scripts",
"webkitruby", "PrettyPatch", "prettify.rb") | 202 self._pretty_patch_path = self.path_from_blink_base("Tools", "Scripts",
"webkitruby", "PrettyPatch", "prettify.rb") |
| 203 self._pretty_patch_available = None | 203 self._pretty_patch_available = None |
| 204 | 204 |
| 205 if not hasattr(options, 'configuration') or not options.configuration: | 205 if not hasattr(options, 'configuration') or not options.configuration: |
| 206 self.set_option_default('configuration', self.default_configuration(
)) | 206 self.set_option_default('configuration', self.default_configuration(
)) |
| 207 if not hasattr(options, 'target') or not options.target: | 207 if not hasattr(options, 'target') or not options.target: |
| 208 self.set_option_default('target', self._options.configuration) | 208 self.set_option_default('target', self._options.configuration) |
| 209 self._test_configuration = None | 209 self._test_configuration = None |
| 210 self._reftest_list = {} | 210 self._reftest_list = {} |
| 211 self._results_directory = None | 211 self._results_directory = None |
| 212 self._virtual_test_suites = None | 212 self._virtual_test_suites = None |
| (...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 940 | 940 |
| 941 Args: | 941 Args: |
| 942 baseline_path: the actual path to use for baseline, not the path to | 942 baseline_path: the actual path to use for baseline, not the path to |
| 943 the test. This function is used to update either generic or | 943 the test. This function is used to update either generic or |
| 944 platform-specific baselines, but we can't infer which here. | 944 platform-specific baselines, but we can't infer which here. |
| 945 data: contents of the baseline. | 945 data: contents of the baseline. |
| 946 """ | 946 """ |
| 947 self._filesystem.write_binary_file(baseline_path, data) | 947 self._filesystem.write_binary_file(baseline_path, data) |
| 948 | 948 |
| 949 # FIXME: update callers to create a finder and call it instead of these next
five routines (which should be protected). | 949 # FIXME: update callers to create a finder and call it instead of these next
five routines (which should be protected). |
| 950 def webkit_base(self): | 950 def blink_base(self): |
| 951 return self._webkit_finder.webkit_base() | 951 return self._blink_finder.blink_base() |
| 952 | 952 |
| 953 def path_from_webkit_base(self, *comps): | 953 def path_from_blink_base(self, *comps): |
| 954 return self._webkit_finder.path_from_webkit_base(*comps) | 954 return self._blink_finder.path_from_blink_base(*comps) |
| 955 | 955 |
| 956 def path_from_chromium_base(self, *comps): | 956 def path_from_chromium_base(self, *comps): |
| 957 return self._webkit_finder.path_from_chromium_base(*comps) | 957 return self._blink_finder.path_from_chromium_base(*comps) |
| 958 | 958 |
| 959 def path_to_script(self, script_name): | 959 def path_to_script(self, script_name): |
| 960 return self._webkit_finder.path_to_script(script_name) | 960 return self._blink_finder.path_to_script(script_name) |
| 961 | 961 |
| 962 def layout_tests_dir(self): | 962 def layout_tests_dir(self): |
| 963 custom_layout_tests_dir = self.get_option('layout_tests_directory') | 963 custom_layout_tests_dir = self.get_option('layout_tests_directory') |
| 964 if custom_layout_tests_dir: | 964 if custom_layout_tests_dir: |
| 965 return custom_layout_tests_dir | 965 return custom_layout_tests_dir |
| 966 return self._webkit_finder.layout_tests_dir() | 966 return self._blink_finder.layout_tests_dir() |
| 967 | 967 |
| 968 def perf_tests_dir(self): | 968 def perf_tests_dir(self): |
| 969 return self._webkit_finder.perf_tests_dir() | 969 return self._blink_finder.perf_tests_dir() |
| 970 | 970 |
| 971 def skipped_layout_tests(self, test_list): | 971 def skipped_layout_tests(self, test_list): |
| 972 """Returns tests skipped outside of the TestExpectations files.""" | 972 """Returns tests skipped outside of the TestExpectations files.""" |
| 973 return set(self._skipped_tests_for_unsupported_features(test_list)) | 973 return set(self._skipped_tests_for_unsupported_features(test_list)) |
| 974 | 974 |
| 975 def skips_test(self, test, generic_expectations, full_expectations): | 975 def skips_test(self, test, generic_expectations, full_expectations): |
| 976 """Checks whether the given test is skipped for this port. | 976 """Checks whether the given test is skipped for this port. |
| 977 | 977 |
| 978 This should return True if the test is skipped because the port | 978 This should return True if the test is skipped because the port |
| 979 runs smoke tests only, or because the test is skipped in a file like | 979 runs smoke tests only, or because the test is skipped in a file like |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1093 def bot_test_times_path(self): | 1093 def bot_test_times_path(self): |
| 1094 return self._build_path('webkit_test_times', 'bot_times_ms.json') | 1094 return self._build_path('webkit_test_times', 'bot_times_ms.json') |
| 1095 | 1095 |
| 1096 def perf_results_directory(self): | 1096 def perf_results_directory(self): |
| 1097 return self._build_path() | 1097 return self._build_path() |
| 1098 | 1098 |
| 1099 def inspector_build_directory(self): | 1099 def inspector_build_directory(self): |
| 1100 return self._build_path('resources', 'inspector') | 1100 return self._build_path('resources', 'inspector') |
| 1101 | 1101 |
| 1102 def inspector_debug_directory(self): | 1102 def inspector_debug_directory(self): |
| 1103 return self.path_from_webkit_base('Source', 'devtools', 'front_end') | 1103 return self.path_from_blink_base('Source', 'devtools', 'front_end') |
| 1104 | 1104 |
| 1105 def apache_config_directory(self): | 1105 def apache_config_directory(self): |
| 1106 return self.path_from_webkit_base('Tools', 'Scripts', 'apache_config') | 1106 return self.path_from_blink_base('Tools', 'Scripts', 'apache_config') |
| 1107 | 1107 |
| 1108 def default_results_directory(self): | 1108 def default_results_directory(self): |
| 1109 """Absolute path to the default place to store the test results.""" | 1109 """Absolute path to the default place to store the test results.""" |
| 1110 return self._build_path('layout-test-results') | 1110 return self._build_path('layout-test-results') |
| 1111 | 1111 |
| 1112 def setup_test_run(self): | 1112 def setup_test_run(self): |
| 1113 """Perform port-specific work at the beginning of a test run.""" | 1113 """Perform port-specific work at the beginning of a test run.""" |
| 1114 # Delete the disk cache if any to ensure a clean test run. | 1114 # Delete the disk cache if any to ensure a clean test run. |
| 1115 dump_render_tree_binary_path = self._path_to_driver() | 1115 dump_render_tree_binary_path = self._path_to_driver() |
| 1116 cachedir = self._filesystem.dirname(dump_render_tree_binary_path) | 1116 cachedir = self._filesystem.dirname(dump_render_tree_binary_path) |
| (...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1810 # This will fail if we don't have both a debug and release binary. | 1810 # This will fail if we don't have both a debug and release binary. |
| 1811 # That's fine because, in this case, we must already be running the | 1811 # That's fine because, in this case, we must already be running the |
| 1812 # most up-to-date one. | 1812 # most up-to-date one. |
| 1813 except OSError: | 1813 except OSError: |
| 1814 pass | 1814 pass |
| 1815 return True | 1815 return True |
| 1816 | 1816 |
| 1817 def _chromium_baseline_path(self, platform): | 1817 def _chromium_baseline_path(self, platform): |
| 1818 if platform is None: | 1818 if platform is None: |
| 1819 platform = self.name() | 1819 platform = self.name() |
| 1820 return self.path_from_webkit_base('LayoutTests', 'platform', platform) | 1820 return self.path_from_blink_base('LayoutTests', 'platform', platform) |
| 1821 | 1821 |
| 1822 | 1822 |
| 1823 class VirtualTestSuite(object): | 1823 class VirtualTestSuite(object): |
| 1824 | 1824 |
| 1825 def __init__(self, prefix=None, base=None, args=None, references_use_default
_args=False): | 1825 def __init__(self, prefix=None, base=None, args=None, references_use_default
_args=False): |
| 1826 assert base | 1826 assert base |
| 1827 assert args | 1827 assert args |
| 1828 assert '/' not in prefix, "Virtual test suites prefixes cannot contain /
's: %s" % prefix | 1828 assert '/' not in prefix, "Virtual test suites prefixes cannot contain /
's: %s" % prefix |
| 1829 self.name = 'virtual/' + prefix + '/' + base | 1829 self.name = 'virtual/' + prefix + '/' + base |
| 1830 self.base = base | 1830 self.base = base |
| 1831 self.args = args | 1831 self.args = args |
| 1832 self.reference_args = [] if references_use_default_args else args | 1832 self.reference_args = [] if references_use_default_args else args |
| 1833 self.tests = {} | 1833 self.tests = {} |
| 1834 | 1834 |
| 1835 def __repr__(self): | 1835 def __repr__(self): |
| 1836 return "VirtualTestSuite('%s', '%s', %s, %s)" % (self.name, self.base, s
elf.args, self.reference_args) | 1836 return "VirtualTestSuite('%s', '%s', %s, %s)" % (self.name, self.base, s
elf.args, self.reference_args) |
| 1837 | 1837 |
| 1838 | 1838 |
| 1839 class PhysicalTestSuite(object): | 1839 class PhysicalTestSuite(object): |
| 1840 | 1840 |
| 1841 def __init__(self, base, args, reference_args=None): | 1841 def __init__(self, base, args, reference_args=None): |
| 1842 self.name = base | 1842 self.name = base |
| 1843 self.base = base | 1843 self.base = base |
| 1844 self.args = args | 1844 self.args = args |
| 1845 self.reference_args = args if reference_args is None else reference_args | 1845 self.reference_args = args if reference_args is None else reference_args |
| 1846 self.tests = set() | 1846 self.tests = set() |
| 1847 | 1847 |
| 1848 def __repr__(self): | 1848 def __repr__(self): |
| 1849 return "PhysicalTestSuite('%s', '%s', %s, %s)" % (self.name, self.base,
self.args, self.reference_args) | 1849 return "PhysicalTestSuite('%s', '%s', %s, %s)" % (self.name, self.base,
self.args, self.reference_args) |
| OLD | NEW |