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

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

Issue 2037743002: Support converting utf-16 files when importing w3c tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Modified files to match Master/Origin (with changes) Created 4 years, 7 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_converter.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_converter_unittest.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_converter_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_converter_unittest.py
index 3c060ff91aacce46bb128a4c651ca8612bfd6ca6..0c6d56a9fb6fe7fe5232b35eacd5b4648bb5f8b5 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_converter_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_converter_unittest.py
@@ -33,7 +33,8 @@ from webkitpy.common.host import Host
from webkitpy.common.system.outputcapture import OutputCapture
from webkitpy.common.webkit_finder import WebKitFinder
from webkitpy.thirdparty.BeautifulSoup import BeautifulSoup
-from webkitpy.w3c.test_converter import _W3CTestConverter
+from webkitpy.w3c.test_converter import _W3CTestConverter, convert_for_webkit
+from webkitpy.common.system.filesystem_mock import MockFileSystem
DUMMY_FILENAME = 'dummy.html'
DUMMY_PATH = 'dummy/testharness/path'
@@ -310,3 +311,21 @@ CONTENT OF TEST
index -= 1
return (test_properties, html)
+
+ # Test for convert_for_webkit; determing if 'utf-16' decodes correctly
+ def test_convert_for_webkit_with_non_utf8(self):
+ mock_fs = MockFileSystem()
+ mock_fs.files = {'/file': 'e\x87[P',
+ '/mock-checkout/third_party/WebKit/Source/core/css/CSSProperties.in': '', }
+ host = Host()
+ host.filesystem = mock_fs
+ convert_for_webkit('', '/file', '', host)
+
+ # Test for convert_for_webkit; determing if 'utf-8' decodes correctly
+ def test_convert_for_webkit_with_utf8(self):
+ mock_fs = MockFileSystem()
+ mock_fs.files = {'/file': 'foo',
+ '/mock-checkout/third_party/WebKit/Source/core/css/CSSProperties.in': '', }
+ host = Host()
+ host.filesystem = mock_fs
+ convert_for_webkit('', '/file', '', host)
Dirk Pranke 2016/06/02 19:22:24 Yup, this is pretty much how I'd expect you to tes
« no previous file with comments | « third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_converter.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698