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

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

Issue 1885703003: Make testharness.js tests fail on uncaught exceptions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Recover script changes Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Utility module for testharness.""" 5 """Utility module for testharness."""
6 6
7 7
8 # const definitions 8 # const definitions
9 TESTHARNESSREPORT_HEADER = 'This is a testharness.js-based test.' 9 TESTHARNESSREPORT_HEADER = 'This is a testharness.js-based test.'
10 TESTHARNESSREPORT_FOOTER = 'Harness: the test ran to completion.' 10 TESTHARNESSREPORT_FOOTER = 'Harness: the test ran to completion.'
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 line.startswith('NOTRUN') or \ 74 line.startswith('NOTRUN') or \
75 line.startswith('Harness Error. harness_status = '): 75 line.startswith('Harness Error. harness_status = '):
76 return False 76 return False
77 77
78 # Unexpected output should be considered as a failure. 78 # Unexpected output should be considered as a failure.
79 return False 79 return False
80 80
81 return True 81 return True
82 82
83 83
84 def is_testharness_output_with_console_errors_or_warnings(content_text): 84 def is_testharness_output_with_console_errors(content_text):
85 """ 85 """
86 Returns whether the content_text in parameter is a testharness output with 86 Returns whether the content_text in parameter is a testharness output with
87 console errors. 87 console errors.
88 88
89 Note: 89 Note:
90 It is expected that the |content_text| is a testharness output. 90 It is expected that the |content_text| is a testharness output.
91 """ 91 """
92 92
93 lines = content_text.strip().splitlines() 93 lines = content_text.strip().splitlines()
94 for line in lines: 94 for line in lines:
95 if line.startswith('CONSOLE ERROR:') or line.startswith('CONSOLE WARNING :'): 95 if line.startswith('CONSOLE ERROR:'):
96 return True 96 return True
97 97
98 return False 98 return False
99
100
101 def is_testharness_output_with_console_warnings(content_text):
102 """
103 Returns whether the content_text in parameter is a testharness output with
104 console warnings.
105
106 Note:
107 It is expected that the |content_text| is a testharness output.
108 """
109
110 lines = content_text.strip().splitlines()
111 for line in lines:
112 if line.startswith('CONSOLE WARNING:'):
113 return True
114
115 return False
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698