| 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.')) |
| 33 | 38 |
| 34 def test_is_testharness_output_positive_cases(self): | 39 def test_is_testharness_output_positive_cases(self): |
| 35 self.assertTrue(testharness_results.is_testharness_output( | 40 self.assertTrue(testharness_results.is_testharness_output( |
| 36 'This is a testharness.js-based test.\n' | 41 'This is a testharness.js-based test.\n' |
| 37 'Harness: the test ran to completion.')) | 42 'Harness: the test ran to completion.')) |
| 38 self.assertTrue(testharness_results.is_testharness_output( | 43 self.assertTrue(testharness_results.is_testharness_output( |
| 39 '\n' | 44 '\n' |
| 40 ' \r This is a testharness.js-based test. \n' | 45 ' \r This is a testharness.js-based test. \n' |
| 41 ' \r \n' | 46 ' \r \n' |
| 42 ' \rHarness: the test ran to completion. \n' | 47 ' \rHarness: the test ran to completion. \n' |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 self.assertFalse(testharness_results.has_console_errors_or_warnings( | 177 self.assertFalse(testharness_results.has_console_errors_or_warnings( |
| 173 'This is a testharness.js-based test.\n' | 178 'This is a testharness.js-based test.\n' |
| 174 'CONSOLE MESSAGE: This is not error.')) | 179 'CONSOLE MESSAGE: This is not error.')) |
| 175 self.assertFalse(testharness_results.has_console_errors_or_warnings( | 180 self.assertFalse(testharness_results.has_console_errors_or_warnings( |
| 176 'This is a testharness.js-based test.\n' | 181 'This is a testharness.js-based test.\n' |
| 177 'No errors here.')) | 182 'No errors here.')) |
| 178 self.assertFalse(testharness_results.has_console_errors_or_warnings( | 183 self.assertFalse(testharness_results.has_console_errors_or_warnings( |
| 179 'This is not a CONSOLE ERROR, sorry.')) | 184 'This is not a CONSOLE ERROR, sorry.')) |
| 180 self.assertFalse(testharness_results.has_console_errors_or_warnings( | 185 self.assertFalse(testharness_results.has_console_errors_or_warnings( |
| 181 'This is not a CONSOLE WARNING, sorry.')) | 186 'This is not a CONSOLE WARNING, sorry.')) |
| OLD | NEW |