diff --git a/docs/RFCs/017-TestHost-Launcher.md b/docs/RFCs/017-TestHost-Launcher.md index a77aab427a..df738c70f4 100644 --- a/docs/RFCs/017-TestHost-Launcher.md +++ b/docs/RFCs/017-TestHost-Launcher.md @@ -265,23 +265,48 @@ public Task LaunchTestHostAsync( string aumid = AppxManifest.ResolveAumid(context.FileName); // 2. Activate, passing the SAME args the platform prepared. AUMID activation takes a single - // command-line string, so the launcher must escape/quote context.Arguments (e.g. with a - // PasteArguments-style helper) to preserve what ProcessStartInfo.ArgumentList would have done. + // string. Full-trust desktop apps need Windows argv quoting; AppContainer apps need a versioned + // opaque payload that Application.OnLaunched restores before CreateBuilderAsync. var aam = (IApplicationActivationManager)new ApplicationActivationManager(); - aam.ActivateApplication(aumid, PasteArguments(context.Arguments), ACTIVATEOPTIONS.AO_NONE, out uint pid); + string activationArguments; + string? activationPayloadPath = null; + if (manifest.UsesLaunchActivationArguments) + { + PackagedAppActivationData activationData = PackagedAppActivationArguments.Create( + context.Arguments, + manifest.LocalStateDirectory); + activationArguments = activationData.Arguments; + activationPayloadPath = activationData.PayloadPath; + } + else + { + activationArguments = PasteArguments(context.Arguments); + } + + aam.ActivateApplication(aumid, activationArguments, ACTIVATEOPTIONS.AO_NONE, out uint pid); // 3. Wrap the activated app. AUMID activation cannot set per-launch environment variables, so the // launcher must bridge the values the host needs from context.EnvironmentVariables (the // MONITORTOHOST pipe name, correlation id, etc.) another way — e.g. activation arguments or a // broker process the activated app reads on startup. The handle surfaces the activated PID as // its (diagnostic-only) Identifier. - return Task.FromResult(new ActivatedAppHandle(pid)); + return Task.FromResult(new ActivatedAppHandle(pid, activationPayloadPath)); } ``` > Note: enabling the controller→host pipe across the AppContainer sandbox requires a loopback/pipe-ACL -> step (e.g. `CheckNetIsolation LoopbackExempt` or granting the package SID on the pipe). That belongs -> to the package/deploy extension, not the platform. +> step that grants the exact package SID access to the named pipe. Argument delivery and pipe +> authorization are deliberately separate: the reference packaged-app extension restores the opaque +> `LaunchActivatedEventArgs.Arguments` through a reusable bootstrap, while [#10486](https://github.com/microsoft/testfx/issues/10486) +> tracks the least-privilege pipe ACL. `CheckNetIsolation LoopbackExempt` is for network loopback and +> does not authorize named pipes. + +For launch activation, Windows documents a 2,048-character argument envelope on +`SecondaryTile.Arguments`, one of the sources surfaced as `LaunchActivatedEventArgs.Arguments`. +The reference extension keeps payloads within that proven envelope inline. Larger MTP argument arrays +spill to a one-shot package `LocalState` file as authenticated ciphertext, with the random per-launch +key carried only in the activation string. This avoids plaintext persistence of filters, runsettings, +or secrets while preserving exact argument order and values. ### 2. Launch under a debugger diff --git a/docs/glossary.md b/docs/glossary.md index 03d09cd3e2..d7e3963e90 100644 --- a/docs/glossary.md +++ b/docs/glossary.md @@ -375,7 +375,7 @@ An experimental MTP extension (`Microsoft.Testing.Extensions.Logging`, `[TPEXP]` ### Microsoft.Testing.Extensions.PackagedApp -An MTP extension (`Microsoft.Testing.Extensions.PackagedApp`) that enables testing packaged Windows apps (full-trust MSIX desktop, e.g. packaged WinUI) by registering the layout with the `PackageManager` and activating it by AUMID through the [ITestHostLauncher](#itesthostlauncher) extension point, rather than a plain `Process.Start`. Register via `builder.AddPackagedAppDeployment()`, or simply by referencing the package (its MSBuild props register the hook). The launcher only enables itself when the test application is a packaged layout — a manifest in the app's own directory, or an ancestor `AppxManifest.xml` whose `Application/@Executable` resolves back to the app directory — so referencing it from an **unpackaged** app does not force the test host controller process model or copy the build output; `TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER` (`auto`/`always`/`never`) overrides that decision. Introduced in [PR #9454](https://github.com/microsoft/testfx/pull/9454); AUMID activation added in [PR #9970](https://github.com/microsoft/testfx/pull/9970). See also [ITestHostLauncher](#itesthostlauncher) and [docs/winui-testing.md](winui-testing.md). +An MTP extension (`Microsoft.Testing.Extensions.PackagedApp`) that enables testing packaged Windows apps by registering the layout with the `PackageManager` and activating it by AUMID through the [ITestHostLauncher](#itesthostlauncher) extension point, rather than a plain `Process.Start`. `packagedClassicApp`/`win32App` hosts receive normal `argv` (including classic AppContainer hosts); `windowsApp`/UWP hosts call `PackagedAppExtensions.GetTestApplicationArguments(LaunchActivatedEventArgs.Arguments)` before creating the MTP builder to restore the same logical arguments. Register via `builder.AddPackagedAppDeployment()`, or simply by referencing the package (its MSBuild props register the hook). The launcher only enables itself when the test application is a packaged layout — a manifest in the app's own directory, or an ancestor `AppxManifest.xml` whose `Application/@Executable` resolves back to the app directory — so referencing it from an **unpackaged** app does not force the test host controller process model or copy the build output; `TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER` (`auto`/`always`/`never`) overrides that decision. AppContainer pipe authorization is implemented independently from argument delivery and tracked by [#10486](https://github.com/microsoft/testfx/issues/10486). Introduced in [PR #9454](https://github.com/microsoft/testfx/pull/9454); AUMID activation added in [PR #9970](https://github.com/microsoft/testfx/pull/9970). See also [ITestHostLauncher](#itesthostlauncher) and [docs/winui-testing.md](winui-testing.md). ## N diff --git a/docs/winui-testing.md b/docs/winui-testing.md index 47614e94ff..5dca65ad94 100644 --- a/docs/winui-testing.md +++ b/docs/winui-testing.md @@ -110,10 +110,32 @@ Requirements and limitations: - Target a Windows TFM at platform version `10.0.19041.0` or higher (for example `net8.0-windows10.0.19041.0`) so NuGet resolves the Windows asset that contains the register-and-activate path. The plain `net8.0`/`net9.0` asset fails fast with an actionable message instead. - Registering an unsigned build-output layout requires **Developer Mode** (or sideloading) to be enabled on the machine. -- Only **full-trust packaged desktop** hosts are supported. True UWP/AppContainer hosts are not: activation arguments are not delivered as `argv` there, and the controller pipe is not granted the package SID. +- `packagedClassicApp`/`win32App` hosts receive MTP arguments as normal process `argv`, including classic hosts whose trust level is `appContainer`. +- `windowsApp`/UWP hosts receive one opaque string through `LaunchActivatedEventArgs.Arguments`. Restore the platform argument array with `PackagedAppExtensions.GetTestApplicationArguments(args.Arguments)` before `TestApplication.CreateBuilderAsync`; see [Launch activation](#launch-activation). +- End-to-end UWP/AppContainer execution remains dependent on granting the exact package SID access to the controller named pipe, tracked separately by [#10486](https://github.com/microsoft/testfx/issues/10486). Argument delivery from [#10485](https://github.com/microsoft/testfx/issues/10485) does not weaken that pipe ACL. See [#9933](https://github.com/microsoft/testfx/issues/9933) for the implementation of this path. +### Launch activation + +Unlike a packaged classic/Win32 app, a `windowsApp`/UWP app does not receive the string passed to `IApplicationActivationManager` as `argv`. Windows exposes it as one opaque value on the launch event. Use the package bootstrap from `OnLaunched` rather than adding a project-specific command-line parser. Classic AppContainer hosts continue to use their process arguments: + +```csharp +protected override async void OnLaunched(LaunchActivatedEventArgs args) +{ + string[] cliArgs = PackagedAppExtensions.GetTestApplicationArguments(args.Arguments); + ITestApplicationBuilder builder = await TestApplication.CreateBuilderAsync(cliArgs); + builder.AddSelfRegisteredExtensions(cliArgs); + using ITestApplication app = await builder.BuildAsync(); + Environment.ExitCode = await app.RunAsync(); + Exit(); +} +``` + +The launcher and bootstrap share a versioned, length-prefixed format that preserves empty values, whitespace, quotes, backslashes, Unicode, repeated options, and ordering. Arguments that fit the documented 2,048-character Windows launch envelope remain only in the activation string. Larger arrays use a one-shot `LocalState` payload encrypted with a random per-launch key carried in the activation string; the host consumes and deletes it before MTP starts, and the launcher handle removes it if startup fails. Runsettings, filters, and other user input are therefore never persisted in plaintext. + +This bootstrap also restores the existing controller connect-back environment handoff before MTP reads it. It cannot by itself authorize the AppContainer token on that pipe; [#10486](https://github.com/microsoft/testfx/issues/10486) is the remaining end-to-end dependency. + ## When does the PackagedApp launcher take over? Registering an *enabled* test host launcher switches the whole run to the test host controller (process restart) model, because a custom launcher only has an effect when an out-of-process test host is started. That is the right trade for a packaged app, but it is pure overhead for an app that just needs `Process.Start`. diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/ActivatedAppTestHostHandle.cs b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/ActivatedAppTestHostHandle.cs index 8086329c47..3a644ce693 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/ActivatedAppTestHostHandle.cs +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/ActivatedAppTestHostHandle.cs @@ -17,11 +17,13 @@ internal sealed class ActivatedAppTestHostHandle : ITestHostHandle { private readonly Process _process; private readonly string? _handshakePath; + private readonly string? _activationPayloadPath; - public ActivatedAppTestHostHandle(uint processId, string? handshakePath) + public ActivatedAppTestHostHandle(uint processId, string? handshakePath, string? activationPayloadPath) { _process = Process.GetProcessById((int)processId); _handshakePath = handshakePath; + _activationPayloadPath = activationPayloadPath; } public string? Identifier => _process.Id.ToString(CultureInfo.InvariantCulture); @@ -55,6 +57,8 @@ public void Dispose() { PackagedAppConnectBackHandshake.TryDelete(_handshakePath); } + + PackagedAppActivationArguments.TryDeletePayload(_activationPayloadPath); } } diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/AppxApplicationInfo.cs b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/AppxApplicationInfo.cs index 4d6c89aa1b..9ae0c027b4 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/AppxApplicationInfo.cs +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/AppxApplicationInfo.cs @@ -11,11 +11,12 @@ namespace Microsoft.Testing.Extensions.PackagedApp; /// internal sealed class AppxApplicationInfo { - internal AppxApplicationInfo(string id, string? executable, string appUserModelId) + internal AppxApplicationInfo(string id, string? executable, string appUserModelId, bool usesLaunchActivationArguments) { Id = id; Executable = executable; AppUserModelId = appUserModelId; + UsesLaunchActivationArguments = usesLaunchActivationArguments; } /// Gets the application id (the manifest's Application/@Id). @@ -33,4 +34,10 @@ internal AppxApplicationInfo(string id, string? executable, string appUserModelI /// application. /// public string AppUserModelId { get; } + + /// + /// Gets a value indicating whether this application receives launch arguments through + /// LaunchActivatedEventArgs.Arguments instead of process argv. + /// + public bool UsesLaunchActivationArguments { get; } } diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/AppxManifestInfo.cs b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/AppxManifestInfo.cs index 61c5f9fbd7..ceaf478557 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/AppxManifestInfo.cs +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/AppxManifestInfo.cs @@ -225,26 +225,90 @@ public static AppxManifestInfo ReadFromManifest(Stream manifestStream) string packageFamilyName = $"{name}_{ComputePublisherId(publisher)}"; + bool canRunFullTrust = root is not null + && root.Descendants() + .Any(static element => + element.Name.LocalName == "Capability" + && string.Equals(element.Attribute("Name")?.Value, "runFullTrust", StringComparison.OrdinalIgnoreCase)); + + List applicationElements = root?.Elements().FirstOrDefault(static e => e.Name.LocalName == "Applications")? + .Elements().Where(static e => e.Name.LocalName == "Application") + .ToList() + ?? []; + // A package may declare several applications, each with its own id (and AUMID). Capture them // all so the launcher can resolve the one matching the executable it was asked to launch, // instead of guessing with the first entry. - List applications = root?.Elements().FirstOrDefault(static e => e.Name.LocalName == "Applications")? - .Elements().Where(static e => e.Name.LocalName == "Application") + var applications = applicationElements .Select(application => { string? applicationId = application.Attribute("Id")?.Value; string? executable = application.Attribute("Executable")?.Value; + string? entryPoint = application.Attribute("EntryPoint")?.Value; + string? trustLevel = application.Attributes().FirstOrDefault(static attribute => attribute.Name.LocalName == "TrustLevel")?.Value; + string? runtimeBehavior = application.Attributes().FirstOrDefault(static attribute => attribute.Name.LocalName == "RuntimeBehavior")?.Value; + bool hasFullTrustCompanion = application.Descendants() + .Any(static element => + element.Name.LocalName == "Extension" + && string.Equals(element.Attribute("Category")?.Value, "windows.fullTrustProcess", StringComparison.OrdinalIgnoreCase)); return applicationId is null || applicationId.Length == 0 ? null - : new AppxApplicationInfo(applicationId, executable, $"{packageFamilyName}!{applicationId}"); + : new AppxApplicationInfo( + applicationId, + executable, + $"{packageFamilyName}!{applicationId}", + UsesLaunchActivationArguments( + entryPoint, + trustLevel, + runtimeBehavior, + canUsePackageFullTrustFallback: + canRunFullTrust + && applicationElements.Count == 1 + && !hasFullTrustCompanion)); }) .OfType() - .ToList() - ?? []; + .ToList(); return new AppxManifestInfo(name, publisher, applications); } + private static bool UsesLaunchActivationArguments( + string? entryPoint, + string? trustLevel, + string? runtimeBehavior, + bool canUsePackageFullTrustFallback) + { + // RuntimeBehavior determines the activation model. A packaged classic or Win32 application + // receives process argv even when its sandbox TrustLevel is appContainer. + if (string.Equals(runtimeBehavior, "packagedClassicApp", StringComparison.OrdinalIgnoreCase) + || string.Equals(runtimeBehavior, "win32App", StringComparison.OrdinalIgnoreCase) + || string.Equals(entryPoint, "Windows.FullTrustApplication", StringComparison.OrdinalIgnoreCase)) + { + return false; + } + + if (string.Equals(runtimeBehavior, "windowsApp", StringComparison.OrdinalIgnoreCase)) + { + return true; + } + + if (string.Equals(trustLevel, "appContainer", StringComparison.OrdinalIgnoreCase)) + { + return true; + } + + if (string.Equals(trustLevel, "mediumIL", StringComparison.OrdinalIgnoreCase)) + { + return false; + } + + // Legacy UWP manifests express AppContainer by omission. A package-wide runFullTrust capability + // is a safe fallback only for one application with no full-trust companion extension (the shape + // produced by packaged WinUI). Mixed packages and UWP apps with a windows.fullTrustProcess helper + // need application-specific desktop evidence. + return !canUsePackageFullTrustFallback; + } + /// /// Resolves the application whose test host the platform asked to launch, preferring the one whose /// declared executable resolves exactly to . A package may declare diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/InternalAPI/InternalAPI.Unshipped.txt b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/InternalAPI/InternalAPI.Unshipped.txt index c1dce813e9..925e8a8c64 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/InternalAPI/InternalAPI.Unshipped.txt +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/InternalAPI/InternalAPI.Unshipped.txt @@ -3,9 +3,10 @@ Microsoft.Testing.Platform.Helpers.PasteArguments static Microsoft.Testing.Platform.Helpers.PasteArguments.AppendArgument(System.Text.StringBuilder! stringBuilder, string! argument) -> void Microsoft.Testing.Extensions.PackagedApp.AppxApplicationInfo Microsoft.Testing.Extensions.PackagedApp.AppxApplicationInfo.AppUserModelId.get -> string! -Microsoft.Testing.Extensions.PackagedApp.AppxApplicationInfo.AppxApplicationInfo(string! id, string? executable, string! appUserModelId) -> void +Microsoft.Testing.Extensions.PackagedApp.AppxApplicationInfo.AppxApplicationInfo(string! id, string? executable, string! appUserModelId, bool usesLaunchActivationArguments) -> void Microsoft.Testing.Extensions.PackagedApp.AppxApplicationInfo.Executable.get -> string? Microsoft.Testing.Extensions.PackagedApp.AppxApplicationInfo.Id.get -> string! +Microsoft.Testing.Extensions.PackagedApp.AppxApplicationInfo.UsesLaunchActivationArguments.get -> bool Microsoft.Testing.Extensions.PackagedApp.AppxManifestInfo Microsoft.Testing.Extensions.PackagedApp.AppxManifestInfo.Applications.get -> System.Collections.Generic.IReadOnlyList! Microsoft.Testing.Extensions.PackagedApp.AppxManifestInfo.PackageFamilyName.get -> string! @@ -22,6 +23,15 @@ static Microsoft.Testing.Extensions.PackagedApp.AppxManifestInfo.ReadFromManifes static Microsoft.Testing.Extensions.PackagedApp.AppxManifestInfo.ReadFromManifest(string! manifestPath) -> Microsoft.Testing.Extensions.PackagedApp.AppxManifestInfo! Microsoft.Testing.Extensions.PackagedApp.PackagedAppConnectBackHandshake Microsoft.Testing.Extensions.PackagedApp.PackagedAppConnectBackReader +Microsoft.Testing.Extensions.PackagedApp.PackagedAppActivationArguments +Microsoft.Testing.Extensions.PackagedApp.PackagedAppActivationData +Microsoft.Testing.Extensions.PackagedApp.PackagedAppActivationData.Arguments.get -> string! +Microsoft.Testing.Extensions.PackagedApp.PackagedAppActivationData.PackagedAppActivationData(string! arguments, string? payloadPath) -> void +Microsoft.Testing.Extensions.PackagedApp.PackagedAppActivationData.PayloadPath.get -> string? +static Microsoft.Testing.Extensions.PackagedApp.PackagedAppActivationArguments.Create(System.Collections.Generic.IReadOnlyList! arguments, string! localStateDirectory) -> Microsoft.Testing.Extensions.PackagedApp.PackagedAppActivationData! +static Microsoft.Testing.Extensions.PackagedApp.PackagedAppActivationArguments.Read(string! activationArguments, string? localStateDirectory) -> string![]! +static Microsoft.Testing.Extensions.PackagedApp.PackagedAppActivationArguments.TryDeletePayload(string? payloadPath) -> void +static Microsoft.Testing.Extensions.PackagedApp.PackagedAppActivationArguments.TryDeleteStalePayloads(string! localStateDirectory, System.DateTime utcNow) -> void static Microsoft.Testing.Extensions.PackagedApp.PackagedAppConnectBackHandshake.GetHandshakeDirectory(string! packageFamilyName) -> string! static Microsoft.Testing.Extensions.PackagedApp.PackagedAppConnectBackHandshake.GetHandshakeFileName(string! testHostControllerPid) -> string! static Microsoft.Testing.Extensions.PackagedApp.PackagedAppConnectBackHandshake.GetHandshakeFilePath(string! packageFamilyName, string! testHostControllerPid) -> string! @@ -30,5 +40,10 @@ static Microsoft.Testing.Extensions.PackagedApp.PackagedAppConnectBackHandshake. static Microsoft.Testing.Extensions.PackagedApp.PackagedAppConnectBackHandshake.TryGetTestHostControllerPid(System.Collections.Generic.IReadOnlyList! arguments) -> string? static Microsoft.Testing.Extensions.PackagedApp.PackagedAppConnectBackHandshake.Write(string! filePath, System.Collections.Generic.IEnumerable>! entries) -> void static Microsoft.Testing.Extensions.PackagedApp.PackagedAppConnectBackReader.TryApplyConnectBackEnvironment(System.Collections.Generic.IReadOnlyList! commandLineArguments) -> void +static Microsoft.Testing.Extensions.PackagedApp.PackagedAppConnectBackReader.TryApplyConnectBackEnvironment(System.Collections.Generic.IReadOnlyList! commandLineArguments, string! appBaseDirectory, System.Func! getPackageLocalStateDirectory, System.Action! setEnvironmentVariable) -> void +static Microsoft.Testing.Extensions.PackagedApp.PackagedAppConnectBackReader.ReadActivationArgumentsAndApplyConnectBack(string! activationArguments) -> string![]! +static Microsoft.Testing.Extensions.PackagedApp.PackagedAppConnectBackReader.ReadActivationArgumentsAndApplyConnectBack(string! activationArguments, string? activationPayloadLocalStateDirectory, string! appBaseDirectory, System.Func! getPackageLocalStateDirectory, System.Action! setEnvironmentVariable) -> string![]! +static Microsoft.Testing.Extensions.PackagedApp.PackagedAppConnectBackReader.TryGetPackageLocalStateDirectory() -> string? Microsoft.Testing.Extensions.PackagedApp.PackagedAppTestHostLauncher.PackagedAppTestHostLauncher(string! testApplicationDirectory, System.Func! getEnvironmentVariable) -> void const Microsoft.Testing.Extensions.PackagedApp.PackagedAppTestHostLauncher.LauncherModeEnvironmentVariable = "TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER" -> string! +static Microsoft.Testing.Extensions.PackagedApp.PackagedAppTestHostLauncher.CreateActivationArguments(Microsoft.Testing.Extensions.PackagedApp.AppxApplicationInfo! application, System.Collections.Generic.IReadOnlyList! arguments, string! localStateDirectory) -> Microsoft.Testing.Extensions.PackagedApp.PackagedAppActivationData! diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/InternalAPI/Windows/InternalAPI.Unshipped.txt b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/InternalAPI/Windows/InternalAPI.Unshipped.txt index c7ad2e9888..787598ae85 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/InternalAPI/Windows/InternalAPI.Unshipped.txt +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/InternalAPI/Windows/InternalAPI.Unshipped.txt @@ -1,6 +1,6 @@ #nullable enable Microsoft.Testing.Extensions.PackagedApp.ActivatedAppTestHostHandle -Microsoft.Testing.Extensions.PackagedApp.ActivatedAppTestHostHandle.ActivatedAppTestHostHandle(uint processId, string? handshakePath) -> void +Microsoft.Testing.Extensions.PackagedApp.ActivatedAppTestHostHandle.ActivatedAppTestHostHandle(uint processId, string? handshakePath, string? activationPayloadPath) -> void Microsoft.Testing.Extensions.PackagedApp.ActivatedAppTestHostHandle.Dispose() -> void Microsoft.Testing.Extensions.PackagedApp.ActivatedAppTestHostHandle.ExitCode.get -> int Microsoft.Testing.Extensions.PackagedApp.ActivatedAppTestHostHandle.HasExited.get -> bool @@ -10,4 +10,5 @@ Microsoft.Testing.Extensions.PackagedApp.ActivatedAppTestHostHandle.WaitForExitA Microsoft.Testing.Extensions.PackagedApp.Interop.ApplicationActivationManager static Microsoft.Testing.Extensions.PackagedApp.Interop.ApplicationActivationManager.ActivateApplication(string! appUserModelId, string? arguments) -> uint Microsoft.Testing.Extensions.PackagedApp.PackageDeployer -static Microsoft.Testing.Extensions.PackagedApp.PackageDeployer.RegisterAndActivateAsync(string! manifestPath, string! appUserModelId, string? activationArguments, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task! +static Microsoft.Testing.Extensions.PackagedApp.PackageDeployer.Activate(string! appUserModelId, string? activationArguments) -> uint +static Microsoft.Testing.Extensions.PackagedApp.PackageDeployer.RegisterAsync(string! manifestPath, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task! diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Microsoft.Testing.Extensions.PackagedApp.csproj b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Microsoft.Testing.Extensions.PackagedApp.csproj index f3638f9eb0..b5cced6657 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Microsoft.Testing.Extensions.PackagedApp.csproj +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Microsoft.Testing.Extensions.PackagedApp.csproj @@ -26,7 +26,7 @@ - diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PACKAGE.md b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PACKAGE.md index 8d688c7d35..feeb5e20ba 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PACKAGE.md +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PACKAGE.md @@ -1,10 +1,10 @@ # Microsoft.Testing.Extensions.PackagedApp -`Microsoft.Testing.Extensions.PackagedApp` is an extension for [Microsoft.Testing.Platform](https://www.nuget.org/packages/Microsoft.Testing.Platform) that starts Windows test hosts which cannot simply be `Process.Start`ed. In its Windows build (`net*-windows`) a packaged, full-trust MSIX desktop host is registered with the OS and activated by Application User Model ID (AUMID); a non-packaged (loose-layout) host can optionally be deployed into an isolated directory and launched from there. +`Microsoft.Testing.Extensions.PackagedApp` is an extension for [Microsoft.Testing.Platform](https://www.nuget.org/packages/Microsoft.Testing.Platform) that starts Windows test hosts which cannot simply be `Process.Start`ed. In its Windows build (`net*-windows`) a packaged MSIX host is registered with the OS and activated by Application User Model ID (AUMID); a non-packaged (loose-layout) host can optionally be deployed into an isolated directory and launched from there. It is the consumer of the platform's `ITestHostLauncher` extension point for Windows test hosts. Packaged Windows apps require package identity and ship as MSIX; VSTest exposes a single `UwpTestHostRuntimeProvider` for the equivalent scenario, built on Visual-Studio-internal deployment components, whereas this extension uses only public, redistributable Windows APIs: -- **Packaged AUMID activation** (Windows build): a packaged (MSIX) layout is registered in place with the `PackageManager` and the app is activated by AUMID via `IApplicationActivationManager` — the scenario tracked by [#9933](https://github.com/microsoft/testfx/issues/9933). This connect-back transport targets **full-trust packaged (MSIX) desktop hosts**; true UWP/AppContainer hosts are not supported, and registering an unsigned build-output layout requires Developer Mode (or sideloading). The plain `net8.0`/`net9.0` build rejects a packaged layout with an actionable error pointing at the Windows TFM. +- **Packaged AUMID activation** (Windows build): a packaged (MSIX) layout is registered in place with the `PackageManager` and the app is activated by AUMID via `IApplicationActivationManager`. `packagedClassicApp`/`win32App` hosts receive the platform-prepared command line through `argv`, including when their trust level is `appContainer`. `windowsApp`/UWP hosts receive one opaque launch string and restore the exact logical argument array through `PackagedAppExtensions.GetTestApplicationArguments(args.Arguments)` in `Application.OnLaunched` (see [#10485](https://github.com/microsoft/testfx/issues/10485)). Registering an unsigned build-output layout requires Developer Mode (or sideloading). The plain `net8.0`/`net9.0` build rejects a packaged layout with an actionable error pointing at the Windows TFM. - **Deploy + launch loose layout** (opt-in): a non-packaged app — one without an `AppxManifest.xml` — is deployed to a deployment directory and the produced executable is launched from there. ## When the launcher takes over @@ -23,6 +23,26 @@ So referencing this package from an unpackaged app costs nothing: no extra proce Set `TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER` to override that decision — `always` opts a non-packaged layout into deploy-and-launch, `never` keeps the launcher out of the way entirely, and `auto` (the default) probes the layout. +## Launch-activation bootstrap + +A `windowsApp`/UWP app has no `Main(string[] args)` receiving the activation string as process arguments. Its `OnLaunched` override must restore the MTP argument array before creating the builder. A `packagedClassicApp`/`win32App` uses its normal process arguments instead, even when its trust level is `appContainer`: + +```csharp +protected override async void OnLaunched(LaunchActivatedEventArgs args) +{ + string[] cliArgs = PackagedAppExtensions.GetTestApplicationArguments(args.Arguments); + ITestApplicationBuilder builder = await TestApplication.CreateBuilderAsync(cliArgs); + builder.AddSelfRegisteredExtensions(cliArgs); + using ITestApplication app = await builder.BuildAsync(); + Environment.ExitCode = await app.RunAsync(); + Exit(); +} +``` + +The handoff is versioned and length-prefixed, so empty values, whitespace, quotes, backslashes, Unicode, repeated options, and option order round-trip exactly. Payloads within Windows' documented 2,048-character launch-argument envelope stay entirely in the activation string. Larger payloads are written to package `LocalState` only as authenticated ciphertext; the one-shot key remains in the activation string, and both the host and launcher delete the file at the earliest cleanup point. User filters, runsettings, and other arguments are never persisted in plaintext. + +Argument delivery alone does not make an AppContainer run complete: the controller named pipe must also authorize the exact package SID. That separate security change is tracked by [#10486](https://github.com/microsoft/testfx/issues/10486). Full-trust packaged and unpackaged hosts do not depend on it. + Microsoft.Testing.Platform is open source. You can find `Microsoft.Testing.Extensions.PackagedApp` code in the [microsoft/testfx](https://github.com/microsoft/testfx) GitHub repository. ## Install the package @@ -35,7 +55,7 @@ dotnet add package Microsoft.Testing.Extensions.PackagedApp This package extends Microsoft.Testing.Platform with: -- **Registration + activation**: registers a packaged, full-trust MSIX desktop test host and activates it by AUMID (see [#9933](https://github.com/microsoft/testfx/issues/9933)); optionally stages a non-packaged (loose-layout) Windows test host payload into an isolated directory and launches the deployed copy. +- **Registration + activation**: registers a packaged MSIX test host and activates it by AUMID (see [#9933](https://github.com/microsoft/testfx/issues/9933) and [#10485](https://github.com/microsoft/testfx/issues/10485)); optionally stages a non-packaged (loose-layout) Windows test host payload into an isolated directory and launches the deployed copy. - **Mechanism-agnostic monitoring**: returns an `ITestHostHandle` that exposes only the lifecycle the platform needs (surfacing the activated process id for the packaged path, and none for the deployed loose-layout path). ## Documentation diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackageDeployer.cs b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackageDeployer.cs index bc1cfcb973..2dac4edaa7 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackageDeployer.cs +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackageDeployer.cs @@ -21,18 +21,12 @@ internal static class PackageDeployer { /// /// Registers the loose layout described by in place (no copy) and - /// then activates , forwarding - /// as the activated app's command line. + /// prepares its package-owned storage before any activation handoffs are written. /// /// The full path to the layout's AppxManifest.xml. - /// The AUMID to activate once registered. - /// The command line to deliver to the activated app. /// A token to observe while registering. - /// The process id of the activated app instance. - public static async Task RegisterAndActivateAsync( + public static async Task RegisterAsync( string manifestPath, - string appUserModelId, - string? activationArguments, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); @@ -79,9 +73,11 @@ public static async Task RegisterAndActivateAsync( } cancellationToken.ThrowIfCancellationRequested(); - - return ApplicationActivationManager.ActivateApplication(appUserModelId, activationArguments); } + + /// Activates a registered packaged app and returns its process id. + public static uint Activate(string appUserModelId, string? activationArguments) + => ApplicationActivationManager.ActivateApplication(appUserModelId, activationArguments); } #endif diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppActivationArguments.cs b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppActivationArguments.cs new file mode 100644 index 0000000000..c7fff77b6c --- /dev/null +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppActivationArguments.cs @@ -0,0 +1,379 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System.Security.Cryptography; + +using Microsoft.Testing.Extensions.PackagedApp.Resources; + +namespace Microsoft.Testing.Extensions.PackagedApp; + +/// +/// Serializes the platform-prepared argument array into the opaque string delivered to an AppContainer +/// app through launch activation, and restores the exact array in the activated host. +/// +internal static class PackagedAppActivationArguments +{ + private const string InlinePrefix = "mtp:v1:inline:"; + private const string FilePrefix = "mtp:v1:file:"; + + // LaunchActivatedEventArgs receives the same app-defined argument string used by Windows launch + // activation surfaces such as SecondaryTile.Arguments, whose documented limit is 2,048 characters. + // Keep the direct payload within that proven envelope. Larger payloads use a one-shot encrypted file. + private const int MaximumInlineLength = 2048; + private const int KeySize = 32; + private const int NonceSize = 12; + private const int TagSize = 16; + private static readonly TimeSpan StalePayloadAge = TimeSpan.FromDays(1); + + public static PackagedAppActivationData Create(IReadOnlyList arguments, string localStateDirectory) + { + ArgumentNullException.ThrowIfNull(arguments); + ArgumentException.ThrowIfNullOrEmpty(localStateDirectory); + + byte[] serialized = Serialize(arguments); + try + { + if (Directory.Exists(localStateDirectory)) + { + TryDeleteStalePayloads(localStateDirectory, TimeProvider.System.GetUtcNow().UtcDateTime); + } + + long inlineLength = InlinePrefix.Length + ((((long)serialized.Length + 2) / 3) * 4); + if (inlineLength <= MaximumInlineLength) + { + return new PackagedAppActivationData( + InlinePrefix + Convert.ToBase64String(serialized), + payloadPath: null); + } + + Directory.CreateDirectory(localStateDirectory); + + string token = Guid.NewGuid().ToString("N"); + string payloadPath = GetPayloadPath(localStateDirectory, token); + byte[] key = RandomNumberGenerator.GetBytes(KeySize); + try + { + byte[] nonce = RandomNumberGenerator.GetBytes(NonceSize); + byte[] ciphertext = new byte[serialized.Length]; + byte[] tag = new byte[TagSize]; + + using (var aes = new AesGcm(key, TagSize)) + { + aes.Encrypt(nonce, serialized, ciphertext, tag, GetAssociatedData(token)); + } + + byte[] encryptedPayload = new byte[NonceSize + TagSize + ciphertext.Length]; + nonce.CopyTo(encryptedPayload, 0); + tag.CopyTo(encryptedPayload, NonceSize); + ciphertext.CopyTo(encryptedPayload, NonceSize + TagSize); + try + { + File.WriteAllBytes(payloadPath, encryptedPayload); + + return new PackagedAppActivationData( + $"{FilePrefix}{token}:{Convert.ToBase64String(key)}", + payloadPath); + } + catch + { + // File.WriteAllBytes can leave a partial file behind. Create has not returned its path + // to the launcher yet, so this is the only cleanup point that can remove it. + TryDeletePayload(payloadPath); + throw; + } + } + finally + { + CryptographicOperations.ZeroMemory(key); + } + } + finally + { + CryptographicOperations.ZeroMemory(serialized); + } + } + + public static string[] Read(string activationArguments, string? localStateDirectory) + { + ArgumentNullException.ThrowIfNull(activationArguments); + + if (activationArguments.StartsWith(InlinePrefix, StringComparison.Ordinal)) + { + byte[] serialized; + try + { + serialized = Convert.FromBase64String(activationArguments[InlinePrefix.Length..]); + } + catch (FormatException ex) + { + throw new FormatException(ExtensionResources.ActivationArgumentsInvalidInlinePayload, ex); + } + + try + { + return Deserialize(serialized); + } + finally + { + CryptographicOperations.ZeroMemory(serialized); + } + } + + return activationArguments.StartsWith(FilePrefix, StringComparison.Ordinal) + ? ReadEncryptedPayload(activationArguments[FilePrefix.Length..], localStateDirectory) + : throw new FormatException(ExtensionResources.ActivationArgumentsMissingPayload); + } + + public static void TryDeletePayload(string? payloadPath) + { + if (payloadPath is null) + { + return; + } + + try + { + if (File.Exists(payloadPath)) + { + File.Delete(payloadPath); + } + } + catch (Exception ex) when (ex is IOException or UnauthorizedAccessException) + { + Debug.WriteLine($"Best-effort delete of activation-argument payload file '{payloadPath}' failed: {ex}"); + } + } + + public static void TryDeleteStalePayloads(string localStateDirectory, DateTime utcNow) + { + string[] payloadPaths; + try + { + payloadPaths = Directory.GetFiles(localStateDirectory, "mtp-activation-*.payload", SearchOption.TopDirectoryOnly); + } + catch (Exception ex) when (ex is IOException or UnauthorizedAccessException) + { + Debug.WriteLine($"Best-effort enumeration of stale activation-argument payloads in '{localStateDirectory}' failed: {ex}"); + return; + } + + DateTime staleBefore = utcNow - StalePayloadAge; + foreach (string payloadPath in payloadPaths) + { + try + { + if (File.GetLastWriteTimeUtc(payloadPath) <= staleBefore) + { + TryDeletePayload(payloadPath); + } + } + catch (Exception ex) when (ex is IOException or UnauthorizedAccessException) + { + Debug.WriteLine($"Best-effort inspection of activation-argument payload file '{payloadPath}' failed: {ex}"); + } + } + } + + private static string[] ReadEncryptedPayload(string reference, string? localStateDirectory) + { + int separator = reference.IndexOf(':'); + if (separator <= 0 + || !Guid.TryParseExact(reference[..separator], "N", out Guid tokenValue) + || localStateDirectory is null) + { + throw new FormatException(ExtensionResources.ActivationArgumentsInvalidFileReference); + } + + byte[] key; + try + { + key = Convert.FromBase64String(reference[(separator + 1)..]); + } + catch (FormatException ex) + { + throw new FormatException(ExtensionResources.ActivationArgumentsInvalidFileKey, ex); + } + + if (key.Length != KeySize) + { + CryptographicOperations.ZeroMemory(key); + throw new FormatException(ExtensionResources.ActivationArgumentsInvalidFileKey); + } + + try + { + string token = tokenValue.ToString("N"); + string payloadPath = GetPayloadPath(localStateDirectory, token); + byte[] encryptedPayload; + try + { + // Opening with no sharing atomically claims the payload: a concurrent consumer cannot open + // the same path. DeleteOnClose keeps that claim through the read and removes the file even + // when reading or later validation fails. + using var payloadStream = new FileStream( + payloadPath, + FileMode.Open, + FileAccess.Read, + FileShare.None, + bufferSize: 4096, + FileOptions.DeleteOnClose); + if (payloadStream.Length > int.MaxValue) + { + throw new FormatException(ExtensionResources.ActivationArgumentsPayloadTooLarge); + } + + encryptedPayload = new byte[(int)payloadStream.Length]; + payloadStream.ReadExactly(encryptedPayload); + } + catch (FormatException) + { + throw; + } + catch (Exception ex) when (ex is IOException or UnauthorizedAccessException) + { + throw new FormatException(ExtensionResources.ActivationArgumentsPayloadReadFailed, ex); + } + + if (encryptedPayload.Length < NonceSize + TagSize) + { + throw new FormatException(ExtensionResources.ActivationArgumentsPayloadTruncated); + } + + ReadOnlySpan nonce = encryptedPayload.AsSpan(0, NonceSize); + ReadOnlySpan tag = encryptedPayload.AsSpan(NonceSize, TagSize); + ReadOnlySpan ciphertext = encryptedPayload.AsSpan(NonceSize + TagSize); + byte[] serialized = new byte[ciphertext.Length]; + try + { + using (var aes = new AesGcm(key, TagSize)) + { + aes.Decrypt(nonce, ciphertext, tag, serialized, GetAssociatedData(token)); + } + + return Deserialize(serialized); + } + catch (AuthenticationTagMismatchException ex) + { + throw new FormatException(ExtensionResources.ActivationArgumentsPayloadAuthenticationFailed, ex); + } + finally + { + CryptographicOperations.ZeroMemory(serialized); + } + } + finally + { + CryptographicOperations.ZeroMemory(key); + } + } + + private static byte[] Serialize(IReadOnlyList arguments) + { + long byteCount = sizeof(int); + foreach (string argument in arguments) + { + ArgumentNullException.ThrowIfNull(argument); + byteCount += sizeof(int) + ((long)argument.Length * sizeof(char)); + } + + if (byteCount > int.MaxValue) + { + throw new ArgumentException(ExtensionResources.ActivationArgumentsPayloadTooLarge, nameof(arguments)); + } + + byte[] payload = new byte[(int)byteCount]; + Span destination = payload; + WriteInt32(destination, arguments.Count); + int offset = sizeof(int); + foreach (string argument in arguments) + { + WriteInt32(destination[offset..], argument.Length); + offset += sizeof(int); + + foreach (char value in argument) + { + destination[offset++] = (byte)value; + destination[offset++] = (byte)(value >> 8); + } + } + + return payload; + } + + private static string[] Deserialize(ReadOnlySpan payload) + { + if (payload.Length < sizeof(int)) + { + throw new FormatException(ExtensionResources.ActivationArgumentsPayloadTruncated); + } + + int count = ReadInt32(payload); + if (count < 0 || count > (payload.Length - sizeof(int)) / sizeof(int)) + { + throw new FormatException(ExtensionResources.ActivationArgumentsInvalidArgumentCount); + } + + string[] arguments = new string[count]; + int offset = sizeof(int); + for (int argumentIndex = 0; argumentIndex < count; argumentIndex++) + { + if (payload.Length - offset < sizeof(int)) + { + throw new FormatException(ExtensionResources.ActivationArgumentsPayloadTruncated); + } + + int charCount = ReadInt32(payload[offset..]); + offset += sizeof(int); + if (charCount < 0 || charCount > (payload.Length - offset) / sizeof(char)) + { + throw new FormatException(ExtensionResources.ActivationArgumentsInvalidArgumentLength); + } + + char[] chars = new char[charCount]; + for (int i = 0; i < chars.Length; i++) + { + int sourceOffset = offset + (i * sizeof(char)); + chars[i] = (char)(payload[sourceOffset] | (payload[sourceOffset + 1] << 8)); + } + + arguments[argumentIndex] = new string(chars); + offset += charCount * sizeof(char); + } + + return offset == payload.Length + ? arguments + : throw new FormatException(ExtensionResources.ActivationArgumentsTrailingData); + } + + private static byte[] GetAssociatedData(string token) => Encoding.ASCII.GetBytes($"{FilePrefix}{token}"); + + private static string GetPayloadPath(string localStateDirectory, string token) + => Path.Combine(localStateDirectory, $"mtp-activation-{token}.payload"); + + private static int ReadInt32(ReadOnlySpan source) + => source[0] + | (source[1] << 8) + | (source[2] << 16) + | (source[3] << 24); + + private static void WriteInt32(Span destination, int value) + { + destination[0] = (byte)value; + destination[1] = (byte)(value >> 8); + destination[2] = (byte)(value >> 16); + destination[3] = (byte)(value >> 24); + } +} + +internal sealed class PackagedAppActivationData +{ + public PackagedAppActivationData(string arguments, string? payloadPath) + { + Arguments = arguments; + PayloadPath = payloadPath; + } + + public string Arguments { get; } + + public string? PayloadPath { get; } +} diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppConnectBackReader.cs b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppConnectBackReader.cs index d5e72063a3..d764eca8d3 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppConnectBackReader.cs +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppConnectBackReader.cs @@ -13,6 +13,36 @@ namespace Microsoft.Testing.Extensions.PackagedApp; /// internal static class PackagedAppConnectBackReader { + /// + /// Restores activation arguments and connect-back environment for the current packaged process. + /// + public static string[] ReadActivationArgumentsAndApplyConnectBack(string activationArguments) + { + string? localStateDirectory = TryGetPackageLocalStateDirectory(); + return ReadActivationArgumentsAndApplyConnectBack( + activationArguments, + localStateDirectory, + AppContext.BaseDirectory, + () => localStateDirectory, + Environment.SetEnvironmentVariable); + } + + public static string[] ReadActivationArgumentsAndApplyConnectBack( + string activationArguments, + string? activationPayloadLocalStateDirectory, + string appBaseDirectory, + Func getPackageLocalStateDirectory, + Action setEnvironmentVariable) + { + string[] arguments = PackagedAppActivationArguments.Read(activationArguments, activationPayloadLocalStateDirectory); + TryApplyConnectBackEnvironment( + arguments, + appBaseDirectory, + getPackageLocalStateDirectory, + setEnvironmentVariable); + return arguments; + } + /// /// Applies the handed-off connect-back environment variables when the current process is an /// activated packaged test host. It is a no-op for the controller, for non-packaged layouts, and @@ -21,6 +51,17 @@ internal static class PackagedAppConnectBackReader /// /// The current process command line. public static void TryApplyConnectBackEnvironment(IReadOnlyList commandLineArguments) + => TryApplyConnectBackEnvironment( + commandLineArguments, + AppContext.BaseDirectory, + TryGetPackageLocalStateDirectory, + Environment.SetEnvironmentVariable); + + public static void TryApplyConnectBackEnvironment( + IReadOnlyList commandLineArguments, + string appBaseDirectory, + Func getPackageLocalStateDirectory, + Action setEnvironmentVariable) { // Only the spawned test host leg carries the test host controller PID option; the controller // process does not, so it never consumes a handshake. @@ -32,7 +73,7 @@ public static void TryApplyConnectBackEnvironment(IReadOnlyList commandL // We only act when running from a packaged (MSIX) layout, detected by an AppxManifest.xml at or // above the app's install directory (the same manifest the launcher registered). - string? manifestPath = AppxManifestInfo.FindManifestPath(AppContext.BaseDirectory); + string? manifestPath = AppxManifestInfo.FindManifestPath(appBaseDirectory); if (manifestPath is null) { return; @@ -55,7 +96,7 @@ public static void TryApplyConnectBackEnvironment(IReadOnlyList commandL // %LOCALAPPDATA%\Packages\{PFN}\LocalState the (unpackaged) launcher wrote to; // Environment.SpecialFolder.LocalApplicationData is redirected here and would not find the file. string fileName = PackagedAppConnectBackHandshake.GetHandshakeFileName(testHostControllerPid); - string? localStateDirectory = TryGetPackageLocalStateDirectory(); + string? localStateDirectory = getPackageLocalStateDirectory(); string handshakePath = localStateDirectory is not null ? Path.Combine(localStateDirectory, fileName) : PackagedAppConnectBackHandshake.GetHandshakeFilePath(packageFamilyName, testHostControllerPid); @@ -72,7 +113,7 @@ public static void TryApplyConnectBackEnvironment(IReadOnlyList commandL // off (a null value deletes the variable). These are the variables an AUMID-activated host // needs to reach its controller and would not otherwise inherit across the activation // boundary. - Environment.SetEnvironmentVariable(entry.Key, entry.Value); + setEnvironmentVariable(entry.Key, entry.Value); } } @@ -80,7 +121,7 @@ public static void TryApplyConnectBackEnvironment(IReadOnlyList commandL // when the process has no package identity. Only the Windows build can resolve this through the WinRT // ApplicationData projection; other builds fall back to the family-name-derived path. #if PACKAGEDAPP_WINRT - private static string? TryGetPackageLocalStateDirectory() + internal static string? TryGetPackageLocalStateDirectory() { try { @@ -93,6 +134,6 @@ public static void TryApplyConnectBackEnvironment(IReadOnlyList commandL } } #else - private static string? TryGetPackageLocalStateDirectory() => null; + internal static string? TryGetPackageLocalStateDirectory() => null; #endif } diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppExtensions.cs b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppExtensions.cs index ca781a8070..28e0ee5322 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppExtensions.cs +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppExtensions.cs @@ -7,17 +7,37 @@ namespace Microsoft.Testing.Extensions; /// -/// Provides extension methods for adding Windows test host launch support (packaged, full-trust MSIX -/// desktop apps, and — when opted in — non-packaged loose layouts) to the test application builder. +/// Provides extension methods for adding Windows test host launch support for packaged MSIX apps +/// (desktop and windowsApp/UWP), and — when opted in — non-packaged loose layouts. /// public static class PackagedAppExtensions { /// - /// Registers a test host launcher for Windows test applications. Packaged, full-trust MSIX desktop - /// hosts are registered with the OS and activated by Application User Model ID in the Windows build - /// of this extension (see https://github.com/microsoft/testfx/issues/9933); the plain build rejects - /// a packaged layout with an actionable error. True UWP/AppContainer hosts are not supported by this - /// connect-back transport. + /// Restores the platform-prepared argument array delivered to a windowsApp/UWP test host through + /// LaunchActivatedEventArgs.Arguments. + /// + /// + /// Call this method from the application's OnLaunched override before + /// . It also + /// restores the transient controller connect-back environment that AUMID activation does not + /// inherit. Packaged full-trust desktop apps should continue to use their normal process arguments. + /// + /// The opaque activation string supplied by Windows. + /// The exact logical argument array prepared by Microsoft Testing Platform. + /// is . + /// The activation string is not a valid Microsoft Testing Platform payload. + public static string[] GetTestApplicationArguments(string activationArguments) + => PackagedAppConnectBackReader.ReadActivationArgumentsAndApplyConnectBack(activationArguments); + + /// + /// Registers a test host launcher for Windows test applications. Packaged MSIX hosts are registered + /// with the OS and activated by Application User Model ID in the Windows build of this extension + /// (see https://github.com/microsoft/testfx/issues/9933); the plain build rejects a packaged layout + /// with an actionable error. Full-trust desktop hosts receive normal process arguments, while + /// windowsApp/UWP hosts restore launch activation arguments with + /// . End-to-end AppContainer execution additionally + /// requires the exact package-SID controller-pipe authorization tracked by + /// https://github.com/microsoft/testfx/issues/10486. /// /// /// The launcher only enables itself when the test application is a packaged layout, so calling this diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppTestHostLauncher.cs b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppTestHostLauncher.cs index 6bfd764730..fd6a93f844 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppTestHostLauncher.cs +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppTestHostLauncher.cs @@ -3,9 +3,7 @@ using Microsoft.Testing.Extensions.PackagedApp.Resources; using Microsoft.Testing.Platform.Extensions.TestHostControllers; -#if PACKAGEDAPP_WINRT using Microsoft.Testing.Platform.Helpers; -#endif namespace Microsoft.Testing.Extensions.PackagedApp; @@ -29,14 +27,15 @@ namespace Microsoft.Testing.Extensions.PackagedApp; /// Because an AUMID-activated process is created by the Windows activation/PLM infrastructure rather /// than by the controller, it does not inherit the controller-to-host connect-back environment /// variables the platform prepared. The launcher hands those off out-of-band through the package's own -/// writable data folder (see ) and forwards the -/// platform-prepared command line as the activation arguments, which a packaged full-trust desktop app -/// receives as argv. +/// writable data folder (see ). A packaged full-trust +/// desktop app receives the platform-prepared command line as argv; an AppContainer app receives +/// a versioned activation payload that its OnLaunched bootstrap restores to the same logical +/// argument array. /// /// -/// This connect-back transport therefore targets full-trust packaged (MSIX) desktop hosts. A -/// true UWP/AppContainer host is not supported: activation arguments are not delivered as argv -/// there, and the controller pipe is not granted the package SID. The full register-and-activate path +/// Both process-argv and windowsApp/UWP launch-activation argument delivery are supported. End-to-end +/// AppContainer execution additionally requires the controller pipe to grant the package SID access; that separate +/// transport dependency is tracked by https://github.com/microsoft/testfx/issues/10486. The full register-and-activate path /// ships only in the Windows build of this extension (net*-windows10.0.19041.0), where the /// PackageManager WinRT projection is available. The plain net8.0/net9.0 build /// still deploys and launches an opted-in non-packaged loose layout, but rejects a packaged layout with @@ -151,6 +150,31 @@ private bool IsEnabled() || AppxManifestInfo.FindManifestPath(_testApplicationDirectory) is not null); } + internal static PackagedAppActivationData CreateActivationArguments( + AppxApplicationInfo application, + IReadOnlyList arguments, + string localStateDirectory) + { + if (application.UsesLaunchActivationArguments) + { + // windowsApp/UWP activation exposes one opaque string through OnLaunched rather than argv. + // Inline the compact versioned payload when it fits the documented launch-argument envelope; + // otherwise spill only authenticated ciphertext to LocalState and carry its one-shot key in + // the activation string. User filters/runsettings are therefore never persisted in plaintext. + return PackagedAppActivationArguments.Create(arguments, localStateDirectory); + } + + // A packaged full-trust desktop app receives activation arguments as process argv. Preserve the + // existing Windows command-line quoting exactly for that path. + var commandLineBuilder = new StringBuilder(); + foreach (string argument in arguments) + { + PasteArguments.AppendArgument(commandLineBuilder, argument); + } + + return new PackagedAppActivationData(commandLineBuilder.ToString(), payloadPath: null); + } + public async Task LaunchTestHostAsync(TestHostLaunchContext context, CancellationToken cancellationToken) { // Honor immediate cancellation before doing any (potentially expensive) deployment work. @@ -190,6 +214,11 @@ private static async Task LaunchPackagedAsync(TestHostLaunchCon manifestInfo.PackageFamilyName, manifestPath)); + // Registration provisions the package-owned LocalState directory and its AppContainer ACL. + // Handoffs must be written only after this completes; creating the directory from the unpackaged + // controller first would give it the controller's ACL and make it unreadable by the activated app. + await PackageDeployer.RegisterAsync(manifestPath, cancellationToken).ConfigureAwait(false); + // Hand off the controller-to-host connect-back environment variables through the package's // LocalState, keyed by the test host controller PID so concurrent runs of the same package do not // collide. An AUMID-activated process is created by the Windows activation infrastructure and does @@ -201,31 +230,29 @@ private static async Task LaunchPackagedAsync(TestHostLaunchCon // PackagedAppConnectBackReader). string? testHostControllerPid = PackagedAppConnectBackHandshake.TryGetTestHostControllerPid(context.Arguments); string? handshakePath = null; - if (testHostControllerPid is not null) + string? activationPayloadPath = null; + try { - handshakePath = PackagedAppConnectBackHandshake.GetHandshakeFilePath(manifestInfo.PackageFamilyName, testHostControllerPid); - PackagedAppConnectBackHandshake.Write(handshakePath, GetConnectBackEnvironment(context)); - } + if (testHostControllerPid is not null) + { + handshakePath = PackagedAppConnectBackHandshake.GetHandshakeFilePath(manifestInfo.PackageFamilyName, testHostControllerPid); + PackagedAppConnectBackHandshake.Write(handshakePath, GetConnectBackEnvironment(context)); + } - // Register the loose layout in place and activate it, forwarding the platform-prepared command - // line (which a packaged full-trust desktop app receives as argv). Activation returns the real - // process id, so the handle can monitor and terminate the actual activated process. - var commandLineBuilder = new StringBuilder(); - foreach (string argument in context.Arguments) - { - PasteArguments.AppendArgument(commandLineBuilder, argument); - } + PackagedAppActivationData activationData = CreateActivationArguments( + application, + context.Arguments, + PackagedAppConnectBackHandshake.GetHandshakeDirectory(manifestInfo.PackageFamilyName)); + string activationArguments = activationData.Arguments; + activationPayloadPath = activationData.PayloadPath; - try - { - uint processId = await PackageDeployer - .RegisterAndActivateAsync(manifestPath, application.AppUserModelId, commandLineBuilder.ToString(), cancellationToken) - .ConfigureAwait(false); + cancellationToken.ThrowIfCancellationRequested(); + uint processId = PackageDeployer.Activate(application.AppUserModelId, activationArguments); // The handle owns deleting the hand-off from now on: the activated host normally consumes and // deletes it, but if that host exits before reading it the handle still removes it on dispose, // so connect-back data is never left behind. - return new ActivatedAppTestHostHandle(processId, handshakePath); + return new ActivatedAppTestHostHandle(processId, handshakePath, activationPayloadPath); } catch { @@ -237,6 +264,7 @@ private static async Task LaunchPackagedAsync(TestHostLaunchCon PackagedAppConnectBackHandshake.TryDelete(handshakePath); } + PackagedAppActivationArguments.TryDeletePayload(activationPayloadPath); throw; } } diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PublicAPI/PublicAPI.Unshipped.txt b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PublicAPI/PublicAPI.Unshipped.txt index 4060f3dd53..9b3d297c73 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PublicAPI/PublicAPI.Unshipped.txt +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PublicAPI/PublicAPI.Unshipped.txt @@ -3,3 +3,4 @@ *REMOVED*[TPEXP]static Microsoft.Testing.Extensions.PackagedAppExtensions.AddPackagedAppDeployment(this Microsoft.Testing.Platform.Builder.ITestApplicationBuilder! builder) -> void Microsoft.Testing.Extensions.PackagedAppExtensions static Microsoft.Testing.Extensions.PackagedAppExtensions.AddPackagedAppDeployment(this Microsoft.Testing.Platform.Builder.ITestApplicationBuilder! builder) -> void +static Microsoft.Testing.Extensions.PackagedAppExtensions.GetTestApplicationArguments(string! activationArguments) -> string![]! diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/ExtensionResources.resx b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/ExtensionResources.resx index 37896699d1..4c96fb2b4d 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/ExtensionResources.resx +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/ExtensionResources.resx @@ -118,8 +118,8 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - Registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID (Windows build), and — when opted in through TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always — deploys a non-packaged (loose-layout) Windows test host to an isolated directory and launches it from there. Enabled only for a packaged layout by default, so an unpackaged app is left on the default launch path. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933. - Do not localize the environment variable name or its value {Locked="TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER"}{Locked="always"}, nor the technology names {Locked="MSIX"}{Locked="Application User Model ID"}{Locked="Windows"}{Locked="UWP"}{Locked="AppContainer"}. + Registers a packaged MSIX test host and activates it by Application User Model ID (Windows build), delivering Microsoft Testing Platform arguments through argv for packagedClassicApp/win32App hosts (including classic AppContainer hosts) or launch activation for windowsApp/UWP hosts. When opted in through TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always, it also deploys a non-packaged (loose-layout) Windows test host to an isolated directory and launches it from there. Enabled only for a packaged layout by default, so an unpackaged app is left on the default launch path. End-to-end AppContainer execution additionally requires controller-pipe authorization. See https://github.com/microsoft/testfx/issues/10486. + Do not localize the environment variable name or its value {Locked="TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER"}{Locked="always"}, nor the technology names {Locked="Microsoft Testing Platform"}{Locked="MSIX"}{Locked="Application User Model ID"}{Locked="Windows"}{Locked="packagedClassicApp"}{Locked="win32App"}{Locked="windowsApp"}{Locked="UWP"}{Locked="AppContainer"}. Packaged app test host launcher @@ -143,4 +143,48 @@ Failed to register the packaged Windows app layout '{0}'. Registering an unsigned build-output layout requires Developer Mode (or sideloading) to be enabled. Error: {1} + + The Microsoft Testing Platform activation-argument payload has an invalid argument count. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload has an invalid argument length. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation arguments contain an invalid file payload key. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation arguments contain an invalid file payload reference. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation arguments contain an invalid inline payload. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The launch activation does not contain Microsoft Testing Platform arguments. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload failed authentication. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload could not be read. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload is too large. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload is truncated. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload contains trailing data. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.cs.xlf b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.cs.xlf index 4b9ff8d397..76c38dec8a 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.cs.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.cs.xlf @@ -2,6 +2,61 @@ + + The Microsoft Testing Platform activation-argument payload has an invalid argument count. + The Microsoft Testing Platform activation-argument payload has an invalid argument count. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload has an invalid argument length. + The Microsoft Testing Platform activation-argument payload has an invalid argument length. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation arguments contain an invalid file payload key. + The Microsoft Testing Platform activation arguments contain an invalid file payload key. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation arguments contain an invalid file payload reference. + The Microsoft Testing Platform activation arguments contain an invalid file payload reference. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation arguments contain an invalid inline payload. + The Microsoft Testing Platform activation arguments contain an invalid inline payload. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The launch activation does not contain Microsoft Testing Platform arguments. + The launch activation does not contain Microsoft Testing Platform arguments. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload failed authentication. + The Microsoft Testing Platform activation-argument payload failed authentication. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload could not be read. + The Microsoft Testing Platform activation-argument payload could not be read. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload is too large. + The Microsoft Testing Platform activation-argument payload is too large. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload is truncated. + The Microsoft Testing Platform activation-argument payload is truncated. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload contains trailing data. + The Microsoft Testing Platform activation-argument payload contains trailing data. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + The packaged app manifest declares multiple applications and none uniquely matches the executable '{0}'. Candidate Application User Model IDs: {1}. Manifest zabalené aplikace deklaruje více aplikací a žádná jednoznačně neodpovídá spustitelnému souboru '{0}'. Kandidátní ID modelu uživatele aplikace: {1}. @@ -18,9 +73,9 @@ - Registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID (Windows build), and — when opted in through TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always — deploys a non-packaged (loose-layout) Windows test host to an isolated directory and launches it from there. Enabled only for a packaged layout by default, so an unpackaged app is left on the default launch path. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933. - Registruje zabalený, plně důvěryhodný desktopový testovací host MSIX a aktivuje ho pomocí Application User Model ID (Windows sestavení) – a když je povolen prostřednictvím TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always, nasadí nezabalený (loose-layout) testovací host Windows do izolovaného adresáře a spustí ho odtud. Ve výchozím nastavení je povolené jenom pro zabalené rozložení, takže na výchozí cestě spuštění zůstane nezabalené aplikace. Skuteční hostitelé UWP/AppContainer nejsou podporováni. Viz https://github.com/microsoft/testfx/issues/9933. - Do not localize the environment variable name or its value {Locked="TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER"}{Locked="always"}, nor the technology names {Locked="MSIX"}{Locked="Application User Model ID"}{Locked="Windows"}{Locked="UWP"}{Locked="AppContainer"}. + Registers a packaged MSIX test host and activates it by Application User Model ID (Windows build), delivering Microsoft Testing Platform arguments through argv for packagedClassicApp/win32App hosts (including classic AppContainer hosts) or launch activation for windowsApp/UWP hosts. When opted in through TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always, it also deploys a non-packaged (loose-layout) Windows test host to an isolated directory and launches it from there. Enabled only for a packaged layout by default, so an unpackaged app is left on the default launch path. End-to-end AppContainer execution additionally requires controller-pipe authorization. See https://github.com/microsoft/testfx/issues/10486. + Registruje zabalený, plně důvěryhodný desktopový testovací host MSIX a aktivuje ho pomocí Application User Model ID (Windows sestavení) – a když je povolen prostřednictvím TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always, nasadí nezabalený (loose-layout) testovací host Windows do izolovaného adresáře a spustí ho odtud. Ve výchozím nastavení je povolené jenom pro zabalené rozložení, takže na výchozí cestě spuštění zůstane nezabalené aplikace. Skuteční hostitelé UWP/AppContainer nejsou podporováni. Viz https://github.com/microsoft/testfx/issues/9933. + Do not localize the environment variable name or its value {Locked="TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER"}{Locked="always"}, nor the technology names {Locked="Microsoft Testing Platform"}{Locked="MSIX"}{Locked="Application User Model ID"}{Locked="Windows"}{Locked="packagedClassicApp"}{Locked="win32App"}{Locked="windowsApp"}{Locked="UWP"}{Locked="AppContainer"}. Packaged app test host launcher diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.de.xlf b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.de.xlf index 3a0139ae33..df9ad0ac18 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.de.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.de.xlf @@ -2,6 +2,61 @@ + + The Microsoft Testing Platform activation-argument payload has an invalid argument count. + The Microsoft Testing Platform activation-argument payload has an invalid argument count. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload has an invalid argument length. + The Microsoft Testing Platform activation-argument payload has an invalid argument length. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation arguments contain an invalid file payload key. + The Microsoft Testing Platform activation arguments contain an invalid file payload key. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation arguments contain an invalid file payload reference. + The Microsoft Testing Platform activation arguments contain an invalid file payload reference. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation arguments contain an invalid inline payload. + The Microsoft Testing Platform activation arguments contain an invalid inline payload. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The launch activation does not contain Microsoft Testing Platform arguments. + The launch activation does not contain Microsoft Testing Platform arguments. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload failed authentication. + The Microsoft Testing Platform activation-argument payload failed authentication. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload could not be read. + The Microsoft Testing Platform activation-argument payload could not be read. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload is too large. + The Microsoft Testing Platform activation-argument payload is too large. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload is truncated. + The Microsoft Testing Platform activation-argument payload is truncated. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload contains trailing data. + The Microsoft Testing Platform activation-argument payload contains trailing data. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + The packaged app manifest declares multiple applications and none uniquely matches the executable '{0}'. Candidate Application User Model IDs: {1}. Das App-Paketmanifest deklariert mehrere Anwendungen, und keine davon stimmt eindeutig mit der ausführbaren Datei „{0}“ überein. Benutzermodell-IDs der Kandidatenanwendungen: {1}. @@ -18,9 +73,9 @@ - Registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID (Windows build), and — when opted in through TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always — deploys a non-packaged (loose-layout) Windows test host to an isolated directory and launches it from there. Enabled only for a packaged layout by default, so an unpackaged app is left on the default launch path. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933. - Im Windows-Build wird ein gepackter, voll vertrauenswürdiger MSIX-Desktoptesthost registriert und anhand der Anwendungsbenutzermodell-ID (Application User Model ID) aktiviert und – wenn über „TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always“ aktiviert – stellt einen nicht gepackten Windows-Testhost (loses Layout) in einem isolierten Verzeichnis bereit und startet ihn von dort aus. Standardmäßig nur für ein gepacktes Layout aktiviert, sodass eine nicht paketierte App auf dem Standardstartpfad verbleibt. Echte UWP-/AppContainer-Hosts werden nicht unterstützt. Siehe https://github.com/microsoft/testfx/issues/9933. - Do not localize the environment variable name or its value {Locked="TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER"}{Locked="always"}, nor the technology names {Locked="MSIX"}{Locked="Application User Model ID"}{Locked="Windows"}{Locked="UWP"}{Locked="AppContainer"}. + Registers a packaged MSIX test host and activates it by Application User Model ID (Windows build), delivering Microsoft Testing Platform arguments through argv for packagedClassicApp/win32App hosts (including classic AppContainer hosts) or launch activation for windowsApp/UWP hosts. When opted in through TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always, it also deploys a non-packaged (loose-layout) Windows test host to an isolated directory and launches it from there. Enabled only for a packaged layout by default, so an unpackaged app is left on the default launch path. End-to-end AppContainer execution additionally requires controller-pipe authorization. See https://github.com/microsoft/testfx/issues/10486. + Im Windows-Build wird ein gepackter, voll vertrauenswürdiger MSIX-Desktoptesthost registriert und anhand der Anwendungsbenutzermodell-ID (Application User Model ID) aktiviert und – wenn über „TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always“ aktiviert – stellt einen nicht gepackten Windows-Testhost (loses Layout) in einem isolierten Verzeichnis bereit und startet ihn von dort aus. Standardmäßig nur für ein gepacktes Layout aktiviert, sodass eine nicht paketierte App auf dem Standardstartpfad verbleibt. Echte UWP-/AppContainer-Hosts werden nicht unterstützt. Siehe https://github.com/microsoft/testfx/issues/9933. + Do not localize the environment variable name or its value {Locked="TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER"}{Locked="always"}, nor the technology names {Locked="Microsoft Testing Platform"}{Locked="MSIX"}{Locked="Application User Model ID"}{Locked="Windows"}{Locked="packagedClassicApp"}{Locked="win32App"}{Locked="windowsApp"}{Locked="UWP"}{Locked="AppContainer"}. Packaged app test host launcher diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.es.xlf b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.es.xlf index 87be30d7d7..04c19321e5 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.es.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.es.xlf @@ -2,6 +2,61 @@ + + The Microsoft Testing Platform activation-argument payload has an invalid argument count. + The Microsoft Testing Platform activation-argument payload has an invalid argument count. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload has an invalid argument length. + The Microsoft Testing Platform activation-argument payload has an invalid argument length. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation arguments contain an invalid file payload key. + The Microsoft Testing Platform activation arguments contain an invalid file payload key. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation arguments contain an invalid file payload reference. + The Microsoft Testing Platform activation arguments contain an invalid file payload reference. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation arguments contain an invalid inline payload. + The Microsoft Testing Platform activation arguments contain an invalid inline payload. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The launch activation does not contain Microsoft Testing Platform arguments. + The launch activation does not contain Microsoft Testing Platform arguments. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload failed authentication. + The Microsoft Testing Platform activation-argument payload failed authentication. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload could not be read. + The Microsoft Testing Platform activation-argument payload could not be read. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload is too large. + The Microsoft Testing Platform activation-argument payload is too large. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload is truncated. + The Microsoft Testing Platform activation-argument payload is truncated. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload contains trailing data. + The Microsoft Testing Platform activation-argument payload contains trailing data. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + The packaged app manifest declares multiple applications and none uniquely matches the executable '{0}'. Candidate Application User Model IDs: {1}. El manifiesto de aplicación empaquetada declara varias aplicaciones y ninguna coincide de forma única con el ejecutable "{0}". Identificadores de modelo de usuario de la aplicación candidata: {1}. @@ -18,9 +73,9 @@ - Registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID (Windows build), and — when opted in through TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always — deploys a non-packaged (loose-layout) Windows test host to an isolated directory and launches it from there. Enabled only for a packaged layout by default, so an unpackaged app is left on the default launch path. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933. - Registra un host de prueba de escritorio MSIX empaquetado y de confianza total, y lo activa mediante Application User Model ID (compilación de Windows); además, cuando se habilita mediante TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always, implementa un host de prueba de Windows sin empaquetar (diseño flexible) en un directorio aislado y lo inicia desde allí. De manera predeterminada, solo está habilitado para un diseño empaquetado, por lo que una aplicación sin empaquetar se deja en la ruta de inicio predeterminada. No se admiten los hosts verdaderos de UWP/AppContainer. Consulte https://github.com/microsoft/testfx/issues/9933. - Do not localize the environment variable name or its value {Locked="TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER"}{Locked="always"}, nor the technology names {Locked="MSIX"}{Locked="Application User Model ID"}{Locked="Windows"}{Locked="UWP"}{Locked="AppContainer"}. + Registers a packaged MSIX test host and activates it by Application User Model ID (Windows build), delivering Microsoft Testing Platform arguments through argv for packagedClassicApp/win32App hosts (including classic AppContainer hosts) or launch activation for windowsApp/UWP hosts. When opted in through TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always, it also deploys a non-packaged (loose-layout) Windows test host to an isolated directory and launches it from there. Enabled only for a packaged layout by default, so an unpackaged app is left on the default launch path. End-to-end AppContainer execution additionally requires controller-pipe authorization. See https://github.com/microsoft/testfx/issues/10486. + Registra un host de prueba de escritorio MSIX empaquetado y de confianza total, y lo activa mediante Application User Model ID (compilación de Windows); además, cuando se habilita mediante TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always, implementa un host de prueba de Windows sin empaquetar (diseño flexible) en un directorio aislado y lo inicia desde allí. De manera predeterminada, solo está habilitado para un diseño empaquetado, por lo que una aplicación sin empaquetar se deja en la ruta de inicio predeterminada. No se admiten los hosts verdaderos de UWP/AppContainer. Consulte https://github.com/microsoft/testfx/issues/9933. + Do not localize the environment variable name or its value {Locked="TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER"}{Locked="always"}, nor the technology names {Locked="Microsoft Testing Platform"}{Locked="MSIX"}{Locked="Application User Model ID"}{Locked="Windows"}{Locked="packagedClassicApp"}{Locked="win32App"}{Locked="windowsApp"}{Locked="UWP"}{Locked="AppContainer"}. Packaged app test host launcher diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.fr.xlf b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.fr.xlf index c99fabac6e..31c0724308 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.fr.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.fr.xlf @@ -2,6 +2,61 @@ + + The Microsoft Testing Platform activation-argument payload has an invalid argument count. + The Microsoft Testing Platform activation-argument payload has an invalid argument count. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload has an invalid argument length. + The Microsoft Testing Platform activation-argument payload has an invalid argument length. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation arguments contain an invalid file payload key. + The Microsoft Testing Platform activation arguments contain an invalid file payload key. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation arguments contain an invalid file payload reference. + The Microsoft Testing Platform activation arguments contain an invalid file payload reference. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation arguments contain an invalid inline payload. + The Microsoft Testing Platform activation arguments contain an invalid inline payload. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The launch activation does not contain Microsoft Testing Platform arguments. + The launch activation does not contain Microsoft Testing Platform arguments. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload failed authentication. + The Microsoft Testing Platform activation-argument payload failed authentication. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload could not be read. + The Microsoft Testing Platform activation-argument payload could not be read. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload is too large. + The Microsoft Testing Platform activation-argument payload is too large. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload is truncated. + The Microsoft Testing Platform activation-argument payload is truncated. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload contains trailing data. + The Microsoft Testing Platform activation-argument payload contains trailing data. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + The packaged app manifest declares multiple applications and none uniquely matches the executable '{0}'. Candidate Application User Model IDs: {1}. Le manifeste de l’application packagée déclare plusieurs applications et aucune ne correspond de manière unique à l’exécutable « {0} ». ID de modèle d’utilisateur d’application candidat : {1}. @@ -18,9 +73,9 @@ - Registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID (Windows build), and — when opted in through TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always — deploys a non-packaged (loose-layout) Windows test host to an isolated directory and launches it from there. Enabled only for a packaged layout by default, so an unpackaged app is left on the default launch path. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933. - Inscrit un hôte de test de bureau MSIX en package et en confiance totale et l’active par Application User Model ID (build Windows) et, une fois accepté via TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always, déploie un hôte de test Windows hors package (disposition libre) sur un répertoire isolé et le lance à partir de cet emplacement. Par défaut, cette fonctionnalité n’est activée que pour une disposition en package, de sorte qu’une application sans package reste sur le chemin de lancement par défaut. Les véritables hôtes UWP/AppContainer ne sont pas pris en charge. Consultez https://github.com/microsoft/testfx/issues/9933. - Do not localize the environment variable name or its value {Locked="TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER"}{Locked="always"}, nor the technology names {Locked="MSIX"}{Locked="Application User Model ID"}{Locked="Windows"}{Locked="UWP"}{Locked="AppContainer"}. + Registers a packaged MSIX test host and activates it by Application User Model ID (Windows build), delivering Microsoft Testing Platform arguments through argv for packagedClassicApp/win32App hosts (including classic AppContainer hosts) or launch activation for windowsApp/UWP hosts. When opted in through TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always, it also deploys a non-packaged (loose-layout) Windows test host to an isolated directory and launches it from there. Enabled only for a packaged layout by default, so an unpackaged app is left on the default launch path. End-to-end AppContainer execution additionally requires controller-pipe authorization. See https://github.com/microsoft/testfx/issues/10486. + Inscrit un hôte de test de bureau MSIX en package et en confiance totale et l’active par Application User Model ID (build Windows) et, une fois accepté via TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always, déploie un hôte de test Windows hors package (disposition libre) sur un répertoire isolé et le lance à partir de cet emplacement. Par défaut, cette fonctionnalité n’est activée que pour une disposition en package, de sorte qu’une application sans package reste sur le chemin de lancement par défaut. Les véritables hôtes UWP/AppContainer ne sont pas pris en charge. Consultez https://github.com/microsoft/testfx/issues/9933. + Do not localize the environment variable name or its value {Locked="TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER"}{Locked="always"}, nor the technology names {Locked="Microsoft Testing Platform"}{Locked="MSIX"}{Locked="Application User Model ID"}{Locked="Windows"}{Locked="packagedClassicApp"}{Locked="win32App"}{Locked="windowsApp"}{Locked="UWP"}{Locked="AppContainer"}. Packaged app test host launcher diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.it.xlf b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.it.xlf index 3941687fd5..d9fce75ad7 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.it.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.it.xlf @@ -2,6 +2,61 @@ + + The Microsoft Testing Platform activation-argument payload has an invalid argument count. + The Microsoft Testing Platform activation-argument payload has an invalid argument count. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload has an invalid argument length. + The Microsoft Testing Platform activation-argument payload has an invalid argument length. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation arguments contain an invalid file payload key. + The Microsoft Testing Platform activation arguments contain an invalid file payload key. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation arguments contain an invalid file payload reference. + The Microsoft Testing Platform activation arguments contain an invalid file payload reference. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation arguments contain an invalid inline payload. + The Microsoft Testing Platform activation arguments contain an invalid inline payload. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The launch activation does not contain Microsoft Testing Platform arguments. + The launch activation does not contain Microsoft Testing Platform arguments. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload failed authentication. + The Microsoft Testing Platform activation-argument payload failed authentication. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload could not be read. + The Microsoft Testing Platform activation-argument payload could not be read. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload is too large. + The Microsoft Testing Platform activation-argument payload is too large. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload is truncated. + The Microsoft Testing Platform activation-argument payload is truncated. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload contains trailing data. + The Microsoft Testing Platform activation-argument payload contains trailing data. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + The packaged app manifest declares multiple applications and none uniquely matches the executable '{0}'. Candidate Application User Model IDs: {1}. Il manifesto dell'app in pacchetto dichiara più applicazioni e nessuna corrisponde in modo univoco all'eseguibile '{0}'. ID modello utente applicazione candidata: {1}. @@ -18,9 +73,9 @@ - Registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID (Windows build), and — when opted in through TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always — deploys a non-packaged (loose-layout) Windows test host to an isolated directory and launches it from there. Enabled only for a packaged layout by default, so an unpackaged app is left on the default launch path. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933. - Registra un host di test desktop MSIX in pacchetto e con attendibilità totale e lo attiva tramite Application User Model ID (build di Windows) e, quando si esegue l'opt-in tramite TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always, distribuisce un host di test Windows non in pacchetto (loose-layout) in una directory isolata e lo avvia da lì. Per impostazione predefinita è abilitato solo per un layout in pacchetto, quindi un'app non in pacchetto resta nel percorso di avvio predefinito. Gli host UWP/AppContainer effettivi non sono supportati. Vedere https://github.com/microsoft/testfx/issues/9933. - Do not localize the environment variable name or its value {Locked="TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER"}{Locked="always"}, nor the technology names {Locked="MSIX"}{Locked="Application User Model ID"}{Locked="Windows"}{Locked="UWP"}{Locked="AppContainer"}. + Registers a packaged MSIX test host and activates it by Application User Model ID (Windows build), delivering Microsoft Testing Platform arguments through argv for packagedClassicApp/win32App hosts (including classic AppContainer hosts) or launch activation for windowsApp/UWP hosts. When opted in through TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always, it also deploys a non-packaged (loose-layout) Windows test host to an isolated directory and launches it from there. Enabled only for a packaged layout by default, so an unpackaged app is left on the default launch path. End-to-end AppContainer execution additionally requires controller-pipe authorization. See https://github.com/microsoft/testfx/issues/10486. + Registra un host di test desktop MSIX in pacchetto e con attendibilità totale e lo attiva tramite Application User Model ID (build di Windows) e, quando si esegue l'opt-in tramite TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always, distribuisce un host di test Windows non in pacchetto (loose-layout) in una directory isolata e lo avvia da lì. Per impostazione predefinita è abilitato solo per un layout in pacchetto, quindi un'app non in pacchetto resta nel percorso di avvio predefinito. Gli host UWP/AppContainer effettivi non sono supportati. Vedere https://github.com/microsoft/testfx/issues/9933. + Do not localize the environment variable name or its value {Locked="TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER"}{Locked="always"}, nor the technology names {Locked="Microsoft Testing Platform"}{Locked="MSIX"}{Locked="Application User Model ID"}{Locked="Windows"}{Locked="packagedClassicApp"}{Locked="win32App"}{Locked="windowsApp"}{Locked="UWP"}{Locked="AppContainer"}. Packaged app test host launcher diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.ja.xlf b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.ja.xlf index b76ff40cd4..c0e3ff850e 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.ja.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.ja.xlf @@ -2,6 +2,61 @@ + + The Microsoft Testing Platform activation-argument payload has an invalid argument count. + The Microsoft Testing Platform activation-argument payload has an invalid argument count. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload has an invalid argument length. + The Microsoft Testing Platform activation-argument payload has an invalid argument length. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation arguments contain an invalid file payload key. + The Microsoft Testing Platform activation arguments contain an invalid file payload key. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation arguments contain an invalid file payload reference. + The Microsoft Testing Platform activation arguments contain an invalid file payload reference. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation arguments contain an invalid inline payload. + The Microsoft Testing Platform activation arguments contain an invalid inline payload. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The launch activation does not contain Microsoft Testing Platform arguments. + The launch activation does not contain Microsoft Testing Platform arguments. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload failed authentication. + The Microsoft Testing Platform activation-argument payload failed authentication. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload could not be read. + The Microsoft Testing Platform activation-argument payload could not be read. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload is too large. + The Microsoft Testing Platform activation-argument payload is too large. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload is truncated. + The Microsoft Testing Platform activation-argument payload is truncated. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload contains trailing data. + The Microsoft Testing Platform activation-argument payload contains trailing data. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + The packaged app manifest declares multiple applications and none uniquely matches the executable '{0}'. Candidate Application User Model IDs: {1}. パッケージ化されたアプリ マニフェストで複数のアプリケーションが宣言されており、実行可能ファイル '{0}' に一意に一致するものがありません。候補のアプリケーション ユーザー モデル ID: {1}。 @@ -18,9 +73,9 @@ - Registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID (Windows build), and — when opted in through TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always — deploys a non-packaged (loose-layout) Windows test host to an isolated directory and launches it from there. Enabled only for a packaged layout by default, so an unpackaged app is left on the default launch path. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933. - パッケージ化された完全に信頼された MSIX デスクトップ テスト ホストを登録し、Application User Model ID (Windows ビルド) によって起動します。また TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always を指定してオプトインされている場合は、パッケージ化されていない (ルース レイアウト) Windows テスト ホストを分離されたディレクトリに展開し、そこから起動します。既定ではパッケージ化されたレイアウトに対してのみ有効なため、パッケージ化されていないアプリは既定の起動パスのままになります。実際の UWP/AppContainer ホストはサポートされていません。次を参照してください: https://github.com/microsoft/testfx/issues/9933。 - Do not localize the environment variable name or its value {Locked="TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER"}{Locked="always"}, nor the technology names {Locked="MSIX"}{Locked="Application User Model ID"}{Locked="Windows"}{Locked="UWP"}{Locked="AppContainer"}. + Registers a packaged MSIX test host and activates it by Application User Model ID (Windows build), delivering Microsoft Testing Platform arguments through argv for packagedClassicApp/win32App hosts (including classic AppContainer hosts) or launch activation for windowsApp/UWP hosts. When opted in through TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always, it also deploys a non-packaged (loose-layout) Windows test host to an isolated directory and launches it from there. Enabled only for a packaged layout by default, so an unpackaged app is left on the default launch path. End-to-end AppContainer execution additionally requires controller-pipe authorization. See https://github.com/microsoft/testfx/issues/10486. + パッケージ化された完全に信頼された MSIX デスクトップ テスト ホストを登録し、Application User Model ID (Windows ビルド) によって起動します。また TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always を指定してオプトインされている場合は、パッケージ化されていない (ルース レイアウト) Windows テスト ホストを分離されたディレクトリに展開し、そこから起動します。既定ではパッケージ化されたレイアウトに対してのみ有効なため、パッケージ化されていないアプリは既定の起動パスのままになります。実際の UWP/AppContainer ホストはサポートされていません。次を参照してください: https://github.com/microsoft/testfx/issues/9933。 + Do not localize the environment variable name or its value {Locked="TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER"}{Locked="always"}, nor the technology names {Locked="Microsoft Testing Platform"}{Locked="MSIX"}{Locked="Application User Model ID"}{Locked="Windows"}{Locked="packagedClassicApp"}{Locked="win32App"}{Locked="windowsApp"}{Locked="UWP"}{Locked="AppContainer"}. Packaged app test host launcher diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.ko.xlf b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.ko.xlf index b20ca57805..2baf3ab063 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.ko.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.ko.xlf @@ -2,6 +2,61 @@ + + The Microsoft Testing Platform activation-argument payload has an invalid argument count. + The Microsoft Testing Platform activation-argument payload has an invalid argument count. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload has an invalid argument length. + The Microsoft Testing Platform activation-argument payload has an invalid argument length. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation arguments contain an invalid file payload key. + The Microsoft Testing Platform activation arguments contain an invalid file payload key. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation arguments contain an invalid file payload reference. + The Microsoft Testing Platform activation arguments contain an invalid file payload reference. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation arguments contain an invalid inline payload. + The Microsoft Testing Platform activation arguments contain an invalid inline payload. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The launch activation does not contain Microsoft Testing Platform arguments. + The launch activation does not contain Microsoft Testing Platform arguments. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload failed authentication. + The Microsoft Testing Platform activation-argument payload failed authentication. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload could not be read. + The Microsoft Testing Platform activation-argument payload could not be read. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload is too large. + The Microsoft Testing Platform activation-argument payload is too large. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload is truncated. + The Microsoft Testing Platform activation-argument payload is truncated. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload contains trailing data. + The Microsoft Testing Platform activation-argument payload contains trailing data. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + The packaged app manifest declares multiple applications and none uniquely matches the executable '{0}'. Candidate Application User Model IDs: {1}. 패키지된 앱 매니페스트는 여러 애플리케이션을 선언하지만 실행 파일 '{0}'에 고유하게 일치하는 애플리케이션이 없습니다. 후보 애플리케이션 사용자 모델 ID: {1}. @@ -18,9 +73,9 @@ - Registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID (Windows build), and — when opted in through TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always — deploys a non-packaged (loose-layout) Windows test host to an isolated directory and launches it from there. Enabled only for a packaged layout by default, so an unpackaged app is left on the default launch path. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933. - 패키지된 완전 신뢰 MSIX 데스크톱 테스트 호스트를 등록하고 Application User Model ID(Windows 빌드)로 활성화합니다. TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always를 통해 옵트인된 경우 격리된 디렉터리에 패키지되지 않은(느슨한 레이아웃) Windows 테스트 호스트를 배포하고 여기에서 시작합니다. 기본적으로 패키지된 레이아웃에 대해서만 사용하도록 설정되므로 패키지되지 않은 앱은 기본 시작 경로에 남아 있습니다. 신뢰 UWP/AppContainer 호스트는 지원되지 않습니다. https://github.com/microsoft/testfx/issues/9933을 참조하세요. - Do not localize the environment variable name or its value {Locked="TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER"}{Locked="always"}, nor the technology names {Locked="MSIX"}{Locked="Application User Model ID"}{Locked="Windows"}{Locked="UWP"}{Locked="AppContainer"}. + Registers a packaged MSIX test host and activates it by Application User Model ID (Windows build), delivering Microsoft Testing Platform arguments through argv for packagedClassicApp/win32App hosts (including classic AppContainer hosts) or launch activation for windowsApp/UWP hosts. When opted in through TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always, it also deploys a non-packaged (loose-layout) Windows test host to an isolated directory and launches it from there. Enabled only for a packaged layout by default, so an unpackaged app is left on the default launch path. End-to-end AppContainer execution additionally requires controller-pipe authorization. See https://github.com/microsoft/testfx/issues/10486. + 패키지된 완전 신뢰 MSIX 데스크톱 테스트 호스트를 등록하고 Application User Model ID(Windows 빌드)로 활성화합니다. TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always를 통해 옵트인된 경우 격리된 디렉터리에 패키지되지 않은(느슨한 레이아웃) Windows 테스트 호스트를 배포하고 여기에서 시작합니다. 기본적으로 패키지된 레이아웃에 대해서만 사용하도록 설정되므로 패키지되지 않은 앱은 기본 시작 경로에 남아 있습니다. 신뢰 UWP/AppContainer 호스트는 지원되지 않습니다. https://github.com/microsoft/testfx/issues/9933을 참조하세요. + Do not localize the environment variable name or its value {Locked="TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER"}{Locked="always"}, nor the technology names {Locked="Microsoft Testing Platform"}{Locked="MSIX"}{Locked="Application User Model ID"}{Locked="Windows"}{Locked="packagedClassicApp"}{Locked="win32App"}{Locked="windowsApp"}{Locked="UWP"}{Locked="AppContainer"}. Packaged app test host launcher diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.pl.xlf b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.pl.xlf index 609a7d8a1b..e6ded94f6a 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.pl.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.pl.xlf @@ -2,6 +2,61 @@ + + The Microsoft Testing Platform activation-argument payload has an invalid argument count. + The Microsoft Testing Platform activation-argument payload has an invalid argument count. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload has an invalid argument length. + The Microsoft Testing Platform activation-argument payload has an invalid argument length. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation arguments contain an invalid file payload key. + The Microsoft Testing Platform activation arguments contain an invalid file payload key. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation arguments contain an invalid file payload reference. + The Microsoft Testing Platform activation arguments contain an invalid file payload reference. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation arguments contain an invalid inline payload. + The Microsoft Testing Platform activation arguments contain an invalid inline payload. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The launch activation does not contain Microsoft Testing Platform arguments. + The launch activation does not contain Microsoft Testing Platform arguments. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload failed authentication. + The Microsoft Testing Platform activation-argument payload failed authentication. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload could not be read. + The Microsoft Testing Platform activation-argument payload could not be read. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload is too large. + The Microsoft Testing Platform activation-argument payload is too large. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload is truncated. + The Microsoft Testing Platform activation-argument payload is truncated. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload contains trailing data. + The Microsoft Testing Platform activation-argument payload contains trailing data. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + The packaged app manifest declares multiple applications and none uniquely matches the executable '{0}'. Candidate Application User Model IDs: {1}. Manifest spakowanej aplikacji deklaruje wiele aplikacji i żaden z nich nie jest jednoznacznie zgodny z plikiem wykonywalnym „{0}”. Identyfikatory modelu użytkownika aplikacji (Application User Model ID): {1}. @@ -18,9 +73,9 @@ - Registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID (Windows build), and — when opted in through TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always — deploys a non-packaged (loose-layout) Windows test host to an isolated directory and launches it from there. Enabled only for a packaged layout by default, so an unpackaged app is left on the default launch path. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933. - Rejestruje spakowany, cieszący się pełnym zaufaniem host testowy MSIX dla komputerów stacjonarnych i aktywuje go na podstawie identyfikatora Application User Model ID (wersja systemu Windows), a także – w przypadku włączenia opcji TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always – wdraża niespakowany (o swobodnym układzie) host testowy systemu Windows do izolowanego katalogu i uruchamia go stamtąd. Domyślnie opcja ta jest włączona tylko dla układów spakowanych, więc aplikacja niespakowana pozostaje w domyślnej ścieżce uruchamiania. Hosty platformy UWP/AppContainer o wartości true nie są obsługiwane. Zobacz stronę https://github.com/microsoft/testfx/issues/9933. - Do not localize the environment variable name or its value {Locked="TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER"}{Locked="always"}, nor the technology names {Locked="MSIX"}{Locked="Application User Model ID"}{Locked="Windows"}{Locked="UWP"}{Locked="AppContainer"}. + Registers a packaged MSIX test host and activates it by Application User Model ID (Windows build), delivering Microsoft Testing Platform arguments through argv for packagedClassicApp/win32App hosts (including classic AppContainer hosts) or launch activation for windowsApp/UWP hosts. When opted in through TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always, it also deploys a non-packaged (loose-layout) Windows test host to an isolated directory and launches it from there. Enabled only for a packaged layout by default, so an unpackaged app is left on the default launch path. End-to-end AppContainer execution additionally requires controller-pipe authorization. See https://github.com/microsoft/testfx/issues/10486. + Rejestruje spakowany, cieszący się pełnym zaufaniem host testowy MSIX dla komputerów stacjonarnych i aktywuje go na podstawie identyfikatora Application User Model ID (wersja systemu Windows), a także – w przypadku włączenia opcji TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always – wdraża niespakowany (o swobodnym układzie) host testowy systemu Windows do izolowanego katalogu i uruchamia go stamtąd. Domyślnie opcja ta jest włączona tylko dla układów spakowanych, więc aplikacja niespakowana pozostaje w domyślnej ścieżce uruchamiania. Hosty platformy UWP/AppContainer o wartości true nie są obsługiwane. Zobacz stronę https://github.com/microsoft/testfx/issues/9933. + Do not localize the environment variable name or its value {Locked="TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER"}{Locked="always"}, nor the technology names {Locked="Microsoft Testing Platform"}{Locked="MSIX"}{Locked="Application User Model ID"}{Locked="Windows"}{Locked="packagedClassicApp"}{Locked="win32App"}{Locked="windowsApp"}{Locked="UWP"}{Locked="AppContainer"}. Packaged app test host launcher diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.pt-BR.xlf b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.pt-BR.xlf index 2ac2bb1623..34480ec4c8 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.pt-BR.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.pt-BR.xlf @@ -2,6 +2,61 @@ + + The Microsoft Testing Platform activation-argument payload has an invalid argument count. + The Microsoft Testing Platform activation-argument payload has an invalid argument count. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload has an invalid argument length. + The Microsoft Testing Platform activation-argument payload has an invalid argument length. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation arguments contain an invalid file payload key. + The Microsoft Testing Platform activation arguments contain an invalid file payload key. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation arguments contain an invalid file payload reference. + The Microsoft Testing Platform activation arguments contain an invalid file payload reference. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation arguments contain an invalid inline payload. + The Microsoft Testing Platform activation arguments contain an invalid inline payload. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The launch activation does not contain Microsoft Testing Platform arguments. + The launch activation does not contain Microsoft Testing Platform arguments. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload failed authentication. + The Microsoft Testing Platform activation-argument payload failed authentication. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload could not be read. + The Microsoft Testing Platform activation-argument payload could not be read. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload is too large. + The Microsoft Testing Platform activation-argument payload is too large. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload is truncated. + The Microsoft Testing Platform activation-argument payload is truncated. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload contains trailing data. + The Microsoft Testing Platform activation-argument payload contains trailing data. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + The packaged app manifest declares multiple applications and none uniquely matches the executable '{0}'. Candidate Application User Model IDs: {1}. O manifesto do aplicativo empacotado declara vários aplicativos e nenhum corresponde exclusivamente ao executável ''{0}''. IDs de Modelo de Usuário do Aplicativo Candidato: {1}. @@ -18,9 +73,9 @@ - Registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID (Windows build), and — when opted in through TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always — deploys a non-packaged (loose-layout) Windows test host to an isolated directory and launches it from there. Enabled only for a packaged layout by default, so an unpackaged app is left on the default launch path. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933. - Registra um host de teste da área de trabalho MSIX empacotado e de confiança total e o ativa por Application User Model ID (build do Windows) — e, quando aceito por meio do TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always — implanta um host de teste do Windows não empacotado (layout solto) em um diretório isolado e o inicia de lá. Por padrão, fica habilitado apenas para um layout empacotado, então um aplicativo não empacotado permanece no caminho de inicialização padrão. Não há suporte para hosts UWP/AppContainer verdadeiros. Veja https://github.com/microsoft/testfx/issues/9933. - Do not localize the environment variable name or its value {Locked="TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER"}{Locked="always"}, nor the technology names {Locked="MSIX"}{Locked="Application User Model ID"}{Locked="Windows"}{Locked="UWP"}{Locked="AppContainer"}. + Registers a packaged MSIX test host and activates it by Application User Model ID (Windows build), delivering Microsoft Testing Platform arguments through argv for packagedClassicApp/win32App hosts (including classic AppContainer hosts) or launch activation for windowsApp/UWP hosts. When opted in through TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always, it also deploys a non-packaged (loose-layout) Windows test host to an isolated directory and launches it from there. Enabled only for a packaged layout by default, so an unpackaged app is left on the default launch path. End-to-end AppContainer execution additionally requires controller-pipe authorization. See https://github.com/microsoft/testfx/issues/10486. + Registra um host de teste da área de trabalho MSIX empacotado e de confiança total e o ativa por Application User Model ID (build do Windows) — e, quando aceito por meio do TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always — implanta um host de teste do Windows não empacotado (layout solto) em um diretório isolado e o inicia de lá. Por padrão, fica habilitado apenas para um layout empacotado, então um aplicativo não empacotado permanece no caminho de inicialização padrão. Não há suporte para hosts UWP/AppContainer verdadeiros. Veja https://github.com/microsoft/testfx/issues/9933. + Do not localize the environment variable name or its value {Locked="TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER"}{Locked="always"}, nor the technology names {Locked="Microsoft Testing Platform"}{Locked="MSIX"}{Locked="Application User Model ID"}{Locked="Windows"}{Locked="packagedClassicApp"}{Locked="win32App"}{Locked="windowsApp"}{Locked="UWP"}{Locked="AppContainer"}. Packaged app test host launcher diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.ru.xlf b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.ru.xlf index 97885c16ae..491e1d653b 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.ru.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.ru.xlf @@ -2,6 +2,61 @@ + + The Microsoft Testing Platform activation-argument payload has an invalid argument count. + The Microsoft Testing Platform activation-argument payload has an invalid argument count. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload has an invalid argument length. + The Microsoft Testing Platform activation-argument payload has an invalid argument length. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation arguments contain an invalid file payload key. + The Microsoft Testing Platform activation arguments contain an invalid file payload key. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation arguments contain an invalid file payload reference. + The Microsoft Testing Platform activation arguments contain an invalid file payload reference. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation arguments contain an invalid inline payload. + The Microsoft Testing Platform activation arguments contain an invalid inline payload. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The launch activation does not contain Microsoft Testing Platform arguments. + The launch activation does not contain Microsoft Testing Platform arguments. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload failed authentication. + The Microsoft Testing Platform activation-argument payload failed authentication. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload could not be read. + The Microsoft Testing Platform activation-argument payload could not be read. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload is too large. + The Microsoft Testing Platform activation-argument payload is too large. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload is truncated. + The Microsoft Testing Platform activation-argument payload is truncated. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload contains trailing data. + The Microsoft Testing Platform activation-argument payload contains trailing data. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + The packaged app manifest declares multiple applications and none uniquely matches the executable '{0}'. Candidate Application User Model IDs: {1}. Манифест упакованного приложения объявляет несколько приложений, и ни одно из них не соответствует однозначно исполняемому файлу "{0}". Идентификаторы пользовательской модели приложений-кандидатов: {1}. @@ -18,9 +73,9 @@ - Registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID (Windows build), and — when opted in through TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always — deploys a non-packaged (loose-layout) Windows test host to an isolated directory and launches it from there. Enabled only for a packaged layout by default, so an unpackaged app is left on the default launch path. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933. - Регистрирует упакованный тестовый узел классической версии MSIX с полным доверием и активирует его по Application User Model ID (сборка Windows) и — при согласии посредством TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always — развертывает неупакованный (со свободной компоновкой) тестовый узел Windows в изолированный каталог и запускает его оттуда. По умолчанию это включено только для упакованной компоновки, поэтому для неупакованного приложения остается путь запуска по умолчанию. Настоящие узлы UWP/AppContainer не поддерживаются. Сведения: https://github.com/microsoft/testfx/issues/9933. - Do not localize the environment variable name or its value {Locked="TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER"}{Locked="always"}, nor the technology names {Locked="MSIX"}{Locked="Application User Model ID"}{Locked="Windows"}{Locked="UWP"}{Locked="AppContainer"}. + Registers a packaged MSIX test host and activates it by Application User Model ID (Windows build), delivering Microsoft Testing Platform arguments through argv for packagedClassicApp/win32App hosts (including classic AppContainer hosts) or launch activation for windowsApp/UWP hosts. When opted in through TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always, it also deploys a non-packaged (loose-layout) Windows test host to an isolated directory and launches it from there. Enabled only for a packaged layout by default, so an unpackaged app is left on the default launch path. End-to-end AppContainer execution additionally requires controller-pipe authorization. See https://github.com/microsoft/testfx/issues/10486. + Регистрирует упакованный тестовый узел классической версии MSIX с полным доверием и активирует его по Application User Model ID (сборка Windows) и — при согласии посредством TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always — развертывает неупакованный (со свободной компоновкой) тестовый узел Windows в изолированный каталог и запускает его оттуда. По умолчанию это включено только для упакованной компоновки, поэтому для неупакованного приложения остается путь запуска по умолчанию. Настоящие узлы UWP/AppContainer не поддерживаются. Сведения: https://github.com/microsoft/testfx/issues/9933. + Do not localize the environment variable name or its value {Locked="TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER"}{Locked="always"}, nor the technology names {Locked="Microsoft Testing Platform"}{Locked="MSIX"}{Locked="Application User Model ID"}{Locked="Windows"}{Locked="packagedClassicApp"}{Locked="win32App"}{Locked="windowsApp"}{Locked="UWP"}{Locked="AppContainer"}. Packaged app test host launcher diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.tr.xlf b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.tr.xlf index 074da1fcda..6a84e5fdcf 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.tr.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.tr.xlf @@ -2,6 +2,61 @@ + + The Microsoft Testing Platform activation-argument payload has an invalid argument count. + The Microsoft Testing Platform activation-argument payload has an invalid argument count. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload has an invalid argument length. + The Microsoft Testing Platform activation-argument payload has an invalid argument length. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation arguments contain an invalid file payload key. + The Microsoft Testing Platform activation arguments contain an invalid file payload key. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation arguments contain an invalid file payload reference. + The Microsoft Testing Platform activation arguments contain an invalid file payload reference. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation arguments contain an invalid inline payload. + The Microsoft Testing Platform activation arguments contain an invalid inline payload. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The launch activation does not contain Microsoft Testing Platform arguments. + The launch activation does not contain Microsoft Testing Platform arguments. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload failed authentication. + The Microsoft Testing Platform activation-argument payload failed authentication. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload could not be read. + The Microsoft Testing Platform activation-argument payload could not be read. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload is too large. + The Microsoft Testing Platform activation-argument payload is too large. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload is truncated. + The Microsoft Testing Platform activation-argument payload is truncated. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload contains trailing data. + The Microsoft Testing Platform activation-argument payload contains trailing data. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + The packaged app manifest declares multiple applications and none uniquely matches the executable '{0}'. Candidate Application User Model IDs: {1}. Paketlenmiş uygulama bildirimi birden çok uygulama bildiriyor ve bunların hiçbiri benzersiz olarak '{0}' yürütülebilir dosyasıyla eşleşmiyor. Aday Uygulama Kullanıcı Modeli Kimlikleri: {1}. @@ -18,9 +73,9 @@ - Registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID (Windows build), and — when opted in through TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always — deploys a non-packaged (loose-layout) Windows test host to an isolated directory and launches it from there. Enabled only for a packaged layout by default, so an unpackaged app is left on the default launch path. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933. - Paketlenmiş, tam güvenilir bir MSIX masaüstü test konağını kaydeder ve onu Application User Model ID ile etkinleştirir (Windows derlemesi) ve TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always aracılığıyla kabul edildiğinde paketlenmemiş (gevşek düzenli) bir Windows test konağını yalıtılmış bir dizine dağıtır ve oradan başlatır. Varsayılan olarak yalnızca paketlenmiş düzen için etkindir, bu nedenle paketlenmemiş bir uygulama varsayılan başlatma yolunda bırakılır. Gerçek UWP/AppContainer konakları desteklenmez. https://github.com/microsoft/testfx/issues/9933 bağlantısına bakın. - Do not localize the environment variable name or its value {Locked="TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER"}{Locked="always"}, nor the technology names {Locked="MSIX"}{Locked="Application User Model ID"}{Locked="Windows"}{Locked="UWP"}{Locked="AppContainer"}. + Registers a packaged MSIX test host and activates it by Application User Model ID (Windows build), delivering Microsoft Testing Platform arguments through argv for packagedClassicApp/win32App hosts (including classic AppContainer hosts) or launch activation for windowsApp/UWP hosts. When opted in through TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always, it also deploys a non-packaged (loose-layout) Windows test host to an isolated directory and launches it from there. Enabled only for a packaged layout by default, so an unpackaged app is left on the default launch path. End-to-end AppContainer execution additionally requires controller-pipe authorization. See https://github.com/microsoft/testfx/issues/10486. + Paketlenmiş, tam güvenilir bir MSIX masaüstü test konağını kaydeder ve onu Application User Model ID ile etkinleştirir (Windows derlemesi) ve TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always aracılığıyla kabul edildiğinde paketlenmemiş (gevşek düzenli) bir Windows test konağını yalıtılmış bir dizine dağıtır ve oradan başlatır. Varsayılan olarak yalnızca paketlenmiş düzen için etkindir, bu nedenle paketlenmemiş bir uygulama varsayılan başlatma yolunda bırakılır. Gerçek UWP/AppContainer konakları desteklenmez. https://github.com/microsoft/testfx/issues/9933 bağlantısına bakın. + Do not localize the environment variable name or its value {Locked="TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER"}{Locked="always"}, nor the technology names {Locked="Microsoft Testing Platform"}{Locked="MSIX"}{Locked="Application User Model ID"}{Locked="Windows"}{Locked="packagedClassicApp"}{Locked="win32App"}{Locked="windowsApp"}{Locked="UWP"}{Locked="AppContainer"}. Packaged app test host launcher diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.zh-Hans.xlf b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.zh-Hans.xlf index 1449a0ba00..e5c0c5c708 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.zh-Hans.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.zh-Hans.xlf @@ -2,6 +2,61 @@ + + The Microsoft Testing Platform activation-argument payload has an invalid argument count. + The Microsoft Testing Platform activation-argument payload has an invalid argument count. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload has an invalid argument length. + The Microsoft Testing Platform activation-argument payload has an invalid argument length. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation arguments contain an invalid file payload key. + The Microsoft Testing Platform activation arguments contain an invalid file payload key. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation arguments contain an invalid file payload reference. + The Microsoft Testing Platform activation arguments contain an invalid file payload reference. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation arguments contain an invalid inline payload. + The Microsoft Testing Platform activation arguments contain an invalid inline payload. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The launch activation does not contain Microsoft Testing Platform arguments. + The launch activation does not contain Microsoft Testing Platform arguments. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload failed authentication. + The Microsoft Testing Platform activation-argument payload failed authentication. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload could not be read. + The Microsoft Testing Platform activation-argument payload could not be read. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload is too large. + The Microsoft Testing Platform activation-argument payload is too large. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload is truncated. + The Microsoft Testing Platform activation-argument payload is truncated. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload contains trailing data. + The Microsoft Testing Platform activation-argument payload contains trailing data. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + The packaged app manifest declares multiple applications and none uniquely matches the executable '{0}'. Candidate Application User Model IDs: {1}. 打包应用部件清单声明了多个应用程序,而没有一个与可执行文件 '{0}' 唯一匹配。候选应用程序用户模型 ID: {1}。 @@ -18,9 +73,9 @@ - Registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID (Windows build), and — when opted in through TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always — deploys a non-packaged (loose-layout) Windows test host to an isolated directory and launches it from there. Enabled only for a packaged layout by default, so an unpackaged app is left on the default launch path. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933. - 注册已打包的完全信任 MSIX 桌面测试主机,并通过 Application User Model ID 激活它(Windows 版本),并且(当通过 TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always 选择加入时)将非打包(松散布局) Windows 测试主机部署到隔离目录并从该目录启动它。默认情况下仅对打包布局启用,因此未打包的应用保留在默认启动路径上。不支持真正的 UWP/AppContainer 主机。请参阅 https://github.com/microsoft/testfx/issues/9933。 - Do not localize the environment variable name or its value {Locked="TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER"}{Locked="always"}, nor the technology names {Locked="MSIX"}{Locked="Application User Model ID"}{Locked="Windows"}{Locked="UWP"}{Locked="AppContainer"}. + Registers a packaged MSIX test host and activates it by Application User Model ID (Windows build), delivering Microsoft Testing Platform arguments through argv for packagedClassicApp/win32App hosts (including classic AppContainer hosts) or launch activation for windowsApp/UWP hosts. When opted in through TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always, it also deploys a non-packaged (loose-layout) Windows test host to an isolated directory and launches it from there. Enabled only for a packaged layout by default, so an unpackaged app is left on the default launch path. End-to-end AppContainer execution additionally requires controller-pipe authorization. See https://github.com/microsoft/testfx/issues/10486. + 注册已打包的完全信任 MSIX 桌面测试主机,并通过 Application User Model ID 激活它(Windows 版本),并且(当通过 TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always 选择加入时)将非打包(松散布局) Windows 测试主机部署到隔离目录并从该目录启动它。默认情况下仅对打包布局启用,因此未打包的应用保留在默认启动路径上。不支持真正的 UWP/AppContainer 主机。请参阅 https://github.com/microsoft/testfx/issues/9933。 + Do not localize the environment variable name or its value {Locked="TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER"}{Locked="always"}, nor the technology names {Locked="Microsoft Testing Platform"}{Locked="MSIX"}{Locked="Application User Model ID"}{Locked="Windows"}{Locked="packagedClassicApp"}{Locked="win32App"}{Locked="windowsApp"}{Locked="UWP"}{Locked="AppContainer"}. Packaged app test host launcher diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.zh-Hant.xlf b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.zh-Hant.xlf index 0980453098..021208ba25 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.zh-Hant.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.zh-Hant.xlf @@ -2,6 +2,61 @@ + + The Microsoft Testing Platform activation-argument payload has an invalid argument count. + The Microsoft Testing Platform activation-argument payload has an invalid argument count. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload has an invalid argument length. + The Microsoft Testing Platform activation-argument payload has an invalid argument length. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation arguments contain an invalid file payload key. + The Microsoft Testing Platform activation arguments contain an invalid file payload key. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation arguments contain an invalid file payload reference. + The Microsoft Testing Platform activation arguments contain an invalid file payload reference. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation arguments contain an invalid inline payload. + The Microsoft Testing Platform activation arguments contain an invalid inline payload. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The launch activation does not contain Microsoft Testing Platform arguments. + The launch activation does not contain Microsoft Testing Platform arguments. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload failed authentication. + The Microsoft Testing Platform activation-argument payload failed authentication. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload could not be read. + The Microsoft Testing Platform activation-argument payload could not be read. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload is too large. + The Microsoft Testing Platform activation-argument payload is too large. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload is truncated. + The Microsoft Testing Platform activation-argument payload is truncated. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + + + The Microsoft Testing Platform activation-argument payload contains trailing data. + The Microsoft Testing Platform activation-argument payload contains trailing data. + Do not localize the technology name {Locked="Microsoft Testing Platform"}. + The packaged app manifest declares multiple applications and none uniquely matches the executable '{0}'. Candidate Application User Model IDs: {1}. 封裝的應用程式資訊清單會宣告多個應用程式,且沒有一個能唯一地符合可執行檔 '{0}'。候選應用程式使用者模型識別碼: {1}。 @@ -18,9 +73,9 @@ - Registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID (Windows build), and — when opted in through TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always — deploys a non-packaged (loose-layout) Windows test host to an isolated directory and launches it from there. Enabled only for a packaged layout by default, so an unpackaged app is left on the default launch path. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933. - 註冊已封裝、完整信任的 MSIX 桌面測試主機,並透過Application User Model ID碼 (Windows 組建)啟用該主機,此外,當透過 TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always 選擇啟用時,會將非封裝 (鬆散配置) 的 Windows 測試主機部署至隔離目錄,並從該目錄啟動。預設只會針對封裝配置啟用,因此未封裝的應用程式會保留在預設啟動路徑上。不支援真正的 UWP/AppContainer 主機。請參閱 https://github.com/microsoft/testfx/issues/9933。 - Do not localize the environment variable name or its value {Locked="TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER"}{Locked="always"}, nor the technology names {Locked="MSIX"}{Locked="Application User Model ID"}{Locked="Windows"}{Locked="UWP"}{Locked="AppContainer"}. + Registers a packaged MSIX test host and activates it by Application User Model ID (Windows build), delivering Microsoft Testing Platform arguments through argv for packagedClassicApp/win32App hosts (including classic AppContainer hosts) or launch activation for windowsApp/UWP hosts. When opted in through TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always, it also deploys a non-packaged (loose-layout) Windows test host to an isolated directory and launches it from there. Enabled only for a packaged layout by default, so an unpackaged app is left on the default launch path. End-to-end AppContainer execution additionally requires controller-pipe authorization. See https://github.com/microsoft/testfx/issues/10486. + 註冊已封裝、完整信任的 MSIX 桌面測試主機,並透過Application User Model ID碼 (Windows 組建)啟用該主機,此外,當透過 TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always 選擇啟用時,會將非封裝 (鬆散配置) 的 Windows 測試主機部署至隔離目錄,並從該目錄啟動。預設只會針對封裝配置啟用,因此未封裝的應用程式會保留在預設啟動路徑上。不支援真正的 UWP/AppContainer 主機。請參閱 https://github.com/microsoft/testfx/issues/9933。 + Do not localize the environment variable name or its value {Locked="TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER"}{Locked="always"}, nor the technology names {Locked="Microsoft Testing Platform"}{Locked="MSIX"}{Locked="Application User Model ID"}{Locked="Windows"}{Locked="packagedClassicApp"}{Locked="win32App"}{Locked="windowsApp"}{Locked="UWP"}{Locked="AppContainer"}. Packaged app test host launcher diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/PackagedAppActivationArgumentsTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/PackagedAppActivationArgumentsTests.cs new file mode 100644 index 0000000000..77421986ec --- /dev/null +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/PackagedAppActivationArgumentsTests.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +namespace Microsoft.Testing.Platform.Acceptance.IntegrationTests; + +[TestClass] +public sealed class PackagedAppActivationArgumentsTests : AcceptanceTestBase +{ + private const string AssetName = "PackagedAppActivationArgumentsTest"; + + [DynamicData(nameof(TargetFrameworks.NetForDynamicData), typeof(TargetFrameworks))] + [TestMethod] + [OSCondition(ConditionMode.Include, OperatingSystems.Windows, IgnoreMessage = "LaunchActivatedEventArgs is a Windows application activation contract.")] + public async Task AppContainerOnLaunched_RestoresArgumentsBeforeMtpParsesThem(string currentTfm) + { + var testHost = TestInfrastructure.TestHost.LocateFrom(AssetFixture.TargetAssetPath, AssetName, currentTfm); + string markerPath = Path.Combine(testHost.DirectoryName, $"activation-arguments-{Guid.NewGuid():N}.txt"); + string[] expectedArguments = ["--help"]; + + try + { + TestHostResult result = await testHost.ExecuteAsync( + environmentVariables: new Dictionary + { + ["PACKAGEDAPP_ACTIVATION_ARGUMENTS"] = CreateInlineActivationArguments(expectedArguments), + ["PACKAGEDAPP_ACTIVATION_MARKER"] = markerPath, + }, + cancellationToken: TestContext.CancellationToken); + + result.AssertExitCodeIs(ExitCode.Success); + Assert.IsTrue(File.Exists(markerPath), "The activation-shaped host must record arguments only after MTP accepts them."); + string[] actualArguments = File.ReadAllLines(markerPath); + Assert.HasCount(expectedArguments.Length, actualArguments); + for (int i = 0; i < expectedArguments.Length; i++) + { + Assert.AreEqual(expectedArguments[i], actualArguments[i], $"Argument {i} differs."); + } + } + finally + { + File.Delete(markerPath); + } + } + + private static string CreateInlineActivationArguments(IReadOnlyList arguments) + { + int byteCount = sizeof(int) + arguments.Sum(static argument => sizeof(int) + (argument.Length * sizeof(char))); + byte[] payload = new byte[byteCount]; + WriteInt32(payload, arguments.Count); + int offset = sizeof(int); + foreach (string argument in arguments) + { + WriteInt32(payload.AsSpan(offset), argument.Length); + offset += sizeof(int); + foreach (char value in argument) + { + payload[offset++] = (byte)value; + payload[offset++] = (byte)(value >> 8); + } + } + + return "mtp:v1:inline:" + Convert.ToBase64String(payload); + } + + private static void WriteInt32(Span destination, int value) + { + destination[0] = (byte)value; + destination[1] = (byte)(value >> 8); + destination[2] = (byte)(value >> 16); + destination[3] = (byte)(value >> 24); + } + + public sealed class TestAssetFixture() : TestAssetFixtureBase() + { + private const string Sources = """ + #file PackagedAppActivationArgumentsTest.csproj + + + + $TargetFrameworks$ + Exe + true + enable + preview + + + + + + + + #file Program.cs + using System; + using System.IO; + using System.Threading.Tasks; + using Microsoft.Testing.Extensions; + using Microsoft.Testing.Platform.Builder; + + public static class Program + { + public static Task Main() + { + string activationArguments = Environment.GetEnvironmentVariable("PACKAGEDAPP_ACTIVATION_ARGUMENTS") + ?? throw new InvalidOperationException("Missing activation arguments."); + return new ActivationApplication().OnLaunched(new LaunchActivatedEventArgs(activationArguments)); + } + } + + // Mirrors the Windows.ApplicationModel.Activation shape without requiring package registration. + // A real UWP/WinUI AppContainer override passes args.Arguments to the same package API. + public sealed class ActivationApplication + { + public async Task OnLaunched(LaunchActivatedEventArgs args) + { + string[] cliArgs = PackagedAppExtensions.GetTestApplicationArguments(args.Arguments); + + // CreateBuilderAsync performs MTP's real command-line parse. Write the marker only after + // it succeeds, proving the restored array was available at the required bootstrap point. + _ = await TestApplication.CreateBuilderAsync(cliArgs); + File.WriteAllLines( + Environment.GetEnvironmentVariable("PACKAGEDAPP_ACTIVATION_MARKER") + ?? throw new InvalidOperationException("Missing activation marker path."), + cliArgs); + return 0; + } + } + + public sealed record LaunchActivatedEventArgs(string Arguments); + """; + + public string TargetAssetPath => GetAssetPath(AssetName); + + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (AssetName, AssetName, + Sources + .PatchTargetFrameworks(TargetFrameworks.Net) + .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion) + .PatchCodeWithReplace("$MicrosoftTestingExtensionsPackagedAppVersion$", MicrosoftTestingExtensionsPackagedAppVersion)); + } + + public TestContext TestContext { get; set; } +} diff --git a/test/UnitTests/Microsoft.Testing.Extensions.UnitTests/AppxManifestInfoTests.cs b/test/UnitTests/Microsoft.Testing.Extensions.UnitTests/AppxManifestInfoTests.cs index 70724c46d4..008cd3940d 100644 --- a/test/UnitTests/Microsoft.Testing.Extensions.UnitTests/AppxManifestInfoTests.cs +++ b/test/UnitTests/Microsoft.Testing.Extensions.UnitTests/AppxManifestInfoTests.cs @@ -108,6 +108,205 @@ public void ReadFromManifest_ParsesAllApplicationsInManifestOrder() Assert.AreEqual("Second.exe", info.Applications[1].Executable); } + [TestMethod] + public void ReadFromManifest_LegacyUwpApplication_IsAppContainer() + { + const string ManifestXml = """ + + + + + + + + """; + + Assert.IsTrue(Assert.ContainsSingle(ReadManifest(ManifestXml).Applications).UsesLaunchActivationArguments); + } + + [TestMethod] + public void ReadFromManifest_ExplicitAppContainerTrustLevel_IsAppContainer() + { + const string ManifestXml = """ + + + + + + + + """; + + Assert.IsTrue(Assert.ContainsSingle(ReadManifest(ManifestXml).Applications).UsesLaunchActivationArguments); + } + + [TestMethod] + public void ReadFromManifest_PackagedDesktopApplication_IsNotAppContainer() + { + const string ManifestXml = """ + + + + + + + + + + + """; + + Assert.IsFalse(Assert.ContainsSingle(ReadManifest(ManifestXml).Applications).UsesLaunchActivationArguments); + } + + [TestMethod] + public void ReadFromManifest_SingleApplicationRunFullTrustPackage_IsNotAppContainer() + { + const string ManifestXml = """ + + + + + + + + + + + """; + + Assert.IsFalse(Assert.ContainsSingle(ReadManifest(ManifestXml).Applications).UsesLaunchActivationArguments); + } + + [TestMethod] + public void ReadFromManifest_SingleUwpApplicationWithFullTrustCompanionExtension_IsAppContainer() + { + const string ManifestXml = """ + + + + + + + + + + + + + + + """; + + Assert.IsTrue(Assert.ContainsSingle(ReadManifest(ManifestXml).Applications).UsesLaunchActivationArguments); + } + + [TestMethod] + public void ReadFromManifest_MixedPackage_DoesNotApplyCompanionRunFullTrustCapabilityToUwpApplication() + { + const string ManifestXml = """ + + + + + + + + + + + + """; + + AppxManifestInfo manifest = ReadManifest(ManifestXml); + + Assert.IsTrue(manifest.Applications[0].UsesLaunchActivationArguments); + Assert.IsFalse(manifest.Applications[1].UsesLaunchActivationArguments); + } + + [TestMethod] + public void ReadFromManifest_ExplicitPackagedClassicRuntimeBehavior_IsNotAppContainer() + { + const string ManifestXml = """ + + + + + + + + """; + + Assert.IsFalse(Assert.ContainsSingle(ReadManifest(ManifestXml).Applications).UsesLaunchActivationArguments); + } + + [TestMethod] + public void ReadFromManifest_ExplicitMediumIntegrityTrustLevel_IsNotAppContainer() + { + const string ManifestXml = """ + + + + + + + + """; + + Assert.IsFalse(Assert.ContainsSingle(ReadManifest(ManifestXml).Applications).UsesLaunchActivationArguments); + } + + [TestMethod] + public void ReadFromManifest_PackagedClassicAppContainer_UsesProcessArguments() + { + const string ManifestXml = """ + + + + + + + + """; + + Assert.IsFalse(Assert.ContainsSingle(ReadManifest(ManifestXml).Applications).UsesLaunchActivationArguments); + } + + [TestMethod] + public void ReadFromManifest_WindowsAppMediumIntegrity_UsesLaunchActivation() + { + const string ManifestXml = """ + + + + + + + + """; + + Assert.IsTrue(Assert.ContainsSingle(ReadManifest(ManifestXml).Applications).UsesLaunchActivationArguments); + } + [TestMethod] public void ResolveApplication_WithSingleApplication_ReturnsItRegardlessOfExecutable() { diff --git a/test/UnitTests/Microsoft.Testing.Extensions.UnitTests/PackagedAppActivationArgumentsTests.cs b/test/UnitTests/Microsoft.Testing.Extensions.UnitTests/PackagedAppActivationArgumentsTests.cs new file mode 100644 index 0000000000..ef8648f612 --- /dev/null +++ b/test/UnitTests/Microsoft.Testing.Extensions.UnitTests/PackagedAppActivationArgumentsTests.cs @@ -0,0 +1,301 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// The PackagedApp extension only targets .NET (net8.0/net9.0), so these tests are compiled only there. +#if !NETFRAMEWORK + +using Microsoft.Testing.Extensions; +using Microsoft.Testing.Extensions.PackagedApp; + +namespace Microsoft.Testing.Extensions.UnitTests; + +[TestClass] +public sealed class PackagedAppActivationArgumentsTests +{ + [TestMethod] + public void CreateThenRead_InlinePayload_RoundTripsEveryArgumentShape() + { + string directory = CreateTemporaryDirectory(); + try + { + string[] expected = + [ + "--filter", + string.Empty, + " ", + "two words", + "\"quoted\"", + @"trailing\", + @"before\\\""quote", + "equals=value:semicolon;colon:", + "こんにちは 🌍", + "--filter", + "second", + ]; + + PackagedAppActivationData activation = PackagedAppActivationArguments.Create(expected, directory); + string[] actual = PackagedAppActivationArguments.Read(activation.Arguments, directory); + + Assert.IsNull(activation.PayloadPath); + Assert.IsLessThanOrEqualTo(2048, activation.Arguments.Length); + AssertArgumentsAreEqual(expected, actual); + } + finally + { + Directory.Delete(directory, recursive: true); + } + } + + [TestMethod] + public void CreateThenRead_LargePayload_UsesEncryptedOneShotFile() + { + string directory = CreateTemporaryDirectory(); + try + { + string secret = "secret-runsettings-" + new string('x', 3000); + string[] expected = ["--settings", secret, "--filter", "Name=Sensitive"]; + + PackagedAppActivationData activation = PackagedAppActivationArguments.Create(expected, directory); + + Assert.IsNotNull(activation.PayloadPath); + Assert.IsTrue(File.Exists(activation.PayloadPath)); + byte[] encryptedPayload = File.ReadAllBytes(activation.PayloadPath); + byte[] plaintextSecret = Encoding.Unicode.GetBytes(secret); + Assert.AreEqual(-1, encryptedPayload.AsSpan().IndexOf(plaintextSecret), "The LocalState payload must not contain the plaintext secret."); + + string[] actual = PackagedAppActivationArguments.Read(activation.Arguments, directory); + + AssertArgumentsAreEqual(expected, actual); + Assert.IsFalse(File.Exists(activation.PayloadPath), "The activated host must consume the encrypted payload exactly once."); + } + finally + { + Directory.Delete(directory, recursive: true); + } + } + + [TestMethod] + public void Read_LargePayloadWithWrongKey_RejectsAndDeletesPayload() + { + string directory = CreateTemporaryDirectory(); + try + { + PackagedAppActivationData activation = PackagedAppActivationArguments.Create([new string('x', 3000)], directory); + Assert.IsNotNull(activation.PayloadPath); + + int keySeparator = activation.Arguments.LastIndexOf(':'); + string wrongKey = Convert.ToBase64String(new byte[32]); + string tamperedArguments = activation.Arguments[..(keySeparator + 1)] + wrongKey; + + Assert.ThrowsExactly(() => PackagedAppActivationArguments.Read(tamperedArguments, directory)); + Assert.IsFalse(File.Exists(activation.PayloadPath), "A rejected payload must not leave user data behind."); + } + finally + { + Directory.Delete(directory, recursive: true); + } + } + + [TestMethod] + public void Read_RejectsMalformedOrForeignActivationArguments() + { + Assert.ThrowsExactly(() => PackagedAppActivationArguments.Read("not-an-mtp-activation", localStateDirectory: null)); + Assert.ThrowsExactly(() => PackagedAppActivationArguments.Read("mtp:v1:inline:not-base64!", localStateDirectory: null)); + Assert.ThrowsExactly(() => PackagedAppActivationArguments.Read("mtp:v1:file:not-a-token:not-a-key", Path.GetTempPath())); + } + + [TestMethod] + public void Read_RejectsMalformedInlineBinaryPayloads() + { + string[] malformedPayloads = + [ + CreateInlinePayload([0, 0, 0]), + CreateInlinePayload([255, 255, 255, 255]), + CreateInlinePayload([1, 0, 0, 0]), + CreateInlinePayload([1, 0, 0, 0, 255, 255, 255, 255]), + CreateInlinePayload([0, 0, 0, 0, 1]), + ]; + + foreach (string payload in malformedPayloads) + { + Assert.ThrowsExactly(() => PackagedAppActivationArguments.Read(payload, localStateDirectory: null)); + } + } + + [TestMethod] + public void Read_TruncatedEncryptedPayload_RejectsAndDeletesPayload() + { + string directory = CreateTemporaryDirectory(); + try + { + PackagedAppActivationData activation = PackagedAppActivationArguments.Create([new string('x', 3000)], directory); + Assert.IsNotNull(activation.PayloadPath); + File.WriteAllBytes(activation.PayloadPath, new byte[10]); + + Assert.ThrowsExactly(() => PackagedAppActivationArguments.Read(activation.Arguments, directory)); + Assert.IsFalse(File.Exists(activation.PayloadPath), "A truncated payload must be consumed exactly once."); + } + finally + { + Directory.Delete(directory, recursive: true); + } + } + + [TestMethod] + public void Read_EncryptedPayload_CanOnlyBeConsumedOnce() + { + string directory = CreateTemporaryDirectory(); + try + { + string[] expected = [new string('x', 3000)]; + PackagedAppActivationData activation = PackagedAppActivationArguments.Create(expected, directory); + + string[] actual = PackagedAppActivationArguments.Read(activation.Arguments, directory); + + AssertArgumentsAreEqual(expected, actual); + Assert.ThrowsExactly(() => PackagedAppActivationArguments.Read(activation.Arguments, directory)); + } + finally + { + Directory.Delete(directory, recursive: true); + } + } + + [TestMethod] + public void TryDeleteStalePayloads_RemovesOnlyExpiredActivationPayloads() + { + string directory = CreateTemporaryDirectory(); + try + { + DateTime utcNow = new(2026, 8, 7, 1, 0, 0, DateTimeKind.Utc); + string stalePayload = Path.Combine(directory, "mtp-activation-stale.payload"); + string freshPayload = Path.Combine(directory, "mtp-activation-fresh.payload"); + string unrelatedFile = Path.Combine(directory, "unrelated.payload"); + File.WriteAllText(stalePayload, "stale"); + File.WriteAllText(freshPayload, "fresh"); + File.WriteAllText(unrelatedFile, "unrelated"); + File.SetLastWriteTimeUtc(stalePayload, utcNow - TimeSpan.FromDays(2)); + File.SetLastWriteTimeUtc(freshPayload, utcNow); + File.SetLastWriteTimeUtc(unrelatedFile, utcNow - TimeSpan.FromDays(2)); + + PackagedAppActivationArguments.TryDeleteStalePayloads(directory, utcNow); + + Assert.IsFalse(File.Exists(stalePayload)); + Assert.IsTrue(File.Exists(freshPayload)); + Assert.IsTrue(File.Exists(unrelatedFile)); + } + finally + { + Directory.Delete(directory, recursive: true); + } + } + + [TestMethod] + public void Create_InlinePayload_AlsoScavengesStaleSpillPayloads() + { + string directory = CreateTemporaryDirectory(); + try + { + string stalePayload = Path.Combine(directory, "mtp-activation-orphan.payload"); + File.WriteAllText(stalePayload, "stale"); + File.SetLastWriteTimeUtc(stalePayload, DateTime.UnixEpoch); + + PackagedAppActivationData activation = PackagedAppActivationArguments.Create(["--help"], directory); + + Assert.IsNull(activation.PayloadPath); + Assert.IsFalse(File.Exists(stalePayload)); + } + finally + { + Directory.Delete(directory, recursive: true); + } + } + + [TestMethod] + public void GetTestApplicationArguments_ProvidesTheReusableOnLaunchedBootstrap() + { + string directory = CreateTemporaryDirectory(); + try + { + string[] expected = ["--help", "value with spaces", "\"quoted\"", string.Empty]; + PackagedAppActivationData activation = PackagedAppActivationArguments.Create(expected, directory); + + string[] actual = PackagedAppExtensions.GetTestApplicationArguments(activation.Arguments); + + AssertArgumentsAreEqual(expected, actual); + } + finally + { + Directory.Delete(directory, recursive: true); + } + } + + [TestMethod] + public void ReadActivationArgumentsAndApplyConnectBack_PackageShapedHost_RestoresEnvironmentAndConsumesHandshake() + { + string directory = CreateTemporaryDirectory(); + try + { + File.WriteAllText( + Path.Combine(directory, AppxManifestInfo.AppxManifestFileName), + """ + + + + + + + + """); + + const string ControllerPid = "4321"; + string handshakePath = Path.Combine(directory, PackagedAppConnectBackHandshake.GetHandshakeFileName(ControllerPid)); + PackagedAppConnectBackHandshake.Write( + handshakePath, + new Dictionary + { + ["TESTINGPLATFORM_TESTHOSTCONTROLLER_PIPENAME_4321"] = "MONITORTOHOST_deadbeef", + }); + + string[] expectedArguments = ["--internal-testhostcontroller-pid", ControllerPid, "--help"]; + PackagedAppActivationData activation = PackagedAppActivationArguments.Create(expectedArguments, directory); + var restoredEnvironment = new Dictionary(StringComparer.Ordinal); + + string[] actualArguments = PackagedAppConnectBackReader.ReadActivationArgumentsAndApplyConnectBack( + activation.Arguments, + directory, + directory, + () => directory, + (name, value) => restoredEnvironment[name] = value); + + AssertArgumentsAreEqual(expectedArguments, actualArguments); + Assert.AreEqual("MONITORTOHOST_deadbeef", restoredEnvironment["TESTINGPLATFORM_TESTHOSTCONTROLLER_PIPENAME_4321"]); + Assert.IsFalse(File.Exists(handshakePath), "The bootstrap must consume the connect-back handshake before returning."); + } + finally + { + Directory.Delete(directory, recursive: true); + } + } + + private static string CreateTemporaryDirectory() + { + string directory = Path.Combine(Path.GetTempPath(), "PackagedAppActivationArgumentsTests", Guid.NewGuid().ToString("N")); + Directory.CreateDirectory(directory); + return directory; + } + + private static string CreateInlinePayload(byte[] payload) + => "mtp:v1:inline:" + Convert.ToBase64String(payload); + + private static void AssertArgumentsAreEqual(string[] expected, string[] actual) + { + Assert.HasCount(expected.Length, actual); + for (int i = 0; i < expected.Length; i++) + { + Assert.AreEqual(expected[i], actual[i], $"Argument {i} differs."); + } + } +} + +#endif diff --git a/test/UnitTests/Microsoft.Testing.Extensions.UnitTests/PackagedAppTestHostLauncherTests.cs b/test/UnitTests/Microsoft.Testing.Extensions.UnitTests/PackagedAppTestHostLauncherTests.cs index 4286c1f667..ffcbbf3f97 100644 --- a/test/UnitTests/Microsoft.Testing.Extensions.UnitTests/PackagedAppTestHostLauncherTests.cs +++ b/test/UnitTests/Microsoft.Testing.Extensions.UnitTests/PackagedAppTestHostLauncherTests.cs @@ -185,6 +185,48 @@ public async Task LaunchTestHostAsync_WithAncestorManifestDeclaringDeepExecutabl Assert.Contains($"Contoso.MyTestApp_{MicrosoftStorePublisherId}!App", exception.Message); } + [TestMethod] + public void CreateActivationArguments_WithAppContainerApplication_UsesOpaquePayload() + { + string directory = Path.Combine(Path.GetTempPath(), "PackagedAppTestHostLauncherTests", Guid.NewGuid().ToString("N")); + try + { + string[] expected = ["--filter", "two words", string.Empty]; + var application = new AppxApplicationInfo("App", "App.exe", "Contoso!App", usesLaunchActivationArguments: true); + + PackagedAppActivationData activation = PackagedAppTestHostLauncher.CreateActivationArguments(application, expected, directory); + string[] actual = PackagedAppActivationArguments.Read(activation.Arguments, directory); + + Assert.IsNull(activation.PayloadPath); + Assert.HasCount(expected.Length, actual); + for (int i = 0; i < expected.Length; i++) + { + Assert.AreEqual(expected[i], actual[i], $"Argument {i} differs."); + } + } + finally + { + if (Directory.Exists(directory)) + { + Directory.Delete(directory, recursive: true); + } + } + } + + [TestMethod] + public void CreateActivationArguments_WithFullTrustApplication_UsesWindowsArgvQuoting() + { + var application = new AppxApplicationInfo("App", "App.exe", "Contoso!App", usesLaunchActivationArguments: false); + + PackagedAppActivationData activation = PackagedAppTestHostLauncher.CreateActivationArguments( + application, + ["--filter", "two words", string.Empty], + Path.GetTempPath()); + + Assert.IsNull(activation.PayloadPath); + Assert.AreEqual("--filter \"two words\" \"\"", activation.Arguments); + } + private static Task LaunchInLayoutContainingManifestAsync(string? applicationId) => LaunchInLayoutContainingManifestAsync( BuildManifestXml("Contoso.MyTestApp", MicrosoftStorePublisher, applicationId),