wasm tests: Add option to run Chrome in headless mode

Running Chrome in headless mode helps to circumvent
a lot of issues with GPU driver/Wayland interactions
that we encounter in CI.
Run Chrome in headless mode if corresponding environment
variable is set.

Pick-to: 6.9
Change-Id: I1cf290f484054766e2b99d99045e7b39d5662210
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
This commit is contained in:
Piotr Wiercinski 2024-12-30 13:52:09 +01:00
parent c0fcb2db24
commit 213a2610d8

View File

@ -708,7 +708,11 @@ function(qt_internal_add_test name)
set(browser "chrome")
endif()
list(APPEND extra_test_args "--browser=${browser}")
list(APPEND extra_test_args "--browser_args=\"--password-store=basic\"")
if(DEFINED ENV{HEADLESS_CHROME_FOR_TESTING})
list(APPEND extra_test_args "--browser_args=\"--password-store=basic --headless\"")
else()
list(APPEND extra_test_args "--browser_args=\"--password-store=basic\"")
endif()
list(APPEND extra_test_args "--kill_exit")
# Tests may require asyncify if they use exec(). Enable asyncify for