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

Side by Side Diff: chrome/test/pyautolib/pyauto_paths.py

Issue 7634031: Let pyauto create an attached webdriver instance to manipulate web pages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: forgot to re-add the previously added files Created 9 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 #!/usr/bin/python
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 """Common paths for pyauto tests."""
7
8 import os
9 import sys
10
11
12 def GetSourceDir():
13 """Returns src/ directory."""
14 script_dir = os.path.abspath(os.path.dirname(__file__))
15 return os.path.join(script_dir, os.pardir, os.pardir, os.pardir)
16
17
18 def GetThirdPartyDir():
19 """Returns src/third_party directory."""
20 return os.path.join(GetSourceDir(), 'third_party')
21
22
23 def GetBuildDirs():
24 """Returns list of possible build directories."""
25 build_dirs = {
26 'linux2': [ os.path.join('out', 'Debug'),
27 os.path.join('sconsbuild', 'Debug'),
28 os.path.join('out', 'Release'),
29 os.path.join('sconsbuild', 'Release')],
30 'linux3': [ os.path.join('out', 'Debug'),
31 os.path.join('sconsbuild', 'Debug'),
32 os.path.join('out', 'Release'),
33 os.path.join('sconsbuild', 'Release')],
34 'darwin': [ os.path.join('xcodebuild', 'Debug'),
35 os.path.join('xcodebuild', 'Release')],
36 'win32': [ os.path.join('chrome', 'Debug'),
37 os.path.join('build', 'Debug'),
38 os.path.join('chrome', 'Release'),
39 os.path.join('build', 'Release')],
40 'cygwin': [ os.path.join('chrome', 'Debug'),
41 os.path.join('chrome', 'Release')],
42 }
43 src_dir = GetSourceDir()
44 return map(lambda dir: os.path.join(src_dir, dir),
45 build_dirs.get(sys.platform, []))
46
47
48 def GetChromeDriverExe():
49 """Returns path to ChromeDriver executable, or None if cannot be found."""
50 exe_name = 'chromedriver'
51 if sys.platform == 'win32':
52 exe_name += '.exe'
53 for dir in GetBuildDirs():
54 exe = os.path.join(dir, exe_name)
55 if os.path.exists(exe):
56 return exe
57 return None
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698