fix(webview): update native callback lifetime and test coverage instrumentation

This commit is contained in:
Levi committed 2026-09-18 09:00:50 +08:00
1 parent b33c00d90d
commit 1b00a16277
3 files changed
+7 -7

No files matched your search

+4 -6
View File
@@ -96,16 +96,14 @@ jobs:
run: |
sudo apt-get update -y
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev xvfb
- name: Resolve native crash address
- name: Test webview
if: runner.os == 'Linux'
# Match the full suite's coverage instrumentation and repeat on the same
# GTK event loop to catch queued callbacks after engine destruction.
run: |
PACKAGES=$(go list ./... | awk '!/\/bind\// && (!/\/cmd\// || /\/cmd\/web$/)')
go test -c -tags webview -coverpkg=$(echo "$PACKAGES" | paste -sd "," -) -covermode=count -o "$RUNNER_TEMP/goprovider.test" ./internal/webview/goprovider
addr2line -a -f -C -e "$RUNNER_TEMP/goprovider.test" 0xaaddaf
- name: Test webview
if: runner.os == 'Linux'
# Repeat on the same GTK event loop to catch callbacks after destruction.
run: xvfb-run -a go test -tags webview -v -count=5 -timeout 300s ./internal/webview/goprovider/
xvfb-run -a "$RUNNER_TEMP/goprovider.test" -test.v -test.count=5 -test.timeout=300s -test.coverprofile="$RUNNER_TEMP/webview-coverage.out"
env:
CGO_ENABLED: 1
- name: Test webview