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

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/path_finder.py

Issue 2554503004: Add running unit tests to run-bindings-tests. (Closed)
Patch Set: Created 4 years 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/path_finder.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/path_finder.py b/third_party/WebKit/Tools/Scripts/webkitpy/path_finder.py
new file mode 100644
index 0000000000000000000000000000000000000000..a64cefea20f75c42aaf9697e50ffb03d4c37b424
--- /dev/null
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/path_finder.py
@@ -0,0 +1,48 @@
+# Copyright 2016 The Chromium Authors. All rights reserved.
Dirk Pranke 2016/12/07 03:35:11 There's a lot of overlap between this file and web
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+"""Tiny utility to find various paths, relevant for running tests.
+"""
+
+import os
+import sys
+
+
+def find_typ_dir():
Yuki 2016/12/06 07:59:42 nit: "find_typ_dir" reads to me that this function
Dirk Pranke 2016/12/07 03:35:11 Agreed.
+ path_to_typ = get_typ_dir()
+ if path_to_typ not in sys.path:
+ sys.path.append(path_to_typ)
+
+
+def find_bindings_scripts_dir():
Yuki 2016/12/06 07:59:42 ditto
+ path_to_bindings_scripts = get_bindings_scripts_dir()
+ if path_to_bindings_scripts not in sys.path:
+ sys.path.append(path_to_bindings_scripts)
+
+
+def get_bindings_scripts_dir():
+ return os.path.join(get_source_dir(), 'bindings', 'scripts')
+
+
+def get_blink_dir():
+ return os.path.dirname(os.path.dirname(get_scripts_dir()))
+
+
+def get_chromium_src_dir():
+ return os.path.dirname(os.path.dirname(get_blink_dir()))
+
+
+def get_scripts_dir():
+ return os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
+
+
+def get_source_dir():
+ return os.path.join(get_blink_dir(), 'Source')
+
+
+def get_typ_dir():
+ return os.path.join(get_chromium_src_dir(), 'third_party', 'typ')
+
+
+def get_webkitpy_thirdparty_dir():
+ return os.path.join(get_scripts_dir(), 'webkitpy', 'thirdparty')

Powered by Google App Engine
This is Rietveld 408576698