Skip to content

Commit

Permalink
[WebDriver] Update imported WPT WebDriver tests
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=267835

Reviewed by Carlos Garcia Campos.

Bump imported version to 097898330ea0 from late January.

Upstream web-platform-tests/wpt#40910 changed
WPT WebDriver tests to use HTTPS urls instead of HTTP. This led to tests
using URLs provided by the local server to fail with unrecognized
certificates.

This commit forces the browser under test to use the test certificates
instead of relying on the system ones. While this allows using the local
HTTPS server, it has the drawback of ingnoring the system certificates,
failing to access external websites if a test wants to (which does not
seems to be the case now).

Also rename the config `bind_hostname` to `bind_address` after
web-platform-tests/wpt#9998

* Tools/Scripts/webkitpy/webdriver_tests/webdriver_w3c_executor.py:
(WebDriverW3CExecutor.__init__): Export variable for certificate setup
(WebDriverW3CExecutor._runner): Add new timeout_multipler key as in WTP 1a44d85
* Tools/Scripts/webkitpy/webdriver_tests/webdriver_w3c_web_server.py:
(WebDriverW3CWebServer.start): Store information about certificates
being used in the current test run.
(WebDriverW3CWebServer.cacert_pem_file): Export the certificates
location
* WebDriverTests/TestExpectations.json: Update classic and new bidi
  expectations
* WebDriverTests/imported/w3c/config.json: Rename bind_hostname to
  bind_address key
* WebDriverTests/imported/w3c/importer.json: Update imported WPT hash
* WebDriverTests/imported/w3c/tools/: Bump imported code
* WebDriverTests/imported/w3c/webdriver/: Bump imported code

Canonical link: https://commits.webkit.org/276326@main
  • Loading branch information
lauromoura committed Mar 19, 2024
1 parent e37f468 commit 1f76c86
Show file tree
Hide file tree
Showing 671 changed files with 37,644 additions and 5,639 deletions.
Expand Up @@ -125,6 +125,7 @@ class WebDriverW3CExecutor(WdspecExecutor):
def __init__(self, driver, server, env, timeout, expectations):
WebKitDriverBrowser.test_env = env
WebKitDriverBrowser.test_env.update(driver.browser_env())
WebKitDriverBrowser.test_env['WEBKIT_TLS_CAFILE_PEM'] = server.cacert_pem_file()
server_config = {'browser_host': server.host(),
'domains': {'': {'': server.host()},
'alt':{ '': '127.0.0.1'}},
Expand Down Expand Up @@ -179,7 +180,8 @@ def _runner(test_queue, result_queue, host, port, capabilities, webdriver_binary
'port': port,
'capabilities': capabilities,
'webdriver': {'binary': webdriver_binary},
'wptserve': server_config
'wptserve': server_config,
'timeout_multiplier': 10,
}
with open(config_path, 'w') as f:
json.dump(config, f)
Expand Down
Expand Up @@ -96,7 +96,9 @@ def start(self):
config_filename = os.path.join(doc_root, 'config.json')
config = json.loads(self._port.host.filesystem.read_text_file(config_filename))
config['doc_root'] = doc_root
config['ssl']['openssl']['base_path'] = os.path.join(self._runtime_path, '_wpt_certs')
self._wpt_certs_dir = os.path.join(self._runtime_path, '_wpt_certs')
self._wpt_certs_cacert_pem = os.path.join(self._wpt_certs_dir, 'cacert.pem')
config['ssl']['openssl']['base_path'] = self._wpt_certs_dir
self._port.host.filesystem.write_text_file(os.path.join(self._layout_doc_root, 'config.json'), json.dumps(config))
self._server_host = config['browser_host']
self._server_http_port = config['ports']['http'][0]
Expand Down Expand Up @@ -142,6 +144,9 @@ def https_port(self):
def document_root(self):
return self._layout_doc_root

def cacert_pem_file(self):
return self._wpt_certs_cacert_pem

# Waits indefinitely until the webserver process is terminated.
def wait(self):
if not self._pid:
Expand Down

0 comments on commit 1f76c86

Please sign in to comment.