wasm: Switch to the new jspi browser

Change-Id: I10d1950f6532a01b7803944aa4383df4f974d996
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
This commit is contained in:
Even Oscar Andersen 2025-09-03 10:29:27 +02:00
parent 12779df281
commit cc984a60fd
1 changed files with 27 additions and 14 deletions

View File

@ -721,20 +721,32 @@ function(qt_internal_add_test name)
list(APPEND extra_test_args "quseemrun") list(APPEND extra_test_args "quseemrun")
list(APPEND extra_test_args "qtestname=${testname}") list(APPEND extra_test_args "qtestname=${testname}")
list(APPEND extra_test_args "--silence_timeout=60") list(APPEND extra_test_args "--silence_timeout=60")
# TODO: Add functionality to specify browser # TODO: Add functionality to specify browser
set(browser "")
set(browser_args "")
if(DEFINED ENV{WASM_BROWSER_JSPI})
set(browser "$ENV{WASM_BROWSER_JSPI}")
set(browser_args "$ENV{WASM_BROWSER_JSPI_ARGS}")
else()
if(DEFINED ENV{BROWSER_FOR_WASM}) if(DEFINED ENV{BROWSER_FOR_WASM})
set(browser $ENV{BROWSER_FOR_WASM}) set(browser "$ENV{BROWSER_FOR_WASM}")
else() else()
set(browser "chrome") set(browser "chrome")
endif() endif()
list(APPEND extra_test_args "--browser=${browser}")
if(DEFINED ENV{HEADLESS_CHROME_FOR_TESTING}) if(DEFINED ENV{HEADLESS_CHROME_FOR_TESTING})
list(APPEND extra_test_args "--browser_args=\"--password-store=basic --headless\"") set(browser_args "${browser_args} --headless")
else()
list(APPEND extra_test_args "--browser_args=\"--password-store=basic\"")
endif() endif()
set(browser_args "${browser_args} --password-store=basic")
endif()
list(APPEND extra_test_args "--browser=${browser}")
list(APPEND extra_test_args "--browser_args=\"${browser_args}\"")
list(APPEND extra_test_args "--kill_exit") list(APPEND extra_test_args "--kill_exit")
if (NOT QT_FEATURE_wasm_jspi)
# Tests may require asyncify if they use exec(). Enable asyncify for # Tests may require asyncify if they use exec(). Enable asyncify for
# batched tests since this is the configuration used on the CI system. # batched tests since this is the configuration used on the CI system.
# Optimize for size (-Os), since asyncify tends to make the resulting # Optimize for size (-Os), since asyncify tends to make the resulting
@ -742,6 +754,7 @@ function(qt_internal_add_test name)
if(batch_current_test) if(batch_current_test)
target_link_options("${name}" PRIVATE "SHELL:-s ASYNCIFY" "-Os") target_link_options("${name}" PRIVATE "SHELL:-s ASYNCIFY" "-Os")
endif() endif()
endif()
# This tells cmake to run the tests with this script, since wasm files can't be # This tells cmake to run the tests with this script, since wasm files can't be
# executed directly # executed directly