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

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

Issue 332583002: Add PRESUBMIT checks for not required testharness expected files. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix imports Created 6 years, 3 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
(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 unittest
6
7 from webkitpy.layout_tests.models import testharness_results
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.\n\n\n', 'result': True},
23 ]
24
25 for data in test_data:
26 self.assertEqual(data['result'], testharness_results.is_testharness_ 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 {'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},
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 ]
44
45 for data in test_data:
46 self.assertEqual(data['result'], testharness_results.is_testharness_ output_passing(data['content']))
OLDNEW
« no previous file with comments | « Tools/Scripts/webkitpy/layout_tests/models/testharness_results.py ('k') | Tools/Scripts/webkitpy/layout_tests/port/test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698