Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Tools / Scripts / webkitpy / layout_tests / port / mock_drt_unittest.py
index 7ce4ada..72e37cf 100644 (file)
 
 """Unit tests for MockDRT."""
 
+import io
 import sys
 import unittest
 
-from webkitpy.common import newstringio
 from webkitpy.common.system.systemhost_mock import MockSystemHost
 from webkitpy.layout_tests.port import mock_drt
 from webkitpy.layout_tests.port import port_testcase
@@ -77,6 +77,9 @@ class MockDRTPortTest(port_testcase.PortTestCase):
     def test_check_build(self):
         pass
 
+    def test_virtual_test_suites(self):
+        pass
+
 
 class MockDRTTest(unittest.TestCase):
     def input_line(self, port, test_name, pixel_tests, checksum=None):
@@ -127,9 +130,9 @@ class MockDRTTest(unittest.TestCase):
             pixel_tests, expected_checksum, drt_output, drt_input=None, expected_text=expected_text)
 
         args = ['--dump-render-tree', '--platform', port_name, '-']
-        stdin = newstringio.StringIO(drt_input)
-        stdout = newstringio.StringIO()
-        stderr = newstringio.StringIO()
+        stdin = io.BytesIO(drt_input)
+        stdout = io.BytesIO()
+        stderr = io.BytesIO()
         options, args = mock_drt.parse_options(args)
 
         drt = self.make_drt(options, args, host, stdin, stdout, stderr)
@@ -137,17 +140,15 @@ class MockDRTTest(unittest.TestCase):
 
         self.assertEqual(res, 0)
 
-        # We use the StringIO.buflist here instead of getvalue() because
-        # the StringIO might be a mix of unicode/ascii and 8-bit strings.
-        self.assertEqual(stdout.buflist, drt_output)
+        self.assertEqual(stdout.getvalue(), ''.join(drt_output))
         self.assertEqual(stderr.getvalue(), '#EOF\n')
 
     def test_main(self):
         host = MockSystemHost()
         test.add_unit_tests_to_mock_filesystem(host.filesystem)
-        stdin = newstringio.StringIO()
-        stdout = newstringio.StringIO()
-        stderr = newstringio.StringIO()
+        stdin = io.BytesIO()
+        stdout = io.BytesIO()
+        stderr = io.BytesIO()
         res = mock_drt.main(['--dump-render-tree', '--platform', 'test', '-'],
                             host, stdin, stdout, stderr)
         self.assertEqual(res, 0)