mirror of
https://github.com/black-ant/Ant-Browser.git
synced 2026-07-14 18:48:55 +08:00
channel: master version: 1.1.0 source-ref: master published-at-utc: 2026-03-20T14:14:07Z
28 lines
676 B
Go
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")
|
|
}
|
|
}
|