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

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

Issue 2620883002: Convert Settings.in, CSSValueKeywords.in, SVGCSSValueKeywords.in to json5 (Closed)
Patch Set: Convert CSSProperties.in to json5 format Created 3 years, 11 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 unified diff | Download patch
OLDNEW
1 # Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 1 # Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions 4 # modification, are permitted provided that the following conditions
5 # are met: 5 # are met:
6 # 6 #
7 # 1. Redistributions of source code must retain the above 7 # 1. Redistributions of source code must retain the above
8 # copyright notice, this list of conditions and the following 8 # copyright notice, this list of conditions and the following
9 # disclaimer. 9 # disclaimer.
10 # 2. Redistributions in binary form must reproduce the above 10 # 2. Redistributions in binary form must reproduce the above
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 # Use the unprefixed version 279 # Use the unprefixed version
280 test_prop = test_properties[index].replace('-webkit-', '') 280 test_prop = test_properties[index].replace('-webkit-', '')
281 # Replace the token 281 # Replace the token
282 html = html.replace('@test' + str(index) + '@', test_prop) 282 html = html.replace('@test' + str(index) + '@', test_prop)
283 index -= 1 283 index -= 1
284 284
285 return (test_properties, html) 285 return (test_properties, html)
286 286
287 def test_convert_for_webkit_with_non_utf8(self): 287 def test_convert_for_webkit_with_non_utf8(self):
288 files = {'/file': 'e\x87[P', 288 files = {'/file': 'e\x87[P',
289 '/mock-checkout/third_party/WebKit/Source/core/css/CSSPropertie s.in': '', } 289 '/mock-checkout/third_party/WebKit/Source/core/css/CSSPropertie s.json5': '', }
290 host = MockSystemHost(filesystem=MockFileSystem(files=files)) 290 host = MockSystemHost(filesystem=MockFileSystem(files=files))
291 convert_for_webkit('', '/file', '', host) 291 convert_for_webkit('', '/file', '', host)
292 292
293 # This test passes if no Exception is raised 293 # This test passes if no Exception is raised
294 def test_convert_for_webkit_with_utf8(self): 294 def test_convert_for_webkit_with_utf8(self):
295 files = {'/file': 'foo', 295 files = {'/file': 'foo',
296 '/mock-checkout/third_party/WebKit/Source/core/css/CSSPropertie s.in': '', } 296 '/mock-checkout/third_party/WebKit/Source/core/css/CSSPropertie s.json5': '', }
297 host = MockSystemHost(filesystem=MockFileSystem(files=files)) 297 host = MockSystemHost(filesystem=MockFileSystem(files=files))
298 convert_for_webkit('', '/file', '', host) 298 convert_for_webkit('', '/file', '', host)
299 299
300 def test_for_capital_end_tags(self): 300 def test_for_capital_end_tags(self):
301 test_html = """<FONT></FONT>""" 301 test_html = """<FONT></FONT>"""
302 converter = _W3CTestConverter(DUMMY_PATH, DUMMY_FILENAME, None) 302 converter = _W3CTestConverter(DUMMY_PATH, DUMMY_FILENAME, None)
303 converter.feed(test_html) 303 converter.feed(test_html)
304 self.assertEqual(converter.output(), ([], """<FONT></FONT>""")) 304 self.assertEqual(converter.output(), ([], """<FONT></FONT>"""))
305 305
306 def test_for_comments(self): 306 def test_for_comments(self):
307 test_html = """<!--abc--><!-- foo -->""" 307 test_html = """<!--abc--><!-- foo -->"""
308 converter = _W3CTestConverter(DUMMY_PATH, DUMMY_FILENAME, None) 308 converter = _W3CTestConverter(DUMMY_PATH, DUMMY_FILENAME, None)
309 converter.feed(test_html) 309 converter.feed(test_html)
310 self.assertEqual(converter.output(), ([], """<!--abc--><!-- foo -->""")) 310 self.assertEqual(converter.output(), ([], """<!--abc--><!-- foo -->"""))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698