| Index: third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_parser_unittest.py
|
| diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_parser_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_parser_unittest.py
|
| index 0c8f415d3bfefdc975896029c09ee47ce0fd7f35..85e340d108632c295b7c7f9e97973e77cc5b7fed 100644
|
| --- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_parser_unittest.py
|
| +++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_parser_unittest.py
|
| @@ -28,10 +28,10 @@
|
| import os
|
| import unittest
|
|
|
| +from webkitpy.common.host_mock import MockHost
|
| from webkitpy.common.system.outputcapture import OutputCapture
|
| from webkitpy.w3c.test_parser import TestParser
|
|
|
| -
|
| class TestParserTest(unittest.TestCase):
|
|
|
| def test_analyze_test_reftest_one_match(self):
|
| @@ -40,7 +40,7 @@ class TestParserTest(unittest.TestCase):
|
| </head>
|
| """
|
| test_path = '/some/madeup/path/'
|
| - parser = TestParser(test_path + 'somefile.html')
|
| + parser = TestParser(test_path + 'somefile.html', MockHost())
|
| test_info = parser.analyze_test(test_contents=test_html)
|
|
|
| self.assertNotEqual(test_info, None, 'did not find a test')
|
| @@ -61,7 +61,7 @@ class TestParserTest(unittest.TestCase):
|
| oc.capture_output()
|
| try:
|
| test_path = '/some/madeup/path/'
|
| - parser = TestParser(test_path + 'somefile.html')
|
| + parser = TestParser(test_path + 'somefile.html', MockHost())
|
| test_info = parser.analyze_test(test_contents=test_html)
|
| finally:
|
| _, _, logs = oc.restore_output()
|
| @@ -87,7 +87,7 @@ class TestParserTest(unittest.TestCase):
|
|
|
| try:
|
| test_path = '/some/madeup/path/'
|
| - parser = TestParser(test_path + 'somefile.html')
|
| + parser = TestParser(test_path + 'somefile.html', MockHost())
|
| test_info = parser.analyze_test(test_contents=test_html)
|
| finally:
|
| _, _, logs = oc.restore_output()
|
| @@ -121,7 +121,7 @@ class TestParserTest(unittest.TestCase):
|
| </html>
|
| """
|
| test_path = '/some/madeup/path/'
|
| - parser = TestParser(test_path + 'somefile.html')
|
| + parser = TestParser(test_path + 'somefile.html', MockHost())
|
| test_info = parser.analyze_test(test_contents=test_html, ref_contents=ref_html)
|
|
|
| self.assertNotEqual(test_info, None, 'did not find a test')
|
| @@ -141,7 +141,7 @@ class TestParserTest(unittest.TestCase):
|
| </head>
|
| """
|
| test_path = '/some/madeup/path/'
|
| - parser = TestParser(test_path + 'somefile.html')
|
| + parser = TestParser(test_path + 'somefile.html', MockHost())
|
| test_info = parser.analyze_test(test_contents=test_html)
|
|
|
| self.assertNotEqual(test_info, None, 'test_info is None')
|
| @@ -170,7 +170,7 @@ CONTENT OF TEST
|
| options = {'all': True}
|
|
|
| test_path = '/some/madeup/path/'
|
| - parser = TestParser(test_path + 'somefile.html', options)
|
| + parser = TestParser(test_path + 'somefile.html', MockHost(), options)
|
| test_info = parser.analyze_test(test_contents=test_html)
|
|
|
| self.assertNotEqual(test_info, None, 'test_info is None')
|
| @@ -199,7 +199,7 @@ CONTENT OF TEST
|
| options = {'all': False}
|
|
|
| test_path = '/some/madeup/path/'
|
| - parser = TestParser(test_path + 'somefile.html', options)
|
| + parser = TestParser(test_path + 'somefile.html', MockHost(), options)
|
| test_info = parser.analyze_test(test_contents=test_html)
|
|
|
| self.assertEqual(test_info, None, 'test should have been skipped')
|
| @@ -207,6 +207,6 @@ CONTENT OF TEST
|
| def test_analyze_non_html_file(self):
|
| """ Tests analyze_test() with a file that has no html"""
|
| # FIXME: use a mock filesystem
|
| - parser = TestParser(os.path.join(os.path.dirname(__file__), 'test_parser.py'))
|
| + parser = TestParser(os.path.join(os.path.dirname(__file__), 'test_parser.py'), MockHost())
|
| test_info = parser.analyze_test()
|
| self.assertEqual(test_info, None, 'no tests should have been found in this file')
|
|
|