OLD | NEW |
(Empty) | |
| 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 |
| 3 # found in the LICENSE file. |
| 4 |
| 5 import webkitpy.thirdparty.unittest2 as unittest |
| 6 |
| 7 from webkitpy.layout_tests.testharness import testharness_results_checker |
| 8 |
| 9 |
| 10 class TestHarnessResultCheckerTest(unittest.TestCase): |
| 11 |
| 12 def test_is_testharness_output(self): |
| 13 test_data = [ |
| 14 {'content': 'foo', 'result': False}, |
| 15 {'content': '', 'result': False}, |
| 16 {'content': ' ', 'result': False}, |
| 17 {'content': 'This is a testharness.js-based test.\nHarness: the test
ran to completion.', 'result': True}, |
| 18 {'content': '\n \r This is a testharness.js-based test. \n \r \n \r
Harness: the test ran to completion. \n\n', 'result': True}, |
| 19 {'content': ' This \nis a testharness.js-based test.\nHarness:
the test ran to completion.', 'result': False}, |
| 20 {'content': 'This is a testharness.js-based test. Harness: the test
ran to completion.', 'result': False}, |
| 21 {'content': 'This is a testharness.js-based test.\nFoo bar \n Harnes
s: the test ran to completion.', 'result': True}, |
| 22 {'content': 'This is a testharness.js-based test.\nFAIL: bah \n Harn
ess: the test ran to completion.', 'result': True}, |
| 23 ] |
| 24 |
| 25 for data in test_data: |
| 26 self.assertEqual(data['result'], testharness_results_checker.is_test
harness_output(data['content'])) |
| 27 |
| 28 def test_is_testharness_output_passing(self): |
| 29 test_data = [ |
| 30 {'content': 'This is a testharness.js-based test.\n Harness: the t
est ran to completion.', 'result': True}, |
| 31 {'content': 'This is a testharness.js-based test.\n \n Harness: the
test ran to completion.', 'result': False}, |
| 32 {'content': 'This is a testharness.js-based test.\n PASS: foo bar \n
Harness: the test ran to completion.', 'result': True}, |
| 33 {'content': 'This is a testharness.js-based test.\n PASS: foo bar FA
IL \n Harness: the test ran to completion.', 'result': True}, |
| 34 {'content': 'This is a testharness.js-based test.\n PASS: foo bar \n
FAIL \n Harness: the test ran to completion.', 'result': False}, |
| 35 {'content': 'This is a testharness.js-based test.\n CONSOLE ERROR: B
LAH \n Harness: the test ran to completion.', 'result': True}, |
| 36 {'content': 'This is a testharness.js-based test.\n Foo bar \n Harne
ss: the test ran to completion.', 'result': False}, |
| 37 {'content': 'This is a testharness.js-based test.\n FAIL: bah \n Har
ness: the test ran to completion.', 'result': False}, |
| 38 {'content': 'This is a testharness.js-based test.\n TIMEOUT: bah \n
Harness: the test ran to completion.', 'result': False}, |
| 39 {'content': 'This is a testharness.js-based test.\n NOTRUN: bah \n H
arness: the test ran to completion.', 'result': False}, |
| 40 ] |
| 41 |
| 42 for data in test_data: |
| 43 self.assertEqual(data['result'], testharness_results_checker.is_test
harness_output_passing(data['content'])) |
OLD | NEW |