feat(launcher): complete Campaign LA11 pre-gate support
This commit is contained in:
parent
f881e5b467
commit
134edabed2
19 changed files with 433 additions and 55 deletions
|
|
@ -146,6 +146,78 @@ public sealed class LauncherStartupOptionsTests
|
|||
Assert.Equal(helperOptions.UpdateManifestUri, confirmationOptions.UpdateManifestUri);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DeferredSelfUpdateRestartRetainsIsolationWithoutResolvingDefaults()
|
||||
{
|
||||
string root = Path.GetFullPath(
|
||||
Path.Combine(Path.GetTempPath(), "acdream-la11-deferred"));
|
||||
string[] suffix =
|
||||
[
|
||||
"--config-dir", Path.Combine(root, "config"),
|
||||
"--data-dir", Path.Combine(root, "data"),
|
||||
"--cache-dir", Path.Combine(root, "cache"),
|
||||
"--update-manifest-uri", "http://127.0.0.1:43119/manifest.json",
|
||||
];
|
||||
|
||||
LauncherStartupOptions options = LauncherStartupOptions.Parse(
|
||||
["--acdream-self-update-deferred-v1", .. suffix],
|
||||
() => throw new InvalidOperationException(
|
||||
"canonical path resolver was touched"));
|
||||
|
||||
Assert.Equal(LauncherStartupMode.SelfUpdateDeferred, options.Mode);
|
||||
Assert.Equal(suffix, options.PublicArguments);
|
||||
Assert.Equal(Path.Combine(root, "config"), options.Paths.ConfigDirectory);
|
||||
Assert.Equal(Path.Combine(root, "data"), options.Paths.DataDirectory);
|
||||
Assert.Equal(Path.Combine(root, "cache"), options.Paths.CacheDirectory);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AvaloniaCompositionRetainsTheExactParsedOptionsAndPathSet()
|
||||
{
|
||||
string root = Path.GetFullPath(
|
||||
Path.Combine(Path.GetTempPath(), "acdream-la11-app-composition"));
|
||||
LauncherStartupOptions options = LauncherStartupOptions.Parse(
|
||||
[
|
||||
"--config-dir", Path.Combine(root, "config"),
|
||||
"--data-dir", Path.Combine(root, "data"),
|
||||
"--cache-dir", Path.Combine(root, "cache"),
|
||||
"--update-manifest-uri", "https://updates.example.test/manifest.json",
|
||||
],
|
||||
() => throw new InvalidOperationException(
|
||||
"canonical path resolver was touched"));
|
||||
|
||||
var app = new App(options);
|
||||
|
||||
Assert.Same(options, app.StartupOptions);
|
||||
Assert.Same(options.Paths, app.StartupOptions.Paths);
|
||||
Assert.Equal(
|
||||
new Uri("https://updates.example.test/manifest.json"),
|
||||
app.StartupOptions.UpdateManifestUri);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CompositionRejectsAnyBootstrapArgumentDrift()
|
||||
{
|
||||
var paths = new ApplicationPathSet("config", "data", "cache", null);
|
||||
LauncherStartupOptions options = LauncherStartupOptions.Parse(
|
||||
["--update-manifest-uri", "https://updates.example.test/manifest.json"],
|
||||
() => paths);
|
||||
|
||||
Program.RequireUnchangedPublicArguments(
|
||||
options,
|
||||
new SelfUpdateStartupResult(
|
||||
false,
|
||||
0,
|
||||
options.PublicArguments.ToArray()));
|
||||
Assert.Throws<InvalidOperationException>(() =>
|
||||
Program.RequireUnchangedPublicArguments(
|
||||
options,
|
||||
new SelfUpdateStartupResult(
|
||||
false,
|
||||
0,
|
||||
["--update-manifest-uri", "https://other.example.test/manifest.json"])));
|
||||
}
|
||||
|
||||
public static TheoryData<string[]> InvalidArguments()
|
||||
{
|
||||
string absolute = Path.GetFullPath(Path.Combine(Path.GetTempPath(), "acdream-la11"));
|
||||
|
|
@ -171,6 +243,10 @@ public sealed class LauncherStartupOptionsTests
|
|||
data.Add(["--update-manifest-uri", "file:///tmp/manifest.json"]);
|
||||
data.Add(
|
||||
["--update-manifest-uri", "https://user:secret@example.test/manifest.json"]);
|
||||
data.Add(
|
||||
["--update-manifest-uri", "https://example.test/manifest.json?token=secret"]);
|
||||
data.Add(
|
||||
["--update-manifest-uri", "https://example.test/manifest.json#fragment"]);
|
||||
data.Add(["--update-manifest-uri", "not-a-uri"]);
|
||||
data.Add(
|
||||
[
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue