Chromium Code Reviews| Index: chrome/test/chromedriver/run_all_tests.py |
| diff --git a/chrome/test/chromedriver/run_all_tests.py b/chrome/test/chromedriver/run_all_tests.py |
| index e9717c593e4a4e4da36def7cc28417bd8e41dcce..e3c8335a2a906e25e329b2b962408f05955f699e 100755 |
| --- a/chrome/test/chromedriver/run_all_tests.py |
| +++ b/chrome/test/chromedriver/run_all_tests.py |
| @@ -14,6 +14,41 @@ sys.path.insert(0, os.path.join(_THIS_DIR, os.pardir, 'pylib')) |
| from common import chrome_paths |
| from common import util |
| +def _AppendEnvironmentPath(env_name, path): |
| + if env_name in os.environ: |
| + lib_path = os.environ[env_name] |
| + if path in lib_path: |
|
kkania
2012/12/03 20:34:07
if path not in lib_path:
os.environ[env_name] +=
chrisgao (Use stgao instead)
2012/12/04 00:13:59
Done.
|
| + pass |
| + else: |
| + os.environ[env_name] += os.pathsep + path |
| + else: |
| + os.environ[env_name] = path |
| + |
| +def _FindChromeBinary(loc): |
|
kkania
2012/12/03 20:34:07
loc is not a very common abbreviation for location
chrisgao (Use stgao instead)
2012/12/04 00:13:59
Done.
|
| + if util.IsLinux(): |
| + exexutables = [ |
|
kkania
2012/12/03 20:34:07
should be executables, not exexutables. You can ju
chrisgao (Use stgao instead)
2012/12/04 00:13:59
Done.
|
| + "google-chrome", |
|
kkania
2012/12/03 20:34:07
use ' instead of " for python
chrisgao (Use stgao instead)
2012/12/04 00:13:59
Done.
|
| + "chrome", |
|
kkania
2012/12/03 20:34:07
this is the only one you need
chrisgao (Use stgao instead)
2012/12/04 00:13:59
Done.
|
| + "chromium", |
| + "chromium-browser" |
| + ] |
| + elif util.IsMac(): |
| + exexutables = [ |
| + "Google Chrome.app/Contents/MacOS/Google Chrome", |
| + "Chromium.app/Contents/MacOS/Chromium" |
| + ] |
| + elif util.IsWindows(): |
| + exexutables = [ |
| + "Google\\Chrome\\Application\\chrome.exe", |
|
kkania
2012/12/03 20:34:07
executables = ['chrome.exe']
chrisgao (Use stgao instead)
2012/12/04 00:13:59
Done.
|
| + "Chromium\\Application\\chrome.exe" |
| + ] |
| + else: |
| + exexutables = [] |
| + for exe in exexutables: |
| + binary = os.path.join(loc, exe) |
| + if os.path.exists(binary): |
| + return binary |
| + return "" |
| def Main(): |
| print '@@@BUILD_STEP chromedriver2_tests@@@' |
| @@ -28,7 +63,12 @@ def Main(): |
| sys.executable, |
| os.path.join(_THIS_DIR, 'test.py'), |
| os.path.join(build_dir, chromedriver), |
| + _FindChromeBinary(build_dir), |
|
kkania
2012/12/03 20:34:07
i think we should also support, if the user hasn't
chrisgao (Use stgao instead)
2012/12/04 00:13:59
Set the path to chrome only when it is built.
When
|
| ] |
| + if util.IsLinux(): |
| + _AppendEnvironmentPath('LD_LIBRARY_PATH', os.path.join(build_dir, 'lib')) |
|
kkania
2012/12/03 20:34:07
how about short comment here why this is needed
chrisgao (Use stgao instead)
2012/12/04 00:13:59
Done.
|
| + elif util.IsMac(): |
| + os.environ['VERSIONER_PYTHON_PREFER_32_BIT'] = 'yes' |
|
kkania
2012/12/03 20:34:07
how about short comment here why this is needed
chrisgao (Use stgao instead)
2012/12/04 00:13:59
Done.
|
| code = util.RunCommand(cmd) |
| if code != 0: |
| print '@@@STEP_FAILURE@@@' |