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

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

Issue 2014063002: Run format-webkit on webkitpy code (without string conversion). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 2
3 # Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 3 # Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
4 # 4 #
5 # Redistribution and use in source and binary forms, with or without 5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions 6 # modification, are permitted provided that the following conditions
7 # are met: 7 # are met:
8 # 8 #
9 # 1. Redistributions of source code must retain the above 9 # 1. Redistributions of source code must retain the above
10 # copyright notice, this list of conditions and the following 10 # copyright notice, this list of conditions and the following
(...skipping 27 matching lines...) Expand all
38 from webkitpy.w3c.test_converter import _W3CTestConverter 38 from webkitpy.w3c.test_converter import _W3CTestConverter
39 39
40 DUMMY_FILENAME = 'dummy.html' 40 DUMMY_FILENAME = 'dummy.html'
41 DUMMY_PATH = 'dummy/testharness/path' 41 DUMMY_PATH = 'dummy/testharness/path'
42 42
43 43
44 class W3CTestConverterTest(unittest.TestCase): 44 class W3CTestConverterTest(unittest.TestCase):
45 45
46 # FIXME: When we move to using a MockHost, this method should be removed, si nce 46 # FIXME: When we move to using a MockHost, this method should be removed, si nce
47 # then we can just pass in a dummy dir path 47 # then we can just pass in a dummy dir path
48
48 def fake_dir_path(self, dirname): 49 def fake_dir_path(self, dirname):
49 filesystem = Host().filesystem 50 filesystem = Host().filesystem
50 webkit_root = WebKitFinder(filesystem).webkit_base() 51 webkit_root = WebKitFinder(filesystem).webkit_base()
51 return filesystem.abspath(filesystem.join(webkit_root, "LayoutTests", "c ss", dirname)) 52 return filesystem.abspath(filesystem.join(webkit_root, "LayoutTests", "c ss", dirname))
52 53
53 def test_read_prefixed_property_list(self): 54 def test_read_prefixed_property_list(self):
54 """ Tests that the current list of properties requiring the -webkit- pre fix load correctly """ 55 """ Tests that the current list of properties requiring the -webkit- pre fix load correctly """
55 56
56 # FIXME: We should be passing in a MockHost here ... 57 # FIXME: We should be passing in a MockHost here ...
57 converter = _W3CTestConverter(DUMMY_PATH, DUMMY_FILENAME, None) 58 converter = _W3CTestConverter(DUMMY_PATH, DUMMY_FILENAME, None)
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 # through the list to replace the double-digit tokens first 430 # through the list to replace the double-digit tokens first
430 index = len(test_properties) - 1 431 index = len(test_properties) - 1
431 while index >= 0: 432 while index >= 0:
432 # Use the unprefixed version 433 # Use the unprefixed version
433 test_prop = test_properties[index].replace('-webkit-', '') 434 test_prop = test_properties[index].replace('-webkit-', '')
434 # Replace the token 435 # Replace the token
435 html = html.replace('@test' + str(index) + '@', test_prop) 436 html = html.replace('@test' + str(index) + '@', test_prop)
436 index -= 1 437 index -= 1
437 438
438 return (test_properties, html) 439 return (test_properties, html)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698