mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-08-11 01:03:51 +08:00
✨ feat(native-window): 支持标签页拖出为原生独立窗口
- 支持 SQL、数据和结果标签拖出到跨显示器原生窗口 - 通过受认证 loopback bridge 复用主进程后端与状态 - 支持子窗口继续拆窗、聚焦、关闭、还原与异常退出恢复 - 补充多窗口协议、状态同步和跨平台回归测试
This commit is contained in:
37
internal/nativewindow/runtime_script_test.go
Normal file
37
internal/nativewindow/runtime_script_test.go
Normal file
@@ -0,0 +1,37 @@
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user