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

Side by Side Diff: chrome/test/chromedriver/chrome_paths.py

Issue 2188323002: [chromedriver] Update chrome_paths to use GN build directory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « no previous file | 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 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Paths to common resources in the Chrome repository.""" 5 """Paths to common resources in the Chrome repository."""
6 6
7 import os 7 import os
8 8
9 9
10 _THIS_DIR = os.path.abspath(os.path.dirname(__file__)) 10 _THIS_DIR = os.path.abspath(os.path.dirname(__file__))
11 11
12 12
13 def GetSrc(): 13 def GetSrc():
14 """Returns the path to the root src directory.""" 14 """Returns the path to the root src directory."""
15 return os.path.abspath(os.path.join(_THIS_DIR, os.pardir, os.pardir, 15 return os.path.abspath(os.path.join(_THIS_DIR, os.pardir, os.pardir,
16 os.pardir)) 16 os.pardir))
17 17
18 18
19 def GetTestData(): 19 def GetTestData():
20 """Returns the path to the src/chrome/test/data directory.""" 20 """Returns the path to the src/chrome/test/data directory."""
21 return os.path.join(GetSrc(), 'chrome', 'test', 'data') 21 return os.path.join(GetSrc(), 'chrome', 'test', 'data')
22 22
23 23
24 def GetBuildDir(required_paths): 24 def GetBuildDir(required_paths):
25 """Returns the preferred build directory that contains given paths.""" 25 """Returns the preferred build directory that contains given paths."""
26 dirs = ['out', 'build', 'xcodebuild'] 26 build_dir = os.path.join(GetSrc(), 'out', 'Default')
jbudorick 2016/07/28 19:16:10 I take it all the chromedriver bots are now genera
27 rel_dirs = [os.path.join(x, 'Release') for x in dirs] 27 for required_path in required_paths:
28 debug_dirs = [os.path.join(x, 'Debug') for x in dirs] 28 if not os.path.exists(os.path.join(build_dir, required_path)):
29 full_dirs = [os.path.join(GetSrc(), x) for x in rel_dirs + debug_dirs] 29 raise RuntimeError('Cannot find build directory containing ' +
30 for build_dir in full_dirs: 30 ', '.join(required_paths))
31 for required_path in required_paths: 31 return build_dir
32 if not os.path.exists(os.path.join(build_dir, required_path)):
33 break
34 else:
35 return build_dir
36 raise RuntimeError('Cannot find build directory containing ' +
37 ', '.join(required_paths))
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698