Commit 5a00559c authored by samuong's avatar samuong Committed by Commit bot

[chromedriver] Check if chrome_path is None (Android uses package name instead).

BUG=
TBR=stgao@chromium.org

Review-Url: https://codereview.chromium.org/2039533002
Cr-Commit-Position: refs/heads/master@{#397753}
parent 91e2b1e3
......@@ -98,20 +98,19 @@ def _Run(java_tests_src_dir, test_filter,
shutil.copyfile(os.path.join(java_tests_src_dir, test_jar),
os.path.join(test_dir, test_jar))
if util.IsLinux() and not util.Is64Bit():
# Workaround for crbug.com/611886
chrome_wrapper_path = os.path.join(test_dir, 'chrome-wrapper-no-sandbox')
with open(chrome_wrapper_path, 'w') as f:
f.write('#!/bin/sh\n')
f.write('exec %s --no-sandbox "$@"\n' % os.path.abspath(chrome_path))
st = os.stat(chrome_wrapper_path)
os.chmod(chrome_wrapper_path, st.st_mode | stat.S_IEXEC)
else:
chrome_wrapper_path = os.path.abspath(chrome_path)
sys_props = ['selenium.browser=chrome',
'webdriver.chrome.driver=' + os.path.abspath(chromedriver_path)]
if chrome_path:
if util.IsLinux() and not util.Is64Bit():
# Workaround for crbug.com/611886
chrome_wrapper_path = os.path.join(test_dir, 'chrome-wrapper-no-sandbox')
with open(chrome_wrapper_path, 'w') as f:
f.write('#!/bin/sh\n')
f.write('exec %s --no-sandbox "$@"\n' % os.path.abspath(chrome_path))
st = os.stat(chrome_wrapper_path)
os.chmod(chrome_wrapper_path, st.st_mode | stat.S_IEXEC)
else:
chrome_wrapper_path = os.path.abspath(chrome_path)
sys_props += ['webdriver.chrome.binary=' + chrome_wrapper_path]
if log_path:
sys_props += ['webdriver.chrome.logfile=' + log_path]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment