Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1573)

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/testharness_results_unittest.py

Issue 1806393002: Run yapf on files in webkit/layout_tests/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 eed47b0ba5090dcc2f477930fef1c0d38a13c720..27f617d38bb2e57604441e6c21ced56fdea2cbac 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
@@ -8,18 +8,26 @@ from webkitpy.layout_tests.models import testharness_results
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:
@@ -27,21 +35,40 @@ 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.\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},
]
for data in test_data:
@@ -49,18 +76,30 @@ 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:
- self.assertEqual(data['result'], testharness_results.is_testharness_output_with_console_errors_or_warnings(data['content']))
+ self.assertEqual(data['result'],
+ testharness_results.is_testharness_output_with_console_errors_or_warnings(data['content']))

Powered by Google App Engine
This is Rietveld 408576698