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
3 # found in the LICENSE file.
5 """Common paths for pyauto tests."""
12 """Returns src/ directory."""
13 script_dir
= os
.path
.abspath(os
.path
.dirname(__file__
))
14 return os
.path
.join(script_dir
, os
.pardir
, os
.pardir
, os
.pardir
)
17 def GetThirdPartyDir():
18 """Returns src/third_party directory."""
19 return os
.path
.join(GetSourceDir(), 'third_party')
23 """Returns list of possible build directories."""
24 # List of dirs that can contain a Debug/Release build.
28 'darwin': ['out', 'xcodebuild'],
29 'win32': ['chrome', 'build', 'out'],
31 }.get(sys
.platform
, [])
32 src_dir
= GetSourceDir()
34 for dir in outer_dirs
:
35 build_dirs
+= [os
.path
.join(src_dir
, dir, 'Debug')]
36 build_dirs
+= [os
.path
.join(src_dir
, dir, 'Release')]
40 def GetChromeDriverExe():
41 """Returns path to ChromeDriver executable, or None if cannot be found."""
42 exe_name
= 'chromedriver'
43 if sys
.platform
== 'win32':
47 dir = os
.path
.dirname(pyautolib
.__file
__)
48 exe
= os
.path
.join(dir, exe_name
)
49 if os
.path
.exists(exe
):