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

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/testharness_results.py

Issue 2704463003: Revert of Consider any testharness result with >= 1 PASS and no FAIL to be passing. (Closed)
Patch Set: Rebaseline Created 3 years, 10 months 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/testharness_results.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/testharness_results.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/testharness_results.py
index 8407b1d877a7ec8c49c4a3bd747139980af6e537..10994fb19b30a448300366b60ceed6426fb9f9d9 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/testharness_results.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/testharness_results.py
@@ -34,29 +34,47 @@ def is_testharness_output(content_text):
def is_testharness_output_passing(content_text):
- """Checks whether |content_text| is a passing testharness output.
+ """Returns whether |content_text| is a passing testharness output."""
- Under a relatively loose/accepting definition of passing
- testharness output, we consider any output with at least one
- PASS result and no FAIL result (or TIMEOUT or NOTRUN).
- """
- # Leading and trailing whitespace are ignored.
+ # Leading and trailing white spaces are accepted.
lines = content_text.strip().splitlines()
lines = [line.strip() for line in lines]
- at_least_one_pass = False
-
+ # The check is very conservative and rejects any unexpected content in the output.
+ previous_line_is_console_line = False
for line in lines:
+ # There should be no empty lines, unless the empty line follows a console message.
+ if len(line) == 0:
+ if previous_line_is_console_line:
+ continue
+ else:
+ return False
+
+ # Those lines are expected to be exactly equivalent.
+ if line == _TESTHARNESSREPORT_HEADER or line == _TESTHARNESSREPORT_FOOTER:
+ previous_line_is_console_line = False
+ continue
+
+ # Those are expected passing output.
+ if line.startswith('CONSOLE'):
+ previous_line_is_console_line = True
+ continue
+
if line.startswith('PASS'):
- at_least_one_pass = True
+ previous_line_is_console_line = False
continue
+
+ # Those are expected failing output.
if (line.startswith('FAIL') or
line.startswith('TIMEOUT') or
line.startswith('NOTRUN') or
line.startswith('Harness Error. harness_status = ')):
return False
- return at_least_one_pass
+ # Unexpected output should be considered as a failure.
+ return False
+
+ return True
def has_console_errors_or_warnings(content_text):

Powered by Google App Engine
This is Rietveld 408576698