Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
0d56a8b
Diagnose inherited Snap paths in WebKitGTK
ambroise-leclerc Nov 18, 2026
6985c09
Compare raw pointers in CaptureRegistration::reset
ambroise-leclerc Nov 18, 2026
59625fb
Respect environment variable path separators
ambroise-leclerc Nov 18, 2026
1e6ce86
Merge pull request #610 from ambroise-leclerc/606-capture-shared-ptr-…
AM-L Nov 18, 2026
b369e72
Show the WebKitGTK window at its first frame, add a window background…
ambroise-leclerc Nov 18, 2026
b18c064
Initialize GStreamer only for applications with media; trace start-up…
ambroise-leclerc Nov 18, 2026
ce14291
Merge pull request #609 from ambroise-leclerc/607-webkitgtk-snap-diag…
ambroise-leclerc Nov 18, 2026
8b54fd5
Defer WebView2 window presentation until first frame
ambroise-leclerc Nov 18, 2026
f79a219
Fix Windows test discovery and release workflow checks
ambroise-leclerc Nov 18, 2026
b3eb879
Detect native CUDA architectures for the host loop
ambroise-leclerc Nov 18, 2026
564b1bb
Address review: GStreamer opt-out kept for the session and off by def…
ambroise-leclerc Nov 18, 2026
59ccfe7
Include NativeFS in the WKWebView lifecycle test (#611)
ambroise-leclerc Nov 18, 2026
84783ab
Let WKWebView's first-layout probe fall back to a timer when animatio…
ambroise-leclerc Nov 18, 2026
dacba8d
Reveal the WKWebView window when the document has loaded instead of a…
ambroise-leclerc Nov 18, 2026
8980082
Give the WKWebView first-load test a delay longer than a cold web con…
ambroise-leclerc Nov 18, 2026
5dd5d13
Scope the GStreamer opt-out to the start of the session and test that…
ambroise-leclerc Nov 18, 2026
6dd54f9
Arm the WebView2 presentation delay with the window; state the proces…
ambroise-leclerc Nov 18, 2026
0cd4b00
Stop WKWebView painting its own white behind a transparent page and t…
ambroise-leclerc Nov 18, 2026
a5c5a39
Report the pixel read by the WKWebView background test (#611)
ambroise-leclerc Nov 18, 2026
cdf5dbf
Check the WKWebView background through its state, not through unrelia…
ambroise-leclerc Nov 18, 2026
d4db210
Give the developer environment's window its dark colour by default to…
ambroise-leclerc Nov 18, 2026
50db2fe
Address review follow-ups: changelog wording, late first-frame milest…
ambroise-leclerc Nov 18, 2026
896d52b
Make the WKWebView window non-opaque for a translucent background and…
ambroise-leclerc Nov 18, 2026
d4c2ce1
Merge pull request #612 from ambroise-leclerc/611-native-startup
AM-L Nov 18, 2026
f5b4b74
Add optional native pseudoterminals (#613)
ambroise-leclerc Nov 19, 2026
9fcbcde
Harden PTY lifecycle and address review feedback (#613)
ambroise-leclerc Nov 19, 2026
f9cc158
Fix hardened PTY build and Windows interrupt probe (#613)
ambroise-leclerc Nov 19, 2026
fb3ae10
Stabilize desktop CI discovery and DOM coroutine coverage
ambroise-leclerc Nov 19, 2026
2ed16cd
Accept ConPTY cursor positioning in the browser regression
ambroise-leclerc Nov 19, 2026
9146463
Move PTY launch off the server and finish lifecycle review
ambroise-leclerc Nov 19, 2026
8351204
Check PTY shell output independently of ANSI layout
ambroise-leclerc Nov 19, 2026
e40133d
Merge pull request #614 from ambroise-leclerc/613-native-pty
AM-L Nov 19, 2026
60539c6
Add the start-up time test, the font stack hint and CEF's background …
ambroise-leclerc Nov 19, 2026
2d795cd
Address the review of the start-up test and the font stack hint (#611)
ambroise-leclerc Nov 19, 2026
3a95bd7
Isolate start-up scratch directories per frontend and key font checks…
ambroise-leclerc Nov 19, 2026
2a30f55
Time the whole start, clamp CEF alpha and recheck edited stylesheets …
ambroise-leclerc Nov 19, 2026
e41c62d
Fix MSVC build of the font hint, isolate the WebView2 start-up profil…
ambroise-leclerc Nov 19, 2026
d621178
Format the stylesheet version without relying on the file clock's rep…
ambroise-leclerc Nov 19, 2026
2871384
Require the shown milestone, keep the file clock's own stamp and pars…
ambroise-leclerc Nov 19, 2026
3e83d61
Register the start-up tests only for frontends that declare STARTUP_T…
ambroise-leclerc Nov 19, 2026
4ec9cbb
Merge pull request #615 from ambroise-leclerc/611-startup-remaining
AM-L Nov 19, 2026
9f5ef28
Give the focus back to the developer terminal after a click on the pa…
ambroise-leclerc Nov 19, 2026
60e8180
Give the focus back only to the terminal that had it when a page hold…
ambroise-leclerc Nov 19, 2026
c0ea4b8
Judge the click by where the press started, not by an older selection…
ambroise-leclerc Nov 19, 2026
5ed7244
Find the terminal to refocus from the focus at the press, not from fo…
ambroise-leclerc Nov 19, 2026
392730a
Leave the focus to the field a label hands it to (#608)
ambroise-leclerc Nov 19, 2026
531d8cd
Share the workspace state with every terminal of the page (#608)
ambroise-leclerc Nov 19, 2026
0dec9a6
Check again, when the focus is given back, that the terminal still an…
ambroise-leclerc Nov 19, 2026
0ac0675
Answer POST on a dynamic route that opts in, with a body bounded by C…
ambroise-leclerc Nov 19, 2026
240220d
Name the 202 Accepted and 401 Unauthorized status codes (#619)
ambroise-leclerc Nov 19, 2026
e8887f1
Merge pull request #618 from ambroise-leclerc/608-terminal-focus
AM-L Nov 20, 2026
6427719
Answer 100 Continue only to an HTTP/1.1 Expect token, test the interi…
ambroise-leclerc Nov 20, 2026
6ec440d
Accept spaces and equal lists in Content-Length, read a POST body wit…
ambroise-leclerc Nov 20, 2026
f922d40
Accept optional whitespace in HTTP request headers (#621)
ambroise-leclerc Nov 20, 2026
5a078a3
Test controls before HTTP header values (#621)
ambroise-leclerc Nov 20, 2026
124aa1a
Use video without audio for HTTP playback regression (#621)
ambroise-leclerc Nov 20, 2026
9457e44
Bound CSS diagnostic reads and avoid GCC 13 iterator warning (#621)
ambroise-leclerc Nov 20, 2026
4890e2c
Merge pull request #622 from ambroise-leclerc/621-http-header-whitespace
AM-L Nov 20, 2026
321fbb4
Merge remote-tracking branch 'origin/develop' into 619-post-routes
ambroise-leclerc Nov 20, 2026
01706c5
Test Content-Length without a space after the colon and with tabs, no…
ambroise-leclerc Nov 20, 2026
393e8b0
Read a header line fold as one space and keep the POST body alive whi…
ambroise-leclerc Nov 20, 2026
e9241f7
Keep the changelog entry of the line fold to ASCII, as its format che…
ambroise-leclerc Nov 20, 2026
6bce8f4
Read Expect as a list of tokens, so 100-continue among several is ans…
ambroise-leclerc Nov 20, 2026
4dd03ab
Merge pull request #620 from ambroise-leclerc/619-post-routes
AM-L Nov 20, 2026
519cb2b
Document that Expect lists 100-continue among tokens, without case (#…
ambroise-leclerc Nov 20, 2026
b2e1704
Merge pull request #623 from ambroise-leclerc/619-expect-doc
AM-L Nov 20, 2026
7cffc35
Pin developer environment 1.0.1 (#624)
webfront-release[bot] Nov 20, 2026
bf680ee
Prepare WebFront 1.1.0 (#625)
ambroise-leclerc Nov 20, 2026
f3956e2
Merge remote-tracking branch 'origin/master' into release/1.1.0
ambroise-leclerc Nov 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ The README introduces WebFront through the Game of Life walkthrough, demonstrati
- `include/webfront/weblink/`: bridge message encoding and routing.
- `include/webfront/system/`: layered virtual filesystems and the embedded web resources, a closed list guarded by the `MinimalCoreAssets` CTest case (normative list and 150 KiB decoded budget in ADR-016; changing it means amending the ADR and `test/cmake/CheckMinimalCoreAssets.cmake` together).
- `include/webfront/frontend/`: system-browser, CEF, optional Windows WebView2 and macOS WKWebView frontend adapters.
- `examples/`: only Hello World (`hello-world/`), the host loop (`host-loop/`: an application that keeps its own loop, `app.start()` or a host thread beside a native window; it ray-traces a Boing Ball on the CPU or with an optional CUDA unit, see `docs/HOST_LOOP_EXAMPLE.md`) and Game of Life (`life/`, with console, developer and embedded stages, plus the `life/react/` variant with a C++ panel inside React).
- `examples/`: the default build includes Hello World (`hello-world/`), the host loop (`host-loop/`: an application that keeps its own loop, `app.start()` or a host thread beside a native window; it ray-traces a Boing Ball on the CPU or with an optional CUDA unit, see `docs/HOST_LOOP_EXAMPLE.md`) and Game of Life (`life/`, with console, developer and embedded stages, plus the `life/react/` variant with a C++ panel inside React). The standalone [PTY example](docs/PTY.md) has its own CMake entry point.
- `js/core/`: readable browser bridge, fallback and bootstrap loader compiled into `include/webfront/`, plus the embedding CMake modules; `js/developer/`: developer environment (its terminal and `wf`), the wf scripts that build it (`scripts/`), build and publication tools. The repository is itself a `wf` project (`js/developer/webfront.project.json` and its lock, selected with `--manifest-dir js/developer`): the environment builds itself, and its pure JavaScript specs (`test/developer/`) run with `wf test`. Production C++ remains header-only in `include/webfront/`.
- `js/developer/starters/`: the sources of the `app` starter and `agent-guide.md`, the `AGENTS.md` that `wf create` puts beside a starter and that `webfront_write_agent_guide()` (`cmake/WebFrontAgentGuide.cmake`) writes in a consuming project.
- `js/services/`: optional `@webfront/services` package, the browser side of the system services (ADR-020; a skeleton so far), built like `@webfront/react` by `wf run services-package`; outside the core's embedded resource list.
- `js/pty/`: optional `@webfront/pty` adapter for native pseudoterminals. `wf run pty-package` assembles the archive used by the browser tests. See `docs/PTY.md`.
- `js/react/`: optional `@webfront/react` package (`createStore`, `useStore`, `Island`), declarations and package-local license. `wf run react-package` assembles it; tests verify the exact archive installed by the registry. It is outside the core's embedded resource list.
- `test/fixtures/`, `test/web/fixtures/`: retained regression fixtures, not public example applications.
- `test/unit/`: C++ unit tests, written with `test/unit/Bdd.hpp` (a single-header BDD framework); `test/web/`: real-browser integration (`suite/` is the WebFront project of the Jasmine specs, run by `webtest` through `wf test`); `test/driver/`: `webfront-wf`, the non-interactive `wf` driver for tests; `test/fuzz/`, `test/fixtures/`; `test/cmake/`: CMake test scripts and sub-projects. The `RepositoryLayout` CTest case pins the tracked root.
Expand Down Expand Up @@ -116,7 +117,7 @@ Exception: a purely C++ change that reuses an existing encoding, introduces no n
## Coding and testing conventions

- Use C++23, four-space indentation, the `.clang-format` of the directory (`include/webfront/`, `test/`, `examples/`), and the naming rules in `.github/CONTRIBUTING.md`.
- Keep production implementation header-only under `include/`; `examples/` contains the three public examples; browser resources live in `js/`.
- Keep production implementation header-only under `include/`; browser resources live in `js/`.
- Prefer standard-library facilities and explicit ownership. Keep public headers ODR-safe (`inline`/templates as appropriate).
- Unit tests are named `const Scenario` objects whose `given`/`when`/`then` sections are lambdas, checked with `require`/`check` (`test/unit/Bdd.hpp`), and use deterministic mocks.
- Jasmine specs are the project `test/web/suite/`, built by esbuild-wasm and run by `wf test` under the locked `jasmine-core` (installed from the local registry by `WebSuiteInstall`); `webtest` is the `webfront-wf` driver plus the C++ callbacks of the specs. The specs tell C++ they are done (`specsFinished`), the process status is that of `wf test` (or 1 when C++ did not observe every call), and the CTest case has a timeout. The registry the suite installs from is built by `wf run test-registry` (the `TestRegistry` case), from the packages that configure downloaded.
Expand Down
1 change: 1 addition & 0 deletions README.fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@ L'installation de CMake elle-même ne demande pas de droits root. Répétez l'ex
- Les appels JavaScript vers C++ renvoient toujours des Promises. En C++, `ui.jsFunction(name)(...)` est sans retour ; `ui.jsFunction<R>(name)(...)` renvoie un `std::future<R>`. Fonction absente, exception, réponse mal formée et déconnexion font échouer l'appel typé. Les futures et Promises n'exposent pas d'annulation ; les senders typés proposent une annulation locale.
- Le pont transporte scalaires, chaînes, tuples, tableaux numériques typés, bitsets et listes homogènes de valeurs composées prises en charge. Il ne transporte pas d'objets arbitraires. Chaînes et messages sont bornés par la politique de taille (64 Mio par défaut) ; à partir de 65 536 octets, les chaînes utilisent l'encodage long.
- L'environnement de développement et l'accès aux fichiers du projet sont destinés au code local de confiance, sans sandbox. Seuls les paquets compatibles navigateur sont pris en charge ; ni scripts d'installation ni extensions natives ne sont exécutés. `wf check` vérifie les types séparément de la compilation.
- Le [pseudo-terminal natif](docs/PTY.md) relie un programme choisi par l’application à xterm.js sous Linux, macOS et Windows, après activation explicite.
- L'adaptateur optionnel [`@webfront/react`](docs/REACT.md) apporte stores C++ avec regroupement des mises à jour et îlots React. `WebFrontLifeReact` montre un panneau C++ dans React ; son archive est préparée localement pour publication au registre.
- Linux embarqué dispose d'une CI ARM64 et de preuves sur Orin Nano. Les autres cartes, cibles sans OS et microcontrôleurs ne sont pas qualifiés globalement. Le transport local ne fournit ni TLS ni authentification client ; un accès distant demande une conception de sécurité propre à l'application.
- Packaging, accessibilité et déploiement des moteurs natifs restent propres au produit. L'[état du projet](docs/PROJECT_STATUS.md) fait référence pour les validations et limites ; l'[historique](docs/CHANGELOG.md) décrit les migrations et ruptures de compatibilité.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,7 @@ CI exercises C++ and native-browser paths on Windows, macOS and Linux. Extended
- JavaScript calls to C++ always return Promises. C++ `ui.jsFunction(name)(...)` is fire-and-forget; `ui.jsFunction<R>(name)(...)` returns `std::future<R>`. Missing functions, exceptions, malformed replies and disconnects fail the typed call.
- The binary bridge supports scalars, strings, tuples, numeric typed arrays, packed bitsets and homogeneous lists of supported compound values. Arbitrary objects do not cross it. Strings and messages are bounded by the message-size policy (64 MiB by default); strings of 65,536 bytes or more use the long-string encoding. See [the bridge contract](docs/adr/ADR-003-protocole-binaire-et-bornes.md).
- Development project access is explicit and intended for trusted local code. Downloaded tools run with the application's bridge authority, and script permissions frame only the `context` API: neither is a sandbox. Only packages that run in a browser are supported; installation scripts and native add-ons are not executed. Builds transform TypeScript without type checking; `wf check` type-checks with the compiler the project locks.
- An opt-in [native pseudoterminal](docs/PTY.md) connects an application-selected program to xterm.js on Linux, macOS and Windows.
- The optional [`@webfront/react` adapter](docs/REACT.md) supplies coalesced C++ stores and empty React islands. `WebFrontLifeReact` demonstrates a C++ panel within the Game of Life React UI; its package archive is prepared locally for registry publication.
- Embedded Linux has ARM64 CI coverage and specific Orin Nano board evidence; other boards, bare-metal targets and microcontrollers are not generally qualified. Check C++23, memory, networking and browser requirements for your target. The default local transport supplies neither TLS nor client authentication; remote deployment needs an application-specific security design.
- Packaging, accessibility and native-engine deployment still need application-specific work. The optional [`ui.document()` API](docs/DOM.md) provides DOM islands, automatically batched writes, event callbacks and grouped sender reads. See [project status](docs/PROJECT_STATUS.md) for known limitations.
Expand Down
10 changes: 10 additions & 0 deletions cmake/BoingCuda.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# default one, CMAKE_CUDA_HOST_COMPILER (or the CUDAHOSTCXX environment variable) names another.
set(WEBFRONT_HOST_LOOP_CUDA "AUTO" CACHE STRING "CUDA renderer of the host-loop example: AUTO (when a working toolkit is found), ON or OFF")
set_property(CACHE WEBFRONT_HOST_LOOP_CUDA PROPERTY STRINGS AUTO ON OFF)
set(_WEBFRONT_BOING_CUDA_DIR "${CMAKE_CURRENT_LIST_DIR}")

# A macro: enable_language() must run in the scope of the top-level CMakeLists.txt, above every directory whose
# targets link the CUDA unit. Defines WebFront_boing, which a target computing the scene links: nothing on a CPU-only
Expand All @@ -15,6 +16,11 @@ macro(webfront_enable_host_loop_cuda)
message(FATAL_ERROR "WEBFRONT_HOST_LOOP_CUDA must be AUTO, ON or OFF, not '${WEBFRONT_HOST_LOOP_CUDA}'")
endif()
set(WEBFRONT_HOST_LOOP_CUDA_ENABLED OFF)
# Record the choice before enable_language initializes its own compiler-dependent default.
set(_webfront_cuda_architectures_explicit FALSE)
if(DEFINED CMAKE_CUDA_ARCHITECTURES OR (DEFINED ENV{CUDAARCHS} AND NOT "$ENV{CUDAARCHS}" STREQUAL ""))
set(_webfront_cuda_architectures_explicit TRUE)
endif()
if(WEBFRONT_HOST_LOOP_CUDA STREQUAL "ON")
enable_language(CUDA)
set(WEBFRONT_HOST_LOOP_CUDA_ENABLED ON)
Expand All @@ -27,6 +33,10 @@ macro(webfront_enable_host_loop_cuda)
endif()
endif()
if(WEBFRONT_HOST_LOOP_CUDA_ENABLED)
if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA")
include("${_WEBFRONT_BOING_CUDA_DIR}/BoingCudaArchitectures.cmake")
webfront_cuda_select_default("${_webfront_cuda_architectures_explicit}" "${CMAKE_CUDA_COMPILER}")
endif()
message(STATUS "Host-loop example: CUDA ${CMAKE_CUDA_COMPILER_VERSION} renderer enabled (${CMAKE_CUDA_COMPILER})")
else()
message(STATUS "Host-loop example: CPU renderer only (WEBFRONT_HOST_LOOP_CUDA=${WEBFRONT_HOST_LOOP_CUDA}, no working CUDA compiler)")
Expand Down
51 changes: 51 additions & 0 deletions cmake/BoingCudaArchitectures.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Select only installed GPUs for which nvcc can emit native machine code. A matching cubin avoids depending on the
# driver's PTX compiler, which may be older than the toolkit. Empty means detection could not make a safe choice.
function(webfront_cuda_native_architectures devices compiler_codes output)
string(REPLACE "\r" "" devices "${devices}")
string(REPLACE "\n" ";" devices "${devices}")
string(REPLACE "\r" "" compiler_codes "${compiler_codes}")
string(REPLACE "\n" ";" compiler_codes "${compiler_codes}")
set(architectures)
foreach(device IN LISTS devices)
string(STRIP "${device}" device)
if(device MATCHES "^([0-9]+)\\.([0-9]+)$")
set(arch "${CMAKE_MATCH_1}${CMAKE_MATCH_2}")
if("sm_${arch}" IN_LIST compiler_codes)
list(APPEND architectures "${arch}")
endif()
endif()
endforeach()
list(REMOVE_DUPLICATES architectures)
set(${output} "${architectures}" PARENT_SCOPE)
endfunction()

function(webfront_cuda_detect_native compiler output)
set(${output} "" PARENT_SCOPE)
if(CMAKE_CROSSCOMPILING)
return()
endif()
find_program(_webfront_nvidia_smi NAMES nvidia-smi)
if(NOT _webfront_nvidia_smi)
return()
endif()
execute_process(COMMAND "${_webfront_nvidia_smi}" --query-gpu=compute_cap --format=csv,noheader
RESULT_VARIABLE device_result OUTPUT_VARIABLE devices ERROR_QUIET TIMEOUT 5)
execute_process(COMMAND "${compiler}" --list-gpu-code
RESULT_VARIABLE compiler_result OUTPUT_VARIABLE codes ERROR_QUIET TIMEOUT 5)
if(device_result STREQUAL "0" AND compiler_result STREQUAL "0")
webfront_cuda_native_architectures("${devices}" "${codes}" architectures)
set(${output} "${architectures}" PARENT_SCOPE)
endif()
endfunction()

function(webfront_cuda_select_default explicit_choice compiler)
if(explicit_choice OR CMAKE_CROSSCOMPILING)
return()
endif()
webfront_cuda_detect_native("${compiler}" architectures)
if(architectures)
set(CMAKE_CUDA_ARCHITECTURES "${architectures}" CACHE STRING "CUDA architectures" FORCE)
set(CMAKE_CUDA_ARCHITECTURES "${architectures}" PARENT_SCOPE)
message(STATUS "Host-loop example: native CUDA architectures ${architectures}")
endif()
endfunction()
34 changes: 28 additions & 6 deletions cmake/Frontends.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ macro(_webfront_load_frontends)
get_property(WEBFRONT_FRONTEND_REGISTRY GLOBAL PROPERTY WEBFRONT_FRONTEND_REGISTRY)
endif()
foreach(_wf_entry IN LISTS WEBFRONT_FRONTEND_REGISTRY)
foreach(_wf_field OPTION POLICY DESCRIPTION SUPPORT SUPPORT_FILE SETUP TEST_SETUP TEST_NAME TEST_TIMEOUT PLATFORMS TEST_PLATFORMS XVFB_LINUX NATIVE)
foreach(_wf_field OPTION POLICY DESCRIPTION SUPPORT SUPPORT_FILE SETUP TEST_SETUP TEST_NAME TEST_TIMEOUT PLATFORMS TEST_PLATFORMS XVFB_LINUX NATIVE STARTUP_TRACE)
get_property(WEBFRONT_FRONTEND_${_wf_entry}_${_wf_field} GLOBAL
PROPERTY WEBFRONT_FRONTEND_${_wf_entry}_${_wf_field})
endforeach()
Expand All @@ -36,7 +36,7 @@ function(webfront_register_frontend name)
if(NOT "${name}" MATCHES "^[A-Za-z_][A-Za-z0-9_]*$")
message(FATAL_ERROR "Frontend name '${name}' must be a C++ identifier")
endif()
cmake_parse_arguments(PARSE_ARGV 1 ARG "XVFB_LINUX;ALWAYS_AVAILABLE;NATIVE" "OPTION;POLICY;DESCRIPTION;SUPPORT;SETUP;TEST_SETUP;TEST_NAME;TEST_TIMEOUT" "PLATFORMS;TEST_PLATFORMS")
cmake_parse_arguments(PARSE_ARGV 1 ARG "XVFB_LINUX;ALWAYS_AVAILABLE;NATIVE;STARTUP_TRACE" "OPTION;POLICY;DESCRIPTION;SUPPORT;SETUP;TEST_SETUP;TEST_NAME;TEST_TIMEOUT" "PLATFORMS;TEST_PLATFORMS")
if(name IN_LIST WEBFRONT_FRONTEND_REGISTRY)
message(FATAL_ERROR "Frontend '${name}' is already registered")
endif()
Expand Down Expand Up @@ -98,11 +98,14 @@ function(webfront_register_frontend name)
if(ARG_NATIVE)
message(FATAL_ERROR "Frontend '${name}' cannot use NATIVE without OPTION")
endif()
if(ARG_STARTUP_TRACE)
message(FATAL_ERROR "Frontend '${name}' cannot use STARTUP_TRACE without OPTION")
endif()
endif()
list(APPEND WEBFRONT_FRONTEND_REGISTRY "${name}")
set_property(GLOBAL PROPERTY WEBFRONT_FRONTEND_REGISTRY "${WEBFRONT_FRONTEND_REGISTRY}")
set(WEBFRONT_FRONTEND_REGISTRY "${WEBFRONT_FRONTEND_REGISTRY}" PARENT_SCOPE)
foreach(field OPTION POLICY DESCRIPTION SUPPORT SUPPORT_FILE SETUP TEST_SETUP TEST_NAME TEST_TIMEOUT PLATFORMS TEST_PLATFORMS XVFB_LINUX NATIVE)
foreach(field OPTION POLICY DESCRIPTION SUPPORT SUPPORT_FILE SETUP TEST_SETUP TEST_NAME TEST_TIMEOUT PLATFORMS TEST_PLATFORMS XVFB_LINUX NATIVE STARTUP_TRACE)
set_property(GLOBAL PROPERTY WEBFRONT_FRONTEND_${name}_${field} "${ARG_${field}}")
set(WEBFRONT_FRONTEND_${name}_${field} "${ARG_${field}}" PARENT_SCOPE)
endforeach()
Expand Down Expand Up @@ -184,19 +187,19 @@ endfunction()

webfront_register_frontend(DefaultBrowser ALWAYS_AVAILABLE)
webfront_register_frontend(WebView2
NATIVE OPTION WEBFRONT_EMBED_WEBVIEW2 POLICY strict
NATIVE STARTUP_TRACE OPTION WEBFRONT_EMBED_WEBVIEW2 POLICY strict
DESCRIPTION "Download the pinned WebView2 SDK and link its static loader (Windows only)"
PLATFORMS Windows SUPPORT WebView2Support
TEST_PLATFORMS Windows TEST_NAME WebFrontWebView2Integration TEST_TIMEOUT 90
TEST_SETUP webfront_add_webview2_tests)
webfront_register_frontend(WKWebView
NATIVE OPTION WEBFRONT_EMBED_WKWEBVIEW POLICY strict
NATIVE STARTUP_TRACE OPTION WEBFRONT_EMBED_WKWEBVIEW POLICY strict
DESCRIPTION "Link the system Cocoa and WebKit frameworks for WKWebViewFrontend (macOS 13.3+ only)"
PLATFORMS Darwin SUPPORT WKWebViewSupport
TEST_PLATFORMS Darwin TEST_NAME WebFrontWKWebViewIntegration TEST_TIMEOUT 90
TEST_SETUP webfront_add_wkwebview_tests)
webfront_register_frontend(WebKitGTK
NATIVE OPTION WEBFRONT_EMBED_WEBKITGTK POLICY strict
NATIVE STARTUP_TRACE OPTION WEBFRONT_EMBED_WEBKITGTK POLICY strict
DESCRIPTION "Enable the system WebKitGTK 6.0 embedded frontend (Linux only)"
PLATFORMS Linux SUPPORT WebKitGTKSupport
TEST_PLATFORMS Linux TEST_NAME WebFrontWebKitGTKIntegration TEST_TIMEOUT 90 XVFB_LINUX
Expand Down Expand Up @@ -448,6 +451,25 @@ function(webfront_add_browser_tests target frontend assets_directory lifecycle_t
webfront_set_browser_test_properties("${lifecycle_name}" "${assets_directory}"
"${WEBFRONT_FRONTEND_${frontend}_TEST_TIMEOUT}")
endforeach()
# Start-up time of the native windows, cold and warm (#611), only for a frontend that declared STARTUP_TRACE: the
# script reads the `WebFront startup: window shown at <ms> ms` milestone that WEBFRONT_STARTUP_TRACE=1 prints.
if(WEBFRONT_FRONTEND_${frontend}_STARTUP_TRACE)
foreach(temperature cold warm)
set(startup_name "${frontend}StartupTime-${temperature}")
set(startup_limit 10000)
if(temperature STREQUAL "warm")
set(startup_limit 5000)
endif()
add_test(NAME ${startup_name} COMMAND "${CMAKE_COMMAND}"
"-DPROGRAM=${lifecycle_command}" "-DWORK_DIRECTORY=${assets_directory}"
"-DSCRATCH=${CMAKE_CURRENT_BINARY_DIR}/startup-${frontend}-${temperature}"
-DTEMPERATURE=${temperature} -DLIMIT_MS=${startup_limit}
-P "${PROJECT_SOURCE_DIR}/test/cmake/RunStartupTime.cmake")
list(APPEND shared_tests "${startup_name}")
webfront_set_browser_test_properties("${startup_name}" "${assets_directory}" 180)
set_property(TEST ${startup_name} APPEND PROPERTY LABELS startup)
endforeach()
endif()
if(NOT ARG_SKIP_JASMINE)
set(name "${WEBFRONT_FRONTEND_${frontend}_TEST_NAME}")
add_test(NAME ${name} COMMAND ${command} ${ARG_ARGUMENTS})
Expand Down
Loading
Loading