OLD | NEW |
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 | |
5 """Utility module for testharness.""" | 4 """Utility module for testharness.""" |
6 | 5 |
7 | |
8 # const definitions | 6 # const definitions |
9 TESTHARNESSREPORT_HEADER = 'This is a testharness.js-based test.' | 7 TESTHARNESSREPORT_HEADER = 'This is a testharness.js-based test.' |
10 TESTHARNESSREPORT_FOOTER = 'Harness: the test ran to completion.' | 8 TESTHARNESSREPORT_FOOTER = 'Harness: the test ran to completion.' |
11 | 9 |
12 | 10 |
13 def is_testharness_output(content_text): | 11 def is_testharness_output(content_text): |
14 """ | 12 """ |
15 Returns whether the content_text in parameter is a testharness output. | 13 Returns whether the content_text in parameter is a testharness output. |
16 """ | 14 """ |
17 | 15 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 Note: | 87 Note: |
90 It is expected that the |content_text| is a testharness output. | 88 It is expected that the |content_text| is a testharness output. |
91 """ | 89 """ |
92 | 90 |
93 lines = content_text.strip().splitlines() | 91 lines = content_text.strip().splitlines() |
94 for line in lines: | 92 for line in lines: |
95 if line.startswith('CONSOLE ERROR:') or line.startswith('CONSOLE WARNING
:'): | 93 if line.startswith('CONSOLE ERROR:') or line.startswith('CONSOLE WARNING
:'): |
96 return True | 94 return True |
97 | 95 |
98 return False | 96 return False |
OLD | NEW |