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

Side by Side Diff: Tools/Scripts/webkitpy/w3c/test_converter.py

Issue 15981013: fix paths in webkitpy tests. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Tools/Scripts/webkitpy/common/checkout/checkout_unittest.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 13 matching lines...) Expand all
24 # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
26 # TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 26 # TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
27 # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 # SUCH DAMAGE. 28 # SUCH DAMAGE.
29 29
30 import logging 30 import logging
31 import re 31 import re
32 32
33 from webkitpy.common.host import Host 33 from webkitpy.common.host import Host
34 from webkitpy.common.webkit_finder import WebKitFinder
34 from webkitpy.thirdparty.BeautifulSoup import BeautifulSoup, Tag 35 from webkitpy.thirdparty.BeautifulSoup import BeautifulSoup, Tag
35 36
36 37
37 _log = logging.getLogger(__name__) 38 _log = logging.getLogger(__name__)
38 39
39 40
40 class W3CTestConverter(object): 41 class W3CTestConverter(object):
41 42
42 def __init__(self): 43 def __init__(self):
43 self._host = Host() 44 self._host = Host()
44 self._filesystem = self._host.filesystem 45 self._filesystem = self._host.filesystem
45 self._host.initialize_scm() 46 self._webkit_root = WebKitFinder(self._filesystem).webkit_base()
46 self._webkit_root = self._host.scm().checkout_root
47 47
48 # These settings might vary between WebKit and Blink 48 # These settings might vary between WebKit and Blink
49 self._css_property_file = self.path_from_webkit_root('Source', 'core', ' css', 'CSSPropertyNames.in') 49 self._css_property_file = self.path_from_webkit_root('Source', 'core', ' css', 'CSSPropertyNames.in')
50 self._css_property_split_string = 'alias_for=' 50 self._css_property_split_string = 'alias_for='
51 51
52 self.prefixed_properties = self.read_webkit_prefixed_css_property_list() 52 self.prefixed_properties = self.read_webkit_prefixed_css_property_list()
53 53
54 def path_from_webkit_root(self, *comps): 54 def path_from_webkit_root(self, *comps):
55 return self._filesystem.abspath(self._filesystem.join(self._webkit_root, *comps)) 55 return self._filesystem.abspath(self._filesystem.join(self._webkit_root, *comps))
56 56
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 converted_properties.append(prefixed_property) 184 converted_properties.append(prefixed_property)
185 text = re.sub(pattern, prefixed_property + ':', text) 185 text = re.sub(pattern, prefixed_property + ':', text)
186 186
187 # FIXME: Handle the JS versions of these properties and GetComputedStyle , too. 187 # FIXME: Handle the JS versions of these properties and GetComputedStyle , too.
188 return (converted_properties, text) 188 return (converted_properties, text)
189 189
190 def replace_tag(self, old_tag, new_tag): 190 def replace_tag(self, old_tag, new_tag):
191 index = old_tag.parent.contents.index(old_tag) 191 index = old_tag.parent.contents.index(old_tag)
192 old_tag.parent.insert(index, new_tag) 192 old_tag.parent.insert(index, new_tag)
193 old_tag.extract() 193 old_tag.extract()
OLDNEW
« no previous file with comments | « Tools/Scripts/webkitpy/common/checkout/checkout_unittest.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698