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

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/common/webkit_finder.py

Issue 2831883002: webkitpy: Reduce usage of path_from_webkit_base(). (Closed)
Patch Set: . Created 3 years, 8 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
Index: third_party/WebKit/Tools/Scripts/webkitpy/common/webkit_finder.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/common/webkit_finder.py b/third_party/WebKit/Tools/Scripts/webkitpy/common/webkit_finder.py
index fa5a7758c964f6e471a539ed74dc95fdc0c40a99..7b4a97c2381ea58e2f8e344f7c0f4956695cecc7 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/common/webkit_finder.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/common/webkit_finder.py
@@ -82,6 +82,9 @@ class WebKitFinder(object):
self._chromium_base = None
self._depot_tools = None
+ # TODO(tkent): Make this private. We should use functions for
+ # sub-directories in order to make the code robust against directory
+ # structure changes.
def webkit_base(self):
"""Returns the absolute path to the top of the WebKit tree.
@@ -102,21 +105,33 @@ class WebKitFinder(object):
self._chromium_base = self._filesystem.dirname(self._filesystem.dirname(self.webkit_base()))
return self._chromium_base
+ # TODO(tkent): Make this private. We should use functions for
+ # sub-directories in order to make the code robust against directory
+ # structure changes.
def path_from_webkit_base(self, *comps):
return self._filesystem.join(self.webkit_base(), *comps)
def path_from_chromium_base(self, *comps):
return self._filesystem.join(self.chromium_base(), *comps)
+ def path_from_blink_source(self, *comps):
qyearsley 2017/04/20 23:25:22 Later on, after the move, this will just be //web,
+ return self._filesystem.join(self._filesystem.join(self.webkit_base(), 'Source'), *comps)
+
def path_to_script(self, script_name):
"""Returns the relative path to the script from the top of the WebKit tree."""
# This is intentionally relative in order to force callers to consider what
# their current working directory is (and change to the top of the tree if necessary).
return self._filesystem.join('Tools', 'Scripts', script_name)
+ def path_from_tools_scripts(self, *comps):
+ return self._filesystem.join(self._filesystem.join(self.webkit_base(), 'Tools', 'Scripts'), *comps)
qyearsley 2017/04/20 23:25:22 I suppose later this will be be called path_from_t
+
def layout_tests_dir(self):
return self.path_from_webkit_base('LayoutTests')
+ def path_from_layout_tests(self, *comps):
+ return self._filesystem.join(self.layout_tests_dir(), *comps)
+
def perf_tests_dir(self):
return self.path_from_webkit_base('PerformanceTests')

Powered by Google App Engine
This is Rietveld 408576698