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

Side by Side Diff: Tools/Scripts/webkitpy/layout_tests/models/testharness_results_unittest.py

Issue 986393003: Allow expected.txt files in testharness LayoutTests with console errors (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed test failures Created 5 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 unified diff | Download patch
OLDNEW
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 26 matching lines...) Expand all
37 {'content': 'This is a testharness.js-based test.\n FAIL: bah \n Har ness: 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}, 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}, 39 {'content': 'This is a testharness.js-based test.\n NOTRUN: bah \n H arness: the test ran to completion.', 'result': False},
40 {'content': 'CONSOLE LOG: error.\nThis is a testharness.js-based tes t.\nPASS: things are fine.\nHarness: the test ran to completion.\n\n', 'result': True}, 40 {'content': 'CONSOLE LOG: error.\nThis is a testharness.js-based tes t.\nPASS: things are fine.\nHarness: the test ran to completion.\n\n', 'result': True},
41 {'content': 'CONSOLE ERROR: error.\nThis is a testharness.js-based t est.\nPASS: things are fine.\nHarness: the test ran to completion.\n\n', 'result ': True}, 41 {'content': 'CONSOLE ERROR: error.\nThis is a testharness.js-based t est.\nPASS: things are fine.\nHarness: the test ran to completion.\n\n', 'result ': True},
42 {'content': 'RANDOM TEXT.\nThis is a testharness.js-based test.\nPAS S: things are fine.\n.Harness: the test ran to completion.\n\n', 'result': False }, 42 {'content': 'RANDOM TEXT.\nThis is a testharness.js-based test.\nPAS S: things are fine.\n.Harness: the test ran to completion.\n\n', 'result': False },
43 ] 43 ]
44 44
45 for data in test_data: 45 for data in test_data:
46 self.assertEqual(data['result'], testharness_results.is_testharness_ output_passing(data['content'])) 46 self.assertEqual(data['result'], testharness_results.is_testharness_ output_passing(data['content']))
47
48 def test_is_testharness_output_with_console_errors(self):
49 test_data = [
50 {'content': 'This is a testharness.js-based test.\nCONSOLE ERROR: Th is is an error.\nTest ran to completion.', 'result': True},
51 {'content': 'CONSOLE ERROR: This is an error.\nTest ran to completio n.', 'result': True},
52 {'content': 'This is a testharness.js-based test.\nCONSOLE ERROR: Th is is an error.', 'result': True},
53 {'content': 'CONSOLE ERROR: This is an error.', 'result': True},
54 {'content': 'This is a testharness.js-based test.\nCONSOLE MESSAGE: This is not error.', 'result': False},
55 {'content': 'This is a testharness.js-based test.\nNo errors here.', 'result': False},
56 {'content': 'This is not a CONSOLE ERROR, sorry.', 'result': False},
57 ]
58
59 for data in test_data:
60 self.assertEqual(data['result'], testharness_results.is_testharness_ output_with_console_errors(data['content']))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698