webkit
2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
|
Static Public Member Functions | |
def | is_reference_html_file (filesystem, dirname, filename) |
Public Attributes | |
did_override_architecture | |
host | |
pretty_patch | |
Static Public Attributes | |
port_name = None | |
string | TEST_PATH_SEPARATOR = '/' |
tuple | ALL_BUILD_TYPES = ('debug', 'release') |
string | DEFAULT_ARCHITECTURE = 'x86' |
list | CUSTOM_DEVICE_CLASSES = [] |
Abstract class for Port-specific hooks for the layout_test package.
def webkitpy.port.base.Port.__init__ | ( | self, | |
host, | |||
port_name, | |||
options = None , |
|||
kwargs | |||
) |
def webkitpy.port.base.Port.abspath_for_test | ( | self, | |
test_name | |||
) |
Returns the full path to the file for a given test name. This is the inverse of relative_test_filename().
def webkitpy.port.base.Port.additional_drt_flag | ( | self | ) |
def webkitpy.port.base.Port.all_baseline_variants | ( | self | ) |
Returns a list of platform names sufficient to cover all the baselines. The list should be sorted so that a later platform will reuse an earlier platform's baselines if they are the same (e.g., 'snowleopard' should precede 'leopard').
def webkitpy.port.base.Port.all_test_configurations | ( | self | ) |
Returns a list of TestConfiguration instances, representing all available test configurations for this port.
def webkitpy.port.base.Port.allowed_hosts | ( | self | ) |
def webkitpy.port.base.Port.architecture | ( | self | ) |
def webkitpy.port.base.Port.baseline_extensions | ( | self | ) |
Returns a tuple of all of the non-reftest baseline extensions we use. The extensions include the leading '.'.
def webkitpy.port.base.Port.baseline_path | ( | self | ) |
Return the absolute path to the directory to store new baselines in for this port.
def webkitpy.port.base.Port.baseline_platform_dir | ( | self | ) |
Return the absolute path to the default (version-independent) platform-specific results.
def webkitpy.port.base.Port.baseline_search_path | ( | self | ) |
def webkitpy.port.base.Port.baseline_version_dir | ( | self | ) |
Return the absolute path to the platform-and-version-specific results.
def webkitpy.port.base.Port.bindings_results_directory | ( | self | ) |
def webkitpy.port.base.Port.check_build | ( | self, | |
needs_http | |||
) |
This routine is used to ensure that the build is up to date and all the needed binaries are present.
def webkitpy.port.base.Port.check_for_leaks | ( | self, | |
process_name, | |||
process_pid | |||
) |
def webkitpy.port.base.Port.check_httpd | ( | self | ) |
def webkitpy.port.base.Port.check_image_diff | ( | self, | |
override_step = None , |
|||
logging = True |
|||
) |
This routine is used to check whether image_diff binary exists.
def webkitpy.port.base.Port.check_sys_deps | ( | self, | |
needs_http | |||
) |
If the port needs to do some runtime checks to ensure that the tests can be run successfully, it should override this routine. This step can be skipped with --nocheck-sys-deps. Returns whether the system is properly configured.
def webkitpy.port.base.Port.clean_up_test_run | ( | self | ) |
Perform port-specific work at the end of a test run.
def webkitpy.port.base.Port.configuration_specifier_macros | ( | self | ) |
Ports may provide a way to abbreviate configuration specifiers to conveniently refer to them as one term or alias specific values to more generic ones. For example: (xp, vista, win7) -> win # Abbreviate all Windows versions into one namesake. (lucid) -> linux # Change specific name of the Linux distro to a more generic term. Returns a dictionary, each key representing a macro term ('win', for example), and value being a list of valid configuration specifiers (such as ['xp', 'vista', 'win7']).
def webkitpy.port.base.Port.create_driver | ( | self, | |
worker_number, | |||
no_timeout = False |
|||
) |
Return a newly created Driver subclass for starting/stopping the test driver.
def webkitpy.port.base.Port.default_baseline_search_path | ( | self | ) |
Return a list of absolute paths to directories to search under for baselines. The directories are searched in order.
def webkitpy.port.base.Port.default_child_processes | ( | self | ) |
Return the number of DumpRenderTree instances to use for this port.
def webkitpy.port.base.Port.default_configuration | ( | self | ) |
def webkitpy.port.base.Port.default_pixel_tests | ( | self | ) |
def webkitpy.port.base.Port.default_results_directory | ( | self | ) |
Absolute path to the default place to store the test results.
def webkitpy.port.base.Port.default_timeout_ms | ( | self | ) |
def webkitpy.port.base.Port.determine_full_port_name | ( | cls, | |
host, | |||
options, | |||
port_name | |||
) |
Return a fully-specified port name that can be used to construct objects.
def webkitpy.port.base.Port.diff_image | ( | self, | |
expected_contents, | |||
actual_contents, | |||
tolerance = None |
|||
) |
Compare two images and return a tuple of an image diff, a percentage difference (0-100), and an error string. |tolerance| should be a percentage value (0.0 - 100.0). If it is omitted, the port default tolerance value is used. If an error occurs (like ImageDiff isn't found, or crashes, we log an error and return True (for a diff).
def webkitpy.port.base.Port.diff_text | ( | self, | |
expected_text, | |||
actual_text, | |||
expected_filename, | |||
actual_filename | |||
) |
Returns a string containing the diff of the two text strings in 'unified diff' format.
def webkitpy.port.base.Port.do_audio_results_differ | ( | self, | |
expected_audio, | |||
actual_audio | |||
) |
def webkitpy.port.base.Port.do_text_results_differ | ( | self, | |
expected_text, | |||
actual_text | |||
) |
def webkitpy.port.base.Port.driver_cmd_line_for_logging | ( | self | ) |
Prints the DRT command line that will be used.
def webkitpy.port.base.Port.driver_name | ( | self | ) |
def webkitpy.port.base.Port.driver_stop_timeout | ( | self | ) |
Returns the amount of time in seconds to wait before killing the process in driver.stop().
def webkitpy.port.base.Port.exit_code_from_summarized_results | ( | self, | |
unexpected_results | |||
) |
Given summarized results, compute the exit code to be returned by new-run-webkit-tests. Bots turn red when this function returns a non-zero value. By default, return the number of regressions to avoid turning bots red by flaky failures, unexpected passes, and missing results
def webkitpy.port.base.Port.expectations_dict | ( | self | ) |
Returns an OrderedDict of name -> expectations strings. The names are expected to be (but not required to be) paths in the filesystem. If the name is a path, the file can be considered updatable for things like rebaselining, so don't use names that are paths if they're not paths. Generally speaking the ordering should be files in the filesystem in cascade order (TestExpectations followed by Skipped, if the port honors both formats), then any built-in expectations (e.g., from compile-time exclusions), then --additional-expectations options.
def webkitpy.port.base.Port.expectations_files | ( | self | ) |
def webkitpy.port.base.Port.expected_audio | ( | self, | |
test_name | |||
) |
def webkitpy.port.base.Port.expected_baselines | ( | self, | |
test_name, | |||
suffix, | |||
all_baselines = False |
|||
) |
Given a test name, finds where the baseline results are located. Args: test_name: name of test file (usually a relative path under LayoutTests/) suffix: file suffix of the expected results, including dot; e.g. '.txt' or '.png'. This should not be None, but may be an empty string. all_baselines: If True, return an ordered list of all baseline paths for the given platform. If False, return only the first one. Returns a list of ( platform_dir, results_filename ), where platform_dir - abs path to the top of the results tree (or test tree) results_filename - relative path from top of tree to the results file (port.join() of the two gives you the full path to the file, unless None was returned.) Return values will be in the format appropriate for the current platform (e.g., "\\" for path separators on Windows). If the results file is not found, then None will be returned for the directory, but the expected relative pathname will still be returned. This routine is generic but lives here since it is used in conjunction with the other baseline and filename routines that are platform specific.
def webkitpy.port.base.Port.expected_baselines_by_extension | ( | self, | |
test_name | |||
) |
Returns a dict mapping baseline suffix to relative path for each baseline in a test. For reftests, it returns ".==" or ".!=" instead of the suffix.
def webkitpy.port.base.Port.expected_checksum | ( | self, | |
test_name | |||
) |
Returns the checksum of the image we expect the test to produce, or None if it is a text-only test.
def webkitpy.port.base.Port.expected_filename | ( | self, | |
test_name, | |||
suffix, | |||
return_default = True |
|||
) |
Given a test name, returns an absolute path to its expected results. If no expected results are found in any of the searched directories, the directory in which the test itself is located will be returned. The return value is in the format appropriate for the platform (e.g., "\\" for path separators on windows). Args: test_name: name of test file (usually a relative path under LayoutTests/) suffix: file suffix of the expected results, including dot; e.g. '.txt' or '.png'. This should not be None, but may be an empty string. platform: the most-specific directory name to use to build the search list of directories; e.g. 'mountainlion-wk2' return_default: if True, returns the path to the generic expectation if nothing else is found; if False, returns None. This routine is generic but is implemented here to live alongside the other baseline and filename manipulation routines.
def webkitpy.port.base.Port.expected_image | ( | self, | |
test_name | |||
) |
Returns the image we expect the test to produce.
def webkitpy.port.base.Port.expected_text | ( | self, | |
test_name | |||
) |
Returns the text output we expect the test to produce, or None if we don't expect there to be any text output. End-of-line characters are normalized to '\n'.
def webkitpy.port.base.Port.find_system_pid | ( | self, | |
name, | |||
pid | |||
) |
def webkitpy.port.base.Port.get_option | ( | self, | |
name, | |||
default_value = None |
|||
) |
def webkitpy.port.base.Port.http_server_supports_ipv6 | ( | self | ) |
|
static |
def webkitpy.port.base.Port.is_w3c_resource_file | ( | self, | |
filesystem, | |||
dirname, | |||
filename | |||
) |
def webkitpy.port.base.Port.jsc_results_directory | ( | self | ) |
def webkitpy.port.base.Port.layout_tests_dir | ( | self | ) |
def webkitpy.port.base.Port.logging_patterns_to_strip | ( | self | ) |
def webkitpy.port.base.Port.look_for_new_crash_logs | ( | self, | |
crashed_processes, | |||
start_time | |||
) |
def webkitpy.port.base.Port.look_for_new_samples | ( | self, | |
unresponsive_processes, | |||
start_time | |||
) |
def webkitpy.port.base.Port.name | ( | self | ) |
Returns a name that uniquely identifies this particular type of port (e.g., "mac-snowleopard" or "chromium-linux-x86_x64" and can be passed to factory.get() to instantiate the port.
def webkitpy.port.base.Port.nm_command | ( | self | ) |
def webkitpy.port.base.Port.normalize_test_name | ( | self, | |
test_name | |||
) |
Returns a normalized version of the test name or test directory.
def webkitpy.port.base.Port.operating_system | ( | self | ) |
def webkitpy.port.base.Port.path_from_webkit_base | ( | self, | |
comps | |||
) |
def webkitpy.port.base.Port.path_to_generic_test_expectations_file | ( | self | ) |
def webkitpy.port.base.Port.path_to_script | ( | self, | |
script_name | |||
) |
def webkitpy.port.base.Port.path_to_test_expectations_file | ( | self | ) |
Update the test expectations to the passed-in string. This is used by the rebaselining tool. Raises NotImplementedError if the port does not use expectations files.
def webkitpy.port.base.Port.perf_results_directory | ( | self | ) |
def webkitpy.port.base.Port.perf_tests_dir | ( | self | ) |
def webkitpy.port.base.Port.potential_test_names_from_expected_file | ( | self, | |
path | |||
) |
Return potential test names if any from a potential expected file path, relative to LayoutTests directory.
def webkitpy.port.base.Port.print_leaks_summary | ( | self | ) |
def webkitpy.port.base.Port.python_unittest_results_directory | ( | self | ) |
def webkitpy.port.base.Port.reference_files | ( | self, | |
test_name | |||
) |
Return a list of expectation (== or !=) and filename pairs
def webkitpy.port.base.Port.relative_test_filename | ( | self, | |
filename | |||
) |
Returns a test_name a relative unix-style path for a filename under the LayoutTests directory. Ports may legitimately return abspaths here if no relpath makes sense.
def webkitpy.port.base.Port.repository_paths | ( | self | ) |
Returns a list of (repository_name, repository_path) tuples of its depending code base. By default it returns a list that only contains a ('WebKit', <webkitRepositoryPath>) tuple.
def webkitpy.port.base.Port.reset_preferences | ( | self | ) |
If a port needs to reset platform-specific persistent preference storage, it should override this method.
def webkitpy.port.base.Port.results_directory | ( | self | ) |
Absolute path to the place to store the test results (uses --results-directory).
def webkitpy.port.base.Port.sample_process | ( | self, | |
name, | |||
pid | |||
) |
def webkitpy.port.base.Port.set_architecture | ( | self, | |
arch | |||
) |
def webkitpy.port.base.Port.set_option | ( | self, | |
name, | |||
value | |||
) |
def webkitpy.port.base.Port.set_option_default | ( | self, | |
name, | |||
default_value | |||
) |
def webkitpy.port.base.Port.setup_environ_for_server | ( | self, | |
server_name = None |
|||
) |
def webkitpy.port.base.Port.setup_test_run | ( | self, | |
device_class = None |
|||
) |
Perform port-specific work at the beginning of a test run.
def webkitpy.port.base.Port.should_retry_crashes | ( | self | ) |
def webkitpy.port.base.Port.should_run_as_pixel_test | ( | self, | |
test_input | |||
) |
def webkitpy.port.base.Port.show_results_html_file | ( | self, | |
results_filename | |||
) |
This routine should display the HTML file pointed at by results_filename in a users' browser.
def webkitpy.port.base.Port.skipped_layout_tests | ( | self, | |
test_list | |||
) |
Returns tests skipped outside of the TestExpectations files.
def webkitpy.port.base.Port.skipped_perf_tests | ( | self | ) |
def webkitpy.port.base.Port.skips_perf_test | ( | self, | |
test_name | |||
) |
def webkitpy.port.base.Port.split_test | ( | self, | |
test_name | |||
) |
Splits a test name into the 'directory' part and the 'basename' part.
def webkitpy.port.base.Port.start_helper | ( | self, | |
pixel_tests = False |
|||
) |
If a port needs to reconfigure graphics settings or do other things to ensure a known test configuration, it should override this method.
def webkitpy.port.base.Port.start_http_server | ( | self, | |
additional_dirs = None |
|||
) |
Start a web server. Raise an error if it can't start or is already running. Ports can stub this out if they don't need a web server to be running.
def webkitpy.port.base.Port.start_web_platform_test_server | ( | self, | |
additional_dirs = None , |
|||
number_of_servers = None |
|||
) |
def webkitpy.port.base.Port.start_websocket_server | ( | self | ) |
Start a web server. Raise an error if it can't start or is already running. Ports can stub this out if they don't need a websocket server to be running.
def webkitpy.port.base.Port.stderr_patterns_to_strip | ( | self | ) |
def webkitpy.port.base.Port.stop_helper | ( | self | ) |
Shut down the test helper if it is running. Do nothing if it isn't, or it isn't available. If a port overrides start_helper() it must override this routine as well.
def webkitpy.port.base.Port.stop_http_server | ( | self | ) |
Shut down the http server if it is running. Do nothing if it isn't.
def webkitpy.port.base.Port.stop_web_platform_test_server | ( | self | ) |
def webkitpy.port.base.Port.stop_websocket_server | ( | self | ) |
Shut down the websocket server if it is running. Do nothing if it isn't.
def webkitpy.port.base.Port.supports_per_test_timeout | ( | self | ) |
def webkitpy.port.base.Port.test_configuration | ( | self | ) |
Returns the current TestConfiguration for the port.
def webkitpy.port.base.Port.test_dirs | ( | self | ) |
Returns the list of top-level test directories.
def webkitpy.port.base.Port.test_exists | ( | self, | |
test_name | |||
) |
Return True if the test name refers to an existing test or baseline.
def webkitpy.port.base.Port.test_expectations_file_position | ( | self | ) |
def webkitpy.port.base.Port.test_isdir | ( | self, | |
test_name | |||
) |
Return True if the test name refers to a directory of tests.
def webkitpy.port.base.Port.test_isfile | ( | self, | |
test_name | |||
) |
Return True if the test name refers to a directory of tests.
def webkitpy.port.base.Port.test_key | ( | self, | |
test_name | |||
) |
Turns a test name into a list with two sublists, the natural key of the dirname, and the natural key of the basename. This can be used when sorting paths so that files in a directory. directory are kept together rather than being mixed in with files in subdirectories.
def webkitpy.port.base.Port.test_search_path | ( | self | ) |
def webkitpy.port.base.Port.tests | ( | self, | |
paths | |||
) |
Return the list of tests found. Both generic and platform-specific tests matching paths should be returned.
def webkitpy.port.base.Port.update_baseline | ( | self, | |
baseline_path, | |||
data | |||
) |
Updates the baseline for a test. Args: baseline_path: the actual path to use for baseline, not the path to the test. This function is used to update either generic or platform-specific baselines, but we can't infer which here. data: contents of the baseline.
def webkitpy.port.base.Port.uses_test_expectations_file | ( | self | ) |
def webkitpy.port.base.Port.version | ( | self | ) |
Returns a string indicating the version of a given platform, e.g. 'leopard' or 'xp'. This is used to help identify the exact port when parsing test expectations, determining search paths, and logging information.
def webkitpy.port.base.Port.warn_if_bug_missing_in_test_expectations | ( | self | ) |
def webkitpy.port.base.Port.web_platform_test_server_base_url | ( | self | ) |
def webkitpy.port.base.Port.web_platform_test_server_doc_root | ( | self | ) |
def webkitpy.port.base.Port.webkit_base | ( | self | ) |
def webkitpy.port.base.Port.worker_startup_delay_secs | ( | self | ) |
|
static |
|
static |
|
static |
webkitpy.port.base.Port.did_override_architecture |
webkitpy.port.base.Port.host |
|
static |
webkitpy.port.base.Port.pretty_patch |
|
static |