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

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_parser_unittest.py

Issue 2206433002: Pass Host object into test_parser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_parser.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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')
« no previous file with comments | « third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_parser.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698