| Index: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/testharness_results_unittest.py
|
| diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/testharness_results_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/testharness_results_unittest.py
|
| index a05752ac5dfa10f287c23994bfec1d726ce200c4..160f09174483d517773e19fb41e1e2e5c513ef89 100644
|
| --- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/testharness_results_unittest.py
|
| +++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/testharness_results_unittest.py
|
| @@ -11,17 +11,42 @@ class TestHarnessResultCheckerTest(unittest.TestCase):
|
|
|
| def test_is_testharness_output(self):
|
| test_data = [
|
| - {'content': 'foo', 'result': False},
|
| - {'content': '', 'result': False},
|
| - {'content': ' ', 'result': False},
|
| - {'content': 'This is a testharness.js-based test.\nHarness: the test ran to completion.', 'result': True},
|
| - {'content': '\n \r This is a testharness.js-based test. \n \r \n \rHarness: the test ran to completion. \n\n',
|
| - 'result': True},
|
| - {'content': ' This \nis a testharness.js-based test.\nHarness: the test ran to completion.', 'result': False},
|
| - {'content': 'This is a testharness.js-based test. Harness: the test ran to completion.', 'result': False},
|
| - {'content': 'This is a testharness.js-based test.\nFoo bar \n Harness: the test ran to completion.', 'result': True},
|
| - {'content': 'This is a testharness.js-based test.\nFAIL: bah \n Harness: the test ran to completion.\n\n\n',
|
| - 'result': True},
|
| + {
|
| + 'content': 'foo',
|
| + 'result': False
|
| + },
|
| + {
|
| + 'content': '',
|
| + 'result': False
|
| + },
|
| + {
|
| + 'content': ' ',
|
| + 'result': False
|
| + },
|
| + {
|
| + 'content': 'This is a testharness.js-based test.\nHarness: the test ran to completion.',
|
| + 'result': True
|
| + },
|
| + {
|
| + 'content': '\n \r This is a testharness.js-based test. \n \r \n \rHarness: the test ran to completion. \n\n',
|
| + 'result': True
|
| + },
|
| + {
|
| + 'content': ' This \nis a testharness.js-based test.\nHarness: the test ran to completion.',
|
| + 'result': False
|
| + },
|
| + {
|
| + 'content': 'This is a testharness.js-based test. Harness: the test ran to completion.',
|
| + 'result': False
|
| + },
|
| + {
|
| + 'content': 'This is a testharness.js-based test.\nFoo bar \n Harness: the test ran to completion.',
|
| + 'result': True
|
| + },
|
| + {
|
| + 'content': 'This is a testharness.js-based test.\nFAIL: bah \n Harness: the test ran to completion.\n\n\n',
|
| + 'result': True
|
| + },
|
| ]
|
|
|
| for data in test_data:
|
| @@ -29,33 +54,70 @@ class TestHarnessResultCheckerTest(unittest.TestCase):
|
|
|
| def test_is_testharness_output_passing(self):
|
| test_data = [
|
| - {'content': 'This is a testharness.js-based test.\n Harness: the test ran to completion.', 'result': True},
|
| - {'content': 'This is a testharness.js-based test.\n \n Harness: the test ran to completion.', 'result': False},
|
| - {'content': 'This is a testharness.js-based test.\n PASS: foo bar \n Harness: the test ran to completion.',
|
| - 'result': True},
|
| - {'content': 'This is a testharness.js-based test.\n PASS: foo bar FAIL \n Harness: the test ran to completion.',
|
| - 'result': True},
|
| - {'content': 'This is a testharness.js-based test.\n PASS: foo bar \nFAIL \n Harness: the test ran to completion.',
|
| - 'result': False},
|
| - {'content': 'This is a testharness.js-based test.\n CONSOLE ERROR: BLAH \n Harness: the test ran to completion.',
|
| - 'result': True},
|
| - {'content': 'This is a testharness.js-based test.\n CONSOLE WARNING: BLAH \n Harness: the test ran to completion.',
|
| - 'result': True},
|
| - {'content': 'This is a testharness.js-based test.\n Foo bar \n Harness: the test ran to completion.', 'result': False},
|
| - {'content': 'This is a testharness.js-based test.\n FAIL: bah \n Harness: the test ran to completion.',
|
| - 'result': False},
|
| - {'content': 'This is a testharness.js-based test.\n TIMEOUT: bah \n Harness: the test ran to completion.',
|
| - 'result': False},
|
| - {'content': 'This is a testharness.js-based test.\n NOTRUN: bah \n Harness: the test ran to completion.',
|
| - 'result': False},
|
| - {'content': 'CONSOLE LOG: error.\nThis is a testharness.js-based test.\nPASS: things are fine.\nHarness: the test ran to completion.\n\n',
|
| - 'result': True},
|
| - {'content': 'CONSOLE ERROR: error.\nThis is a testharness.js-based test.\nPASS: things are fine.\nHarness: the test ran to completion.\n\n',
|
| - 'result': True},
|
| - {'content': 'CONSOLE WARNING: error.\nThis is a testharness.js-based test.\nPASS: things are fine.\nHarness: the test ran to completion.\n\n',
|
| - 'result': True},
|
| - {'content': 'RANDOM TEXT.\nThis is a testharness.js-based test.\nPASS: things are fine.\n.Harness: the test ran to completion.\n\n',
|
| - 'result': False},
|
| + {
|
| + 'content': 'This is a testharness.js-based test.\n Harness: the test ran to completion.',
|
| + 'result': True
|
| + },
|
| + {
|
| + 'content': 'This is a testharness.js-based test.\n \n Harness: the test ran to completion.',
|
| + 'result': False
|
| + },
|
| + {
|
| + 'content': 'This is a testharness.js-based test.\n PASS: foo bar \n Harness: the test ran to completion.',
|
| + 'result': True
|
| + },
|
| + {
|
| + 'content': 'This is a testharness.js-based test.\n PASS: foo bar FAIL \n Harness: the test ran to completion.',
|
| + 'result': True
|
| + },
|
| + {
|
| + 'content': 'This is a testharness.js-based test.\n PASS: foo bar \nFAIL \n Harness: the test ran to completion.',
|
| + 'result': False
|
| + },
|
| + {
|
| + 'content': 'This is a testharness.js-based test.\n CONSOLE ERROR: BLAH \n Harness: the test ran to completion.',
|
| + 'result': True
|
| + },
|
| + {
|
| + 'content': 'This is a testharness.js-based test.\n CONSOLE WARNING: BLAH \n Harness: the test ran to completion.',
|
| + 'result': True
|
| + },
|
| + {
|
| + 'content': 'This is a testharness.js-based test.\n Foo bar \n Harness: the test ran to completion.',
|
| + 'result': False
|
| + },
|
| + {
|
| + 'content': 'This is a testharness.js-based test.\n FAIL: bah \n Harness: the test ran to completion.',
|
| + 'result': False
|
| + },
|
| + {
|
| + 'content': 'This is a testharness.js-based test.\n TIMEOUT: bah \n Harness: the test ran to completion.',
|
| + 'result': False
|
| + },
|
| + {
|
| + 'content': 'This is a testharness.js-based test.\n NOTRUN: bah \n Harness: the test ran to completion.',
|
| + 'result': False
|
| + },
|
| + {
|
| + 'content': ('CONSOLE LOG: error.\nThis is a testharness.js-based test.\n'
|
| + 'PASS: things are fine.\nHarness: the test ran to completion.\n\n'),
|
| + 'result': True
|
| + },
|
| + {
|
| + 'content': ('CONSOLE ERROR: error.\nThis is a testharness.js-based test.\n'
|
| + 'PASS: things are fine.\nHarness: the test ran to completion.\n\n'),
|
| + 'result': True
|
| + },
|
| + {
|
| + 'content': ('CONSOLE WARNING: error.\nThis is a testharness.js-based test.\n'
|
| + 'PASS: things are fine.\nHarness: the test ran to completion.\n\n'),
|
| + 'result': True
|
| + },
|
| + {
|
| + 'content': ('RANDOM TEXT.\nThis is a testharness.js-based test.\n'
|
| + 'PASS: things are fine.\n.Harness: the test ran to completion.\n\n'),
|
| + 'result': False
|
| + },
|
| ]
|
|
|
| for data in test_data:
|
| @@ -63,19 +125,50 @@ class TestHarnessResultCheckerTest(unittest.TestCase):
|
|
|
| def test_is_testharness_output_with_console_errors_and_warnings(self):
|
| test_data = [
|
| - {'content': 'This is a testharness.js-based test.\nCONSOLE ERROR: This is an error.\nTest ran to completion.',
|
| - 'result': True},
|
| - {'content': 'This is a testharness.js-based test.\nCONSOLE WARNING: This is a warning.\nTest ran to completion.',
|
| - 'result': True},
|
| - {'content': 'CONSOLE ERROR: This is an error.\nTest ran to completion.', 'result': True},
|
| - {'content': 'CONSOLE WARNING: This is a warning.\nTest ran to completion.', 'result': True},
|
| - {'content': 'This is a testharness.js-based test.\nCONSOLE ERROR: This is an error.', 'result': True},
|
| - {'content': 'CONSOLE ERROR: This is an error.', 'result': True},
|
| - {'content': 'CONSOLE WARNING: This is a warning.', 'result': True},
|
| - {'content': 'This is a testharness.js-based test.\nCONSOLE MESSAGE: This is not error.', 'result': False},
|
| - {'content': 'This is a testharness.js-based test.\nNo errors here.', 'result': False},
|
| - {'content': 'This is not a CONSOLE ERROR, sorry.', 'result': False},
|
| - {'content': 'This is not a CONSOLE WARNING, sorry.', 'result': False},
|
| + {
|
| + 'content': 'This is a testharness.js-based test.\nCONSOLE ERROR: This is an error.\nTest ran to completion.',
|
| + 'result': True
|
| + },
|
| + {
|
| + 'content': 'This is a testharness.js-based test.\nCONSOLE WARNING: This is a warning.\nTest ran to completion.',
|
| + 'result': True
|
| + },
|
| + {
|
| + 'content': 'CONSOLE ERROR: This is an error.\nTest ran to completion.',
|
| + 'result': True
|
| + },
|
| + {
|
| + 'content': 'CONSOLE WARNING: This is a warning.\nTest ran to completion.',
|
| + 'result': True
|
| + },
|
| + {
|
| + 'content': 'This is a testharness.js-based test.\nCONSOLE ERROR: This is an error.',
|
| + 'result': True
|
| + },
|
| + {
|
| + 'content': 'CONSOLE ERROR: This is an error.',
|
| + 'result': True
|
| + },
|
| + {
|
| + 'content': 'CONSOLE WARNING: This is a warning.',
|
| + 'result': True
|
| + },
|
| + {
|
| + 'content': 'This is a testharness.js-based test.\nCONSOLE MESSAGE: This is not error.',
|
| + 'result': False
|
| + },
|
| + {
|
| + 'content': 'This is a testharness.js-based test.\nNo errors here.',
|
| + 'result': False
|
| + },
|
| + {
|
| + 'content': 'This is not a CONSOLE ERROR, sorry.',
|
| + 'result': False
|
| + },
|
| + {
|
| + 'content': 'This is not a CONSOLE WARNING, sorry.',
|
| + 'result': False
|
| + },
|
| ]
|
|
|
| for data in test_data:
|
|
|