test(cef): specify subprocess runtime propagation
- commit
- eee76d73991e94880fc73913d257eefa82e1c317
- author
- brice · · 2026-07-14 07:37 UTC
- committer
- brice · · 2026-07-14 09:35 UTC
- parent
- 0eb3b66
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
1 file · +16 -0
M internal/infrastructure/cef/engine_init_test.go +16 -0
| @@ -36,6 +36,22 @@ func TestResolvedStateRoot_UsesProfileDefault(t *testing.T) { | |||
| 36 | 36 | require.Equal(t, profile.CEFUserDataDir(), root) | |
| 37 | 37 | } | |
| 38 | 38 | ||
| 39 | + | func TestConfigureCEFSubprocessRuntime_PropagatesConfiguredRuntimeBeforeInit(t *testing.T) { | |
| 40 | + | t.Setenv("CEF_DIR", "") | |
| 41 | + | ||
| 42 | + | runtime := filepath.Join(t.TempDir(), "cef-147") | |
| 43 | + | require.Equal(t, runtime, configureCEFSubprocessRuntime(runtime)) | |
| 44 | + | require.Equal(t, runtime, os.Getenv("CEF_DIR")) | |
| 45 | + | } | |
| 46 | + | ||
| 47 | + | func TestConfigureCEFSubprocessRuntime_PreservesExplicitEnvironmentOverride(t *testing.T) { | |
| 48 | + | explicitRuntime := filepath.Join(t.TempDir(), "cef-env") | |
| 49 | + | t.Setenv("CEF_DIR", explicitRuntime) | |
| 50 | + | ||
| 51 | + | require.Equal(t, explicitRuntime, configureCEFSubprocessRuntime(filepath.Join(t.TempDir(), "cef-config"))) | |
| 52 | + | require.Equal(t, explicitRuntime, os.Getenv("CEF_DIR")) | |
| 53 | + | } | |
| 54 | + | ||
| 39 | 55 | func TestPrepareCEFSettings_UsesResolvedProfilePaths(t *testing.T) { | |
| 40 | 56 | logger := zerolog.Nop() | |
| 41 | 57 | profile := testCEFDevProfile(t) | |
| @@ -36,6 +36,22 @@ func TestResolvedStateRoot_UsesProfileDefault(t *testing.T) { | |||||
| 36 | require.Equal(t, profile.CEFUserDataDir(), root) | 36 | require.Equal(t, profile.CEFUserDataDir(), root) | ||
| 37 | } | 37 | } | ||
| 38 | 38 | ||||
| 39 | + | func TestConfigureCEFSubprocessRuntime_PropagatesConfiguredRuntimeBeforeInit(t *testing.T) { | |||
| 40 | + | t.Setenv("CEF_DIR", "") | |||
| 41 | + | ||||
| 42 | + | runtime := filepath.Join(t.TempDir(), "cef-147") | |||
| 43 | + | require.Equal(t, runtime, configureCEFSubprocessRuntime(runtime)) | |||
| 44 | + | require.Equal(t, runtime, os.Getenv("CEF_DIR")) | |||
| 45 | + | } | |||
| 46 | + | ||||
| 47 | + | func TestConfigureCEFSubprocessRuntime_PreservesExplicitEnvironmentOverride(t *testing.T) { | |||
| 48 | + | explicitRuntime := filepath.Join(t.TempDir(), "cef-env") | |||
| 49 | + | t.Setenv("CEF_DIR", explicitRuntime) | |||
| 50 | + | ||||
| 51 | + | require.Equal(t, explicitRuntime, configureCEFSubprocessRuntime(filepath.Join(t.TempDir(), "cef-config"))) | |||
| 52 | + | require.Equal(t, explicitRuntime, os.Getenv("CEF_DIR")) | |||
| 53 | + | } | |||
| 54 | + | ||||
| 39 | func TestPrepareCEFSettings_UsesResolvedProfilePaths(t *testing.T) { | 55 | func TestPrepareCEFSettings_UsesResolvedProfilePaths(t *testing.T) { | ||
| 40 | logger := zerolog.Nop() | 56 | logger := zerolog.Nop() | ||
| 41 | profile := testCEFDevProfile(t) | 57 | profile := testCEFDevProfile(t) | ||