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 | 4 |
5 import unittest | 5 import unittest |
6 | 6 |
7 from webkitpy.layout_tests.models import testharness_results | 7 from webkitpy.layout_tests.models import testharness_results |
8 | 8 |
9 | 9 |
10 class TestHarnessResultCheckerTest(unittest.TestCase): | 10 class TestHarnessResultCheckerTest(unittest.TestCase): |
(...skipping 12 matching lines...) Expand all Loading... |
23 def test_is_all_pass_testharness_result_negative_cases(self): | 23 def test_is_all_pass_testharness_result_negative_cases(self): |
24 self.assertFalse(testharness_results.is_all_pass_testharness_result( | 24 self.assertFalse(testharness_results.is_all_pass_testharness_result( |
25 'This is a testharness.js-based test.\n' | 25 'This is a testharness.js-based test.\n' |
26 'CONSOLE WARNING: This is a warning.\n' | 26 'CONSOLE WARNING: This is a warning.\n' |
27 'Test ran to completion.')) | 27 'Test ran to completion.')) |
28 self.assertFalse(testharness_results.is_all_pass_testharness_result( | 28 self.assertFalse(testharness_results.is_all_pass_testharness_result( |
29 'This is a testharness.js-based test.\n' | 29 'This is a testharness.js-based test.\n' |
30 ' PASS: foo bar \n' | 30 ' PASS: foo bar \n' |
31 'FAIL \n' | 31 'FAIL \n' |
32 ' Harness: the test ran to completion.')) | 32 ' Harness: the test ran to completion.')) |
33 self.assertFalse(testharness_results.is_all_pass_testharness_result( | |
34 'This is a testharness.js-based test.\n' | |
35 'Harness Error. harness_status.status = 1\n' | |
36 'PASS foo bar\n' | |
37 'Harness: the test ran to completion.')) | |
38 | 33 |
39 def test_is_testharness_output_positive_cases(self): | 34 def test_is_testharness_output_positive_cases(self): |
40 self.assertTrue(testharness_results.is_testharness_output( | 35 self.assertTrue(testharness_results.is_testharness_output( |
41 'This is a testharness.js-based test.\n' | 36 'This is a testharness.js-based test.\n' |
42 'Harness: the test ran to completion.')) | 37 'Harness: the test ran to completion.')) |
43 self.assertTrue(testharness_results.is_testharness_output( | 38 self.assertTrue(testharness_results.is_testharness_output( |
44 '\n' | 39 '\n' |
45 ' \r This is a testharness.js-based test. \n' | 40 ' \r This is a testharness.js-based test. \n' |
46 ' \r \n' | 41 ' \r \n' |
47 ' \rHarness: the test ran to completion. \n' | 42 ' \rHarness: the test ran to completion. \n' |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 self.assertFalse(testharness_results.has_console_errors_or_warnings( | 172 self.assertFalse(testharness_results.has_console_errors_or_warnings( |
178 'This is a testharness.js-based test.\n' | 173 'This is a testharness.js-based test.\n' |
179 'CONSOLE MESSAGE: This is not error.')) | 174 'CONSOLE MESSAGE: This is not error.')) |
180 self.assertFalse(testharness_results.has_console_errors_or_warnings( | 175 self.assertFalse(testharness_results.has_console_errors_or_warnings( |
181 'This is a testharness.js-based test.\n' | 176 'This is a testharness.js-based test.\n' |
182 'No errors here.')) | 177 'No errors here.')) |
183 self.assertFalse(testharness_results.has_console_errors_or_warnings( | 178 self.assertFalse(testharness_results.has_console_errors_or_warnings( |
184 'This is not a CONSOLE ERROR, sorry.')) | 179 'This is not a CONSOLE ERROR, sorry.')) |
185 self.assertFalse(testharness_results.has_console_errors_or_warnings( | 180 self.assertFalse(testharness_results.has_console_errors_or_warnings( |
186 'This is not a CONSOLE WARNING, sorry.')) | 181 'This is not a CONSOLE WARNING, sorry.')) |
OLD | NEW |