Commit ce502e24 authored by Gavin Mak's avatar Gavin Mak Committed by Commit Bot

Add flag to specify W3C loggingPrefs compliance

Currently, common.py uses the capability 'loggingPrefs'. Since
ChromeDriver 75.0.3770.8, this name has been renamed to
'goog:loggingPrefs' as required by W3C standard.

'goog:loggingPrefs' has been changed to be the default capability.

The flag --ignore_logging_prefs_w3c enables the 'loggingPrefs'
capability instead.

Bug: 1004566
Change-Id: Ib6b8f3260560ce48471952946fc2b98849157b45
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1808088Reviewed-by: default avatarRobert Ogden <robertogden@chromium.org>
Reviewed-by: default avatarrajendrant <rajendrant@chromium.org>
Reviewed-by: default avatarTarun Bansal <tbansal@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
Cr-Commit-Position: refs/heads/master@{#698658}
parent cb3ed702
...@@ -119,6 +119,9 @@ def ParseFlags(): ...@@ -119,6 +119,9 @@ def ParseFlags():
parser.add_argument('--chrome_start_time', type=int, default=0, help='The ' parser.add_argument('--chrome_start_time', type=int, default=0, help='The '
'number of attempts to check if Chrome has fetched a proxy client config ' 'number of attempts to check if Chrome has fetched a proxy client config '
'before starting the test. Each check takes about one second.') 'before starting the test. Each check takes about one second.')
parser.add_argument('--ignore_logging_prefs_w3c', action='store_true',
help='If given, use the loggingPrefs capability instead of the W3C '
'standard goog:loggingPrefs capability.')
return parser.parse_args(sys.argv[1:]) return parser.parse_args(sys.argv[1:])
def GetLogger(name='common'): def GetLogger(name='common'):
...@@ -304,9 +307,12 @@ class TestDriver: ...@@ -304,9 +307,12 @@ class TestDriver:
address = 'tcp:%d' % self._emulation_server_port address = 'tcp:%d' % self._emulation_server_port
_RunAdbCmd(['reverse', address, address]) _RunAdbCmd(['reverse', address, address])
capabilities = { capabilities = {}
'loggingPrefs': {'performance': 'INFO'}, if self._flags.ignore_logging_prefs_w3c:
} capabilities = {'loggingPrefs': {'performance': 'INFO'}}
else:
capabilities = {'goog:loggingPrefs': {'performance': 'INFO'}}
chrome_options = Options() chrome_options = Options()
if self._control_network_connection: if self._control_network_connection:
......
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