Skip to content

Commit

Permalink
Don't check for all-pass baseline files in platform and virtual.
Browse files Browse the repository at this point in the history
BUG=613387

Review-Url: https://codereview.chromium.org/2002513002
Cr-Commit-Position: refs/heads/master@{#395370}
  • Loading branch information
qyearsley authored and Commit bot committed May 23, 2016
1 parent a0aab25 commit 84044bf
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions third_party/WebKit/LayoutTests/PRESUBMIT.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@


def _CheckTestharnessResults(input_api, output_api):
expected_files = [f.AbsoluteLocalPath() for f in input_api.AffectedFiles() if f.LocalPath().endswith('-expected.txt') and f.Action() != 'D']
if len(expected_files) == 0:
"""Checks for testharness.js test baseline files that contain only PASS lines.
In general these files are unnecessary because for testharness.js tests, if there is
no baseline file then the test is considered to pass when the output is all PASS.
"""
baseline_files = _TestharnessBaselineFilesToCheck(input_api)
if not baseline_files:
return []

checker_path = input_api.os_path.join(input_api.PresubmitLocalPath(),
Expand All @@ -29,6 +34,27 @@ def _CheckTestharnessResults(input_api, output_api):
return []


def _TestharnessBaselineFilesToCheck(input_api):
"""Returns a list of paths of -expected.txt files for testharness.js tests."""
baseline_files = []
for f in input_api.AffectedFiles():
if f.Action() == 'D':
continue
path = f.AbsoluteLocalPath()
if not path.endswith('-expected.txt'):
continue
if (input_api.os_path.join('LayoutTests', 'platform') in path or
input_api.os_path.join('LayoutTests', 'virtual') in path):
# We want to ignore files in LayoutTests/platform, because some all-PASS
# platform specific baselines may be necessary to prevent fallback to a
# more general baseline; we also ignore files in LayoutTests/virtual
# for a similar reason; some all-pass baselines are necessary to
# prevent fallback to the corresponding non-virtual test baseline.
continue
baseline_files.append(path)
return baseline_files


def _CheckIdenticalFiles(input_api, output_api):
"""Verifies that certain files are identical in various locations.
These files should always be updated together."""
Expand Down

0 comments on commit 84044bf

Please sign in to comment.