Files
Ant-Browser/backend/app_close_behavior_test.go
Ant Browser Release Bot fc5a6fadbe publish: 1.1.0 snapshot (ff46de5)
channel: master
version: 1.1.0
source-ref: master
published-at-utc: 2026-03-20T14:14:07Z
2026-03-20 22:14:08 +08:00

28 lines
676 B
Go

package backend
import (
"context"
goruntime "runtime"
"testing"
)
func TestPlatformSupportsTrayCloseFlowForOS(t *testing.T) {
if !platformSupportsTrayCloseFlowForOS("windows") {
t.Fatal("expected Windows to keep tray close flow enabled")
}
if platformSupportsTrayCloseFlowForOS("linux") {
t.Fatal("expected Linux to skip tray close flow")
}
}
func TestShouldBlockClose_NonWindowsDoesNotIntercept(t *testing.T) {
if goruntime.GOOS == "windows" {
t.Skip("Windows keeps the tray-based close confirmation flow")
}
app := NewApp("")
if ShouldBlockClose(app, context.Background()) {
t.Fatal("expected non-Windows close to proceed without interception")
}
}