Switch from Asuka to MyGo, keeping the API client and the feature set: - servers: saved servers, passwordless and password login, proxy, self-signed certificates, per-server device tokens (Keystore), connect form, instance list sheet with switch/disconnect - sessions: virtualized list, search, new session, rename/archive/delete, running indicator, event stream keeps it live - chat: pushed window with system back bar, streaming Markdown via ui/markdown, reasoning and tool rows with image previews, footer menu (read aloud via a Kotlin TTS plugin, copy, fork), user message menu (copy, revert, fork), context usage ring and detail sheet, attachments (photos/files via the document picker), permissions - release builds allow plain http:// LAN servers (Go's net/http dials directly, no cleartext manifest needed) - a local fork of MyGo (third_party/mygo) lowers the Android host's minSdk to 24 (Android 7.0); Go 1.27.4 via mise Version 0.3.0.
45 lines
1.5 KiB
Go
45 lines
1.5 KiB
Go
//go:build windows && (amd64 || arm64) && !mygo_nowebview
|
|
|
|
package windows
|
|
|
|
import "testing"
|
|
|
|
// TestLoaderVariables checks the user data folder and the arguments taken
|
|
// from WebView2's environment variables, as Microsoft's loader takes them.
|
|
// Only a relative folder asks for the executable's directory.
|
|
func TestLoaderVariables(t *testing.T) {
|
|
const (
|
|
exeDir = `C:\Apps\MyGo`
|
|
userData = `C:\Users\test\WebView2`
|
|
args = "--remote-debugging-port=0"
|
|
)
|
|
for _, tt := range []struct {
|
|
name, folder, args, wantDir string
|
|
wantExeDir bool
|
|
}{
|
|
{"neither variable", "", "", userData, false},
|
|
{"absolute folder", `D:\Profiles\MyGo`, "", `D:\Profiles\MyGo`, false},
|
|
{"relative folder", `profiles\test`, "", `C:\Apps\MyGo\profiles\test`, true},
|
|
{"arguments only", "", args, userData, false},
|
|
{"both", `profiles\test`, args, `C:\Apps\MyGo\profiles\test`, true},
|
|
} {
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
vars := map[string]string{
|
|
"WEBVIEW2_USER_DATA_FOLDER": tt.folder,
|
|
"WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS": tt.args,
|
|
}
|
|
asked := false
|
|
dir, args := loaderVariables(func(key string) string { return vars[key] }, func() string {
|
|
asked = true
|
|
return exeDir
|
|
}, userData)
|
|
if dir != tt.wantDir || args != tt.args {
|
|
t.Errorf("loaderVariables = (%q, %q), want (%q, %q)", dir, args, tt.wantDir, tt.args)
|
|
}
|
|
if asked != tt.wantExeDir {
|
|
t.Errorf("asked for the executable's directory: %v, want %v", asked, tt.wantExeDir)
|
|
}
|
|
})
|
|
}
|
|
}
|