Commit 9e4d6b9b authored by John Chen's avatar John Chen Committed by Commit Bot

[ChromeDriver] Enable RemoteBrowserTest on CQ

Update run_py_tests.py to attempt to locate Chrome binary automatically,
to make RemoteBrowserTest compatible with CQ.

Bug: chromedriver:2277
Change-Id: Iee82313ac5d38315f1017961c487dc202025196b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1769722Reviewed-by: default avatarCaleb Rouleau <crouleau@chromium.org>
Commit-Queue: John Chen <johnchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#690418}
parent 634fe9df
......@@ -154,10 +154,6 @@ _INTEGRATION_NEGATIVE_FILTER = [
'HeadlessInvalidCertificateTest.*',
# Similar issues with HeadlessChromeDriverTest.
'HeadlessChromeDriverTest.*',
# https://bugs.chromium.org/p/chromedriver/issues/detail?id=2277
# RemoteBrowserTest requires extra setup. TODO(johnchen@chromium.org):
# Modify the test so it runs correctly as isolated test.
'RemoteBrowserTest.*',
# Flaky: https://crbug.com/899919
'SessionHandlingTest.testGetSessions',
# Flaky due to occasional timeout in starting Chrome
......@@ -190,6 +186,7 @@ _ANDROID_NEGATIVE_FILTER['chrome'] = (
'ChromeDriverTest.testWindowMaximize',
'ChromeDriverTest.testWindowMinimize',
'ChromeLogPathCapabilityTest.testChromeLogPath',
# Connecting to running browser is not supported on Android.
'RemoteBrowserTest.*',
# Don't enable perf testing on Android yet.
'PerfTest.*',
......@@ -3847,7 +3844,7 @@ if __name__ == '__main__':
parser.error('Need path specified when replayable log set to true.')
global _CHROMEDRIVER_BINARY
_CHROMEDRIVER_BINARY = options.chromedriver
_CHROMEDRIVER_BINARY = util.GetAbsolutePathOfUserPath(options.chromedriver)
if (options.android_package and
options.android_package not in _ANDROID_NEGATIVE_FILTER):
......@@ -3864,7 +3861,28 @@ if __name__ == '__main__':
if options.chrome:
_CHROME_BINARY = util.GetAbsolutePathOfUserPath(options.chrome)
else:
_CHROME_BINARY = None
# In some test environments (such as commit queue), it's not convenient to
# specify Chrome binary location on the command line. Try to use heuristics
# to locate the Chrome binary next to the ChromeDriver binary.
driver_path = os.path.dirname(_CHROMEDRIVER_BINARY)
chrome_path = None
platform = util.GetPlatformName()
if platform == 'linux':
chrome_path = os.path.join(driver_path, 'chrome')
elif platform == 'mac':
if os.path.exists(os.path.join(driver_path, 'Google Chrome.app')):
chrome_path = os.path.join(driver_path, 'Google Chrome.app',
'Contents', 'MacOS', 'Google Chrome')
else:
chrome_path = os.path.join(driver_path, 'Chromium.app',
'Contents', 'MacOS', 'Chromium')
elif platform == 'win':
chrome_path = os.path.join(driver_path, 'chrome.exe')
if chrome_path is not None and os.path.exists(chrome_path):
_CHROME_BINARY = chrome_path
else:
_CHROME_BINARY = None
global _ANDROID_PACKAGE_KEY
_ANDROID_PACKAGE_KEY = options.android_package
......
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