Index: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/mock_drt_unittest.py |
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/mock_drt_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/mock_drt_unittest.py |
index 87d396373fba428680347472fe6b3e21115301e0..b93e456254ec31cda06b54d552d2f403b44754c0 100644 |
--- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/mock_drt_unittest.py |
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/mock_drt_unittest.py |
@@ -25,7 +25,6 @@ |
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
- |
"""Unit tests for MockDRT.""" |
import io |
@@ -39,12 +38,10 @@ from webkitpy.layout_tests.port import test |
from webkitpy.layout_tests.port.factory import PortFactory |
from webkitpy.tool import mocktool |
- |
mock_options = mocktool.MockOptions(configuration='Release') |
class MockDRTPortTest(port_testcase.PortTestCase): |
- |
def make_port(self, host=None, options=mock_options): |
host = host or MockSystemHost() |
test.add_unit_tests_to_mock_filesystem(host.filesystem) |
@@ -95,8 +92,7 @@ class MockDRTTest(unittest.TestCase): |
def make_drt(self, options, args, host, stdin, stdout, stderr): |
return mock_drt.MockDRT(options, args, host, stdin, stdout, stderr) |
- def make_input_output(self, port, test_name, pixel_tests, |
- expected_checksum, drt_output, drt_input=None, expected_text=None): |
+ def make_input_output(self, port, test_name, pixel_tests, expected_checksum, drt_output, drt_input=None, expected_text=None): |
if pixel_tests: |
if not expected_checksum: |
expected_checksum = port.expected_checksum(test_name) |
@@ -105,8 +101,7 @@ class MockDRTTest(unittest.TestCase): |
text_output = expected_text or port.expected_text(test_name) or '' |
if not drt_output: |
- drt_output = self.expected_output(port, test_name, pixel_tests, |
- text_output, expected_checksum) |
+ drt_output = self.expected_output(port, test_name, pixel_tests, text_output, expected_checksum) |
return (drt_input, drt_output) |
def expected_output(self, port, test_name, pixel_tests, text_output, expected_checksum): |
@@ -115,9 +110,7 @@ class MockDRTTest(unittest.TestCase): |
output.append(text_output) |
output.append('#EOF\n') |
if pixel_tests and expected_checksum: |
- output.extend(['\n', |
- 'ActualHash: %s\n' % expected_checksum, |
- 'ExpectedHash: %s\n' % expected_checksum]) |
+ output.extend(['\n', 'ActualHash: %s\n' % expected_checksum, 'ExpectedHash: %s\n' % expected_checksum]) |
output.append('#EOF\n') |
return output |
@@ -126,8 +119,13 @@ class MockDRTTest(unittest.TestCase): |
host = host or MockSystemHost() |
test.add_unit_tests_to_mock_filesystem(host.filesystem) |
port = PortFactory(host).get(port_name) |
- drt_input, drt_output = self.make_input_output(port, test_name, |
- pixel_tests, expected_checksum, drt_output, drt_input=None, expected_text=expected_text) |
+ drt_input, drt_output = self.make_input_output(port, |
+ test_name, |
+ pixel_tests, |
+ expected_checksum, |
+ drt_output, |
+ drt_input=None, |
+ expected_text=expected_text) |
args = ['--run-layout-test', '--platform', port_name, '-'] |
stdin = io.BytesIO(drt_input) |
@@ -149,8 +147,7 @@ class MockDRTTest(unittest.TestCase): |
stdin = io.BytesIO() |
stdout = io.BytesIO() |
stderr = io.BytesIO() |
- res = mock_drt.main(['--run-layout-test', '--platform', 'test', '-'], |
- host, stdin, stdout, stderr) |
+ res = mock_drt.main(['--run-layout-test', '--platform', 'test', '-'], host, stdin, stdout, stderr) |
self.assertEqual(res, 0) |
self.assertEqual(stdout.getvalue(), '#READY\n') |
self.assertEqual(stderr.getvalue(), '') |