Commit 9f03826b authored by Maggie Chen's avatar Maggie Chen Committed by Chromium LUCI CQ

Support Edge (beta, dev, can) in the power measurement script

In addition to the released version (stable) of Edge, now the versions
from the insider channels (beta, dev, can) can be automated in the Intel
power measurement script.

This CL also adds support for command line switches for Edge.

Bug: 867155
Change-Id: I021c3715b46213d12531a98a3eca52a03824a846
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2631157
Commit-Queue: Maggie Chen <magchen@chromium.org>
Reviewed-by: default avatarZhenyao Mo <zmo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#844271}
parent 8d500cbb
...@@ -13,6 +13,8 @@ on Windows: ...@@ -13,6 +13,8 @@ on Windows:
https://www.microsoft.com/en-us/download/details.aspx?id=14632 https://www.microsoft.com/en-us/download/details.aspx?id=14632
Install selenium via pip: `pip install selenium` Install selenium via pip: `pip install selenium`
Selenium 4 is required for Edge. Selenium 4.00-alpha5 or later is recommended:
`pip install selenium==4.0.0a5`
And finally install the web drivers for Chrome (and Edge if needed): And finally install the web drivers for Chrome (and Edge if needed):
http://chromedriver.chromium.org/downloads http://chromedriver.chromium.org/downloads
...@@ -24,6 +26,10 @@ python measure_power_intel.py --browser=canary --duration=10 --delay=5 ...@@ -24,6 +26,10 @@ python measure_power_intel.py --browser=canary --duration=10 --delay=5
--verbose --url="https://www.youtube.com/watch?v=0XdS37Re1XQ" --verbose --url="https://www.youtube.com/watch?v=0XdS37Re1XQ"
--extra-browser-args="--no-sandbox" --extra-browser-args="--no-sandbox"
Supported browsers (--browser=xxx): 'stable', 'beta', 'dev', 'canary',
'chromium', 'edge', and path_to_exe_file.
For Edge from insider channels (beta, dev, can), use path_to_exe_file.
It is recommended to test with optimized builds of Chromium e.g. these GN args: It is recommended to test with optimized builds of Chromium e.g. these GN args:
is_debug = false is_debug = false
...@@ -146,8 +152,17 @@ def LocateBrowser(options_browser): ...@@ -146,8 +152,17 @@ def LocateBrowser(options_browser):
def CreateWebDriver(browser, user_data_dir, url, fullscreen, def CreateWebDriver(browser, user_data_dir, url, fullscreen,
extra_browser_args): extra_browser_args):
if browser == 'edge': if browser == 'edge' or browser.endswith('msedge.exe'):
driver = webdriver.Edge() options = webdriver.EdgeOptions()
# Set use_chromium to true or an error will be triggered that the latest
# MSEdgeDriver doesn't support an older version (non-chrome based) of
# MSEdge.
options.use_chromium = True
options.binary_location = browser
for arg in extra_browser_args:
options.add_argument(arg)
logging.debug(" ".join(options.arguments))
driver = webdriver.Edge(options=options)
else: else:
options = webdriver.ChromeOptions() options = webdriver.ChromeOptions()
options.binary_location = browser options.binary_location = browser
......
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