mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-08-10 16:53:35 +08:00
- 支持 SQL、数据和结果标签拖出到跨显示器原生窗口 - 通过受认证 loopback bridge 复用主进程后端与状态 - 支持子窗口继续拆窗、聚焦、关闭、还原与异常退出恢复 - 补充多窗口协议、状态同步和跨平台回归测试
38 lines
1.1 KiB
Go
38 lines
1.1 KiB
Go
package nativewindow
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func TestBridgeWindowIDUsesChildIdentity(t *testing.T) {
|
|
bridge := newBridge(ChildOptions{ID: "workbench:query-1"})
|
|
if got := bridge.WindowID(); got != "workbench:query-1" {
|
|
t.Fatalf("WindowID() = %q, want %q", got, "workbench:query-1")
|
|
}
|
|
}
|
|
|
|
func TestRuntimeCommandsDoNotReloadBootstrapForWindowIdentity(t *testing.T) {
|
|
script := detachedRuntimeBridgeScript()
|
|
if !strings.Contains(script, "bridge.WindowID()") {
|
|
t.Fatal("runtime bridge does not read the lightweight window identity")
|
|
}
|
|
if strings.Contains(script, "detached.loadBootstrap().then(function (bootstrap)") {
|
|
t.Fatal("runtime command routing still reloads the full bootstrap payload")
|
|
}
|
|
}
|
|
|
|
func TestRuntimeExposesParentWindowManagerInsideDetachedChildren(t *testing.T) {
|
|
script := detachedRuntimeBridgeScript()
|
|
for _, expected := range []string{
|
|
"Manager: parentWindowManager",
|
|
"bridge.OpenWindow(request || {})",
|
|
"bridge.FocusWindow",
|
|
"bridge.CloseWindow",
|
|
} {
|
|
if !strings.Contains(script, expected) {
|
|
t.Fatalf("runtime bridge is missing %q", expected)
|
|
}
|
|
}
|
|
}
|