From 72d8853ac648e80ba1466cec1c3f127b0ed778ac Mon Sep 17 00:00:00 2001 From: Howard Kapustein Date: Mon, 16 Sep 2024 21:41:03 -0700 Subject: [PATCH 01/27] Delegate to OS RegFreeWinRT when available (>=19H1) --- dev/UndockedRegFreeWinRT/urfw.cpp | 32 +++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/dev/UndockedRegFreeWinRT/urfw.cpp b/dev/UndockedRegFreeWinRT/urfw.cpp index 03597fb184..bba8852165 100644 --- a/dev/UndockedRegFreeWinRT/urfw.cpp +++ b/dev/UndockedRegFreeWinRT/urfw.cpp @@ -9,6 +9,8 @@ #include #include +#include + #include "urfw.h" #include "catalog.h" @@ -58,18 +60,18 @@ static decltype(RoGetActivationFactory)* TrueRoGetActivationFactory = RoGetActiv static decltype(RoGetMetaDataFile)* TrueRoGetMetaDataFile = RoGetMetaDataFile; static decltype(RoResolveNamespace)* TrueRoResolveNamespace = RoResolveNamespace; +static bool g_apisAreDetoured{}; + enum class ActivationLocation { CurrentApartment, CrossApartmentMTA }; -VOID CALLBACK EnsureMTAInitializedCallBack -( +VOID CALLBACK EnsureMTAInitializedCallBack( PTP_CALLBACK_INSTANCE /*instance*/, PVOID /*parameter*/, - PTP_WORK /*work*/ -) + PTP_WORK /*work*/) { Microsoft::WRL::ComPtr spThreadingInfo; CoGetObjectContext(IID_PPV_ARGS(&spThreadingInfo)); @@ -405,10 +407,20 @@ HRESULT ExtRoLoadCatalog() HRESULT UrfwInitialize() noexcept { + // Windows' Reg-Free WinRT first appeared in Windows 10 Version 1903, May 2019 Update (aka 19H1) + // https://blogs.windows.com/windowsdeveloper/2019/04/30/enhancing-non-packaged-desktop-apps-using-windows-runtime-components/ + // Delegate to the OS' implementation when available + if (WindowsVersion::IsWindows10_19H1OrGreater()) + { + return S_OK; + } + + // OS Reg-Free WinRT isn't available so let's do it ourselves... DetourAttach(&(PVOID&)TrueRoActivateInstance, RoActivateInstanceDetour); DetourAttach(&(PVOID&)TrueRoGetActivationFactory, RoGetActivationFactoryDetour); DetourAttach(&(PVOID&)TrueRoGetMetaDataFile, RoGetMetaDataFileDetour); DetourAttach(&(PVOID&)TrueRoResolveNamespace, RoResolveNamespaceDetour); + g_apisAreDetoured = true; try { RETURN_IF_FAILED(ExtRoLoadCatalog()); @@ -422,10 +434,14 @@ HRESULT UrfwInitialize() noexcept void UrfwShutdown() noexcept { - DetourDetach(&(PVOID&)TrueRoActivateInstance, RoActivateInstanceDetour); - DetourDetach(&(PVOID&)TrueRoGetActivationFactory, RoGetActivationFactoryDetour); - DetourDetach(&(PVOID&)TrueRoGetMetaDataFile, RoGetMetaDataFileDetour); - DetourDetach(&(PVOID&)TrueRoResolveNamespace, RoResolveNamespaceDetour); + if (g_apisAreDetoured) + { + DetourDetach(&(PVOID&)TrueRoActivateInstance, RoActivateInstanceDetour); + DetourDetach(&(PVOID&)TrueRoGetActivationFactory, RoGetActivationFactoryDetour); + DetourDetach(&(PVOID&)TrueRoGetMetaDataFile, RoGetMetaDataFileDetour); + DetourDetach(&(PVOID&)TrueRoResolveNamespace, RoResolveNamespaceDetour); + g_apisAreDetoured = false; + } } extern "C" void WINAPI winrtact_Initialize() From 1877de95369c4fe5a28c2c62edd32918bccdcf12 Mon Sep 17 00:00:00 2001 From: Howard Kapustein Date: Sun, 6 Oct 2024 22:38:31 -0700 Subject: [PATCH 02/27] Changed DevCheck to emit expected TAEF version found (not just -Verbose). Added -CheckTAEFService -CheckVisualStudio -CheckDeveloperMode to 'DevCheck: Setup/Verify developer environment' to cover the missing checks --- .../AzurePipelinesTemplates/WindowsAppSDK-RunTests-Steps.yml | 2 +- .../WindowsAppSDK-SetupBuildEnvironment-Steps.yml | 2 +- tools/DevCheck/DevCheck.ps1 | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-RunTests-Steps.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-RunTests-Steps.yml index e648150ae9..191e6eea19 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-RunTests-Steps.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-RunTests-Steps.yml @@ -11,7 +11,7 @@ steps: inputs: targetType: filePath filePath: tools\DevCheck\DevCheck.ps1 - arguments: -NoInteractive -Offline -Verbose -CertPassword 'BuildPipeline' -CheckTestPfx -Clean -CheckDependencies -ShowSystemInfo + arguments: -NoInteractive -Offline -Verbose -CertPassword 'BuildPipeline' -CheckTestPfx -Clean -CheckDependencies -CheckTAEFService -CheckVisualStudio -CheckDeveloperMode -ShowSystemInfo workingDirectory: '$(Build.SourcesDirectory)' - task: DownloadPipelineArtifact@2 diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-SetupBuildEnvironment-Steps.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-SetupBuildEnvironment-Steps.yml index d4eaf77c2d..0b19a0b09e 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-SetupBuildEnvironment-Steps.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-SetupBuildEnvironment-Steps.yml @@ -72,7 +72,7 @@ steps: inputs: targetType: filePath filePath: tools\DevCheck\DevCheck.ps1 - arguments: -NoInteractive -Offline -Verbose -CertPassword 'BuildPipeline' -CheckTestPfx -Clean -CheckDependencies -ShowSystemInfo + arguments: -NoInteractive -Offline -Verbose -CertPassword 'BuildPipeline' -CheckTestPfx -Clean -CheckDependencies -CheckTAEFService -CheckVisualStudio -CheckDeveloperMode -ShowSystemInfo workingDirectory: '$(Build.SourcesDirectory)' - task: PowerShell@2 diff --git a/tools/DevCheck/DevCheck.ps1 b/tools/DevCheck/DevCheck.ps1 index 3448d5efcf..57b1c36956 100644 --- a/tools/DevCheck/DevCheck.ps1 +++ b/tools/DevCheck/DevCheck.ps1 @@ -997,7 +997,7 @@ function Test-TAEFServiceVersion } else { - Write-Verbose "Expected TAEF service is registered ($actual_taef_version)" + Write-Host "Expected TAEF service is registered ($actual_taef_version)" return 'OK' } } @@ -1589,7 +1589,7 @@ if ($SyncDependencies -eq $true) Write-Output "Checking developer environment..." $cpu = Get-CpuArchitecture -Write-Verbose("Processor...$cpu") +Write-Verbose "Processor...$cpu" $project_root = Get-ProjectRoot Write-Output "Windows App SDK location...$project_root" From f41ce395e84993482425384b84d6ce482e3e838c Mon Sep 17 00:00:00 2001 From: Howard Kapustein Date: Mon, 7 Oct 2024 10:00:38 -0700 Subject: [PATCH 03/27] Removed redundant checks done later in pipelines --- build/AzurePipelinesTemplates/WindowsAppSDK-RunTests-Steps.yml | 2 +- .../WindowsAppSDK-SetupBuildEnvironment-Steps.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-RunTests-Steps.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-RunTests-Steps.yml index 191e6eea19..e6638babff 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-RunTests-Steps.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-RunTests-Steps.yml @@ -11,7 +11,7 @@ steps: inputs: targetType: filePath filePath: tools\DevCheck\DevCheck.ps1 - arguments: -NoInteractive -Offline -Verbose -CertPassword 'BuildPipeline' -CheckTestPfx -Clean -CheckDependencies -CheckTAEFService -CheckVisualStudio -CheckDeveloperMode -ShowSystemInfo + arguments: -NoInteractive -Offline -Verbose -CertPassword 'BuildPipeline' -CheckTestPfx -Clean -CheckDependencies -CheckVisualStudio -ShowSystemInfo workingDirectory: '$(Build.SourcesDirectory)' - task: DownloadPipelineArtifact@2 diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-SetupBuildEnvironment-Steps.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-SetupBuildEnvironment-Steps.yml index 0b19a0b09e..82b21fe0b8 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-SetupBuildEnvironment-Steps.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-SetupBuildEnvironment-Steps.yml @@ -72,7 +72,7 @@ steps: inputs: targetType: filePath filePath: tools\DevCheck\DevCheck.ps1 - arguments: -NoInteractive -Offline -Verbose -CertPassword 'BuildPipeline' -CheckTestPfx -Clean -CheckDependencies -CheckTAEFService -CheckVisualStudio -CheckDeveloperMode -ShowSystemInfo + arguments: -NoInteractive -Offline -Verbose -CertPassword 'BuildPipeline' -CheckTestPfx -Clean -CheckDependencies -CheckVisualStudio -ShowSystemInfo workingDirectory: '$(Build.SourcesDirectory)' - task: PowerShell@2 From f59671cf4f91585b8ae281532dc58e852447cca0 Mon Sep 17 00:00:00 2001 From: Howard Kapustein Date: Mon, 7 Oct 2024 10:36:36 -0700 Subject: [PATCH 04/27] Added diagnostics for troubleshooting. Fixed compiler warnings --- test/ApplicationData/ApplicationDataTests.cpp | 10 ++++++---- test/ApplicationData/pch.h | 1 + .../API/PackageDeploymentManagerTests_IsReady.cpp | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/test/ApplicationData/ApplicationDataTests.cpp b/test/ApplicationData/ApplicationDataTests.cpp index d5bcf6ec3c..dc0e97064c 100644 --- a/test/ApplicationData/ApplicationDataTests.cpp +++ b/test/ApplicationData/ApplicationDataTests.cpp @@ -7,6 +7,7 @@ namespace TB = ::Test::Bootstrap; namespace TP = ::Test::Packages; +namespace TD = ::Test::Diagnostics; static const winrt::hstring null_hstring; @@ -112,6 +113,7 @@ namespace Test::PackageManager::Tests TEST_CLASS_SETUP(ClassSetup) { + ::TD::DumpExecutionContext(); if (!::WindowsVersion::IsWindows11_21H2OrGreater()) { WEX::Logging::Log::Result(WEX::Logging::TestResults::Skipped, L"PackageDeploymentManager requires Win11 >= 21H2 (SV1). Skipping tests"); @@ -436,7 +438,7 @@ namespace Test::PackageManager::Tests container.Close(); try { - auto locality{ container.Locality() }; + [[maybe_unused]] auto locality{ container.Locality() }; VERIFY_FAIL(L"Success is not expected"); } catch (winrt::hresult_error& e) @@ -447,7 +449,7 @@ namespace Test::PackageManager::Tests systemContainer.Close(); try { - auto locality{ systemContainer.Locality() }; + [[maybe_unused]] auto locality{ systemContainer.Locality() }; VERIFY_FAIL(L"Success is not expected"); } catch (winrt::hresult_error& e) @@ -465,7 +467,7 @@ namespace Test::PackageManager::Tests localSettings.Close(); try { - auto locality{ localSettings.Locality() }; + [[maybe_unused]] auto locality{ localSettings.Locality() }; VERIFY_FAIL(L"Success is not expected"); } catch (winrt::hresult_error& e) @@ -476,7 +478,7 @@ namespace Test::PackageManager::Tests systemLocalSettings.Close(); try { - auto locality{ systemLocalSettings.Locality() }; + [[maybe_unused]] auto locality{ systemLocalSettings.Locality() }; VERIFY_FAIL(L"Success is not expected"); } catch (winrt::hresult_error& e) diff --git a/test/ApplicationData/pch.h b/test/ApplicationData/pch.h index 2635f15b87..b6a8bac27c 100644 --- a/test/ApplicationData/pch.h +++ b/test/ApplicationData/pch.h @@ -26,6 +26,7 @@ #include +#include #include #include #include diff --git a/test/PackageManager/API/PackageDeploymentManagerTests_IsReady.cpp b/test/PackageManager/API/PackageDeploymentManagerTests_IsReady.cpp index 7faf3387b6..a5c84e7bfd 100644 --- a/test/PackageManager/API/PackageDeploymentManagerTests_IsReady.cpp +++ b/test/PackageManager/API/PackageDeploymentManagerTests_IsReady.cpp @@ -25,6 +25,7 @@ namespace Test::PackageManager::Tests TEST_CLASS_SETUP(ClassSetup) { + ::TD::DumpExecutionContext(); if (!::WindowsVersion::IsWindows10_20H1OrGreater()) { WEX::Logging::Log::Result(WEX::Logging::TestResults::Skipped, L"PackageDeploymentManager requires >= 20H1 (Vibranium). Skipping tests"); From a7650e57d440bd63f892c6d6e23a05af9a6d50f5 Mon Sep 17 00:00:00 2001 From: Howard Kapustein Date: Mon, 7 Oct 2024 13:54:16 -0700 Subject: [PATCH 05/27] More debuggery --- test/ApplicationData/ApplicationDataTests.cpp | 12 ++++- .../PackageDeploymentManagerTests_IsReady.cpp | 47 +++++++++++++++++++ 2 files changed, 57 insertions(+), 2 deletions(-) diff --git a/test/ApplicationData/ApplicationDataTests.cpp b/test/ApplicationData/ApplicationDataTests.cpp index dc0e97064c..84ed4a7c0a 100644 --- a/test/ApplicationData/ApplicationDataTests.cpp +++ b/test/ApplicationData/ApplicationDataTests.cpp @@ -116,7 +116,7 @@ namespace Test::PackageManager::Tests ::TD::DumpExecutionContext(); if (!::WindowsVersion::IsWindows11_21H2OrGreater()) { - WEX::Logging::Log::Result(WEX::Logging::TestResults::Skipped, L"PackageDeploymentManager requires Win11 >= 21H2 (SV1). Skipping tests"); + WEX::Logging::Log::Result(WEX::Logging::TestResults::Skipped, L"ApplicationData requires Win11 >= 21H2 (SV1). Skipping tests"); return true; } ::TB::Setup(); @@ -321,15 +321,23 @@ namespace Test::PackageManager::Tests TEST_METHOD(MachineFolderAndPath_Main_NotSupported) { winrt::hstring packageFamilyName{ Main_PackageFamilyName }; +WEX::Logging::Log::Comment(WEX::Common::String().Format(L"A1: %ls", packageFamilyName.c_str())); auto applicationData{ winrt::Microsoft::Windows::Storage::ApplicationData::GetForPackageFamily(packageFamilyName) }; +WEX::Logging::Log::Comment(WEX::Common::String().Format(L"A2: %ls", packageFamilyName.c_str())); VERIFY_IS_NOT_NULL(applicationData); +WEX::Logging::Log::Comment(WEX::Common::String().Format(L"A3: %ls", packageFamilyName.c_str())); VERIFY_IS_FALSE(applicationData.IsMachinePathSupported()); +WEX::Logging::Log::Comment(WEX::Common::String().Format(L"A4: %ls", packageFamilyName.c_str())); const auto machineFolder{ applicationData.MachineFolder() }; +WEX::Logging::Log::Comment(WEX::Common::String().Format(L"A5: %ls", packageFamilyName.c_str())); VERIFY_IS_NULL(machineFolder); +WEX::Logging::Log::Comment(WEX::Common::String().Format(L"A6: %ls", packageFamilyName.c_str())); const auto machinePath{ applicationData.MachinePath() }; +WEX::Logging::Log::Comment(WEX::Common::String().Format(L"A7: %ls", packageFamilyName.c_str())); VERIFY_ARE_EQUAL(machinePath, null_hstring); +WEX::Logging::Log::Comment(WEX::Common::String().Format(L"A8: %ls", packageFamilyName.c_str())); } TEST_METHOD(MachineFolderAndPath_Framework_NotSupported) @@ -551,7 +559,7 @@ namespace Test::PackageManager::Tests { if (!::WindowsVersion::IsWindows11_21H2OrGreater()) { - WEX::Logging::Log::Result(WEX::Logging::TestResults::Skipped, L"PackageDeploymentManager requires Win11 >= 21H2 (SV1). Skipping tests"); + WEX::Logging::Log::Result(WEX::Logging::TestResults::Skipped, L"ApplicationData requires Win11 >= 21H2 (SV1). Skipping tests"); return true; } ::TB::Setup(); diff --git a/test/PackageManager/API/PackageDeploymentManagerTests_IsReady.cpp b/test/PackageManager/API/PackageDeploymentManagerTests_IsReady.cpp index a5c84e7bfd..d855f4a869 100644 --- a/test/PackageManager/API/PackageDeploymentManagerTests_IsReady.cpp +++ b/test/PackageManager/API/PackageDeploymentManagerTests_IsReady.cpp @@ -21,6 +21,7 @@ namespace Test::PackageManager::Tests public: BEGIN_TEST_CLASS(PackageDeploymentManagerTests_IsReady) TEST_CLASS_PROPERTY(L"ThreadingModel", L"MTA") + TEST_CLASS_PROPERTY(L"RunAs", L"RestrictedUser") END_TEST_CLASS() TEST_CLASS_SETUP(ClassSetup) @@ -122,84 +123,130 @@ namespace Test::PackageManager::Tests TEST_METHOD(IsPackageSetReady_InvalidParameter) { +WEX::Logging::Log::Comment(L"P1"); auto packageDeploymentManager{ winrt::Microsoft::Windows::Management::Deployment::PackageDeploymentManager::GetDefault() }; try { +WEX::Logging::Log::Comment(L"P2"); winrt::Microsoft::Windows::Management::Deployment::PackageSet packageSet; +WEX::Logging::Log::Comment(L"P3"); packageDeploymentManager.IsPackageSetReady(packageSet); +WEX::Logging::Log::Comment(L"P4"); VERIFY_FAIL(L"Success is not expected"); +WEX::Logging::Log::Comment(L"P5"); } catch (winrt::hresult_error& e) { +WEX::Logging::Log::Comment(L"P6"); VERIFY_ARE_EQUAL(E_INVALIDARG, e.code(), WEX::Common::String().Format(L"0x%X %s", e.code(), e.message().c_str())); } +WEX::Logging::Log::Comment(L"P10"); try { +WEX::Logging::Log::Comment(L"P11"); winrt::Microsoft::Windows::Management::Deployment::PackageSet packageSet; +WEX::Logging::Log::Comment(L"P12"); PCWSTR c_packageSetId{ L"Does.Not.Exist" }; +WEX::Logging::Log::Comment(L"P13"); packageSet.Id(c_packageSetId); +WEX::Logging::Log::Comment(L"P14"); packageDeploymentManager.IsPackageSetReady(packageSet); +WEX::Logging::Log::Comment(L"P15"); VERIFY_FAIL(L"Success is not expected"); +WEX::Logging::Log::Comment(L"P16"); } catch (winrt::hresult_error& e) { +WEX::Logging::Log::Comment(L"P17"); VERIFY_ARE_EQUAL(E_INVALIDARG, e.code(), WEX::Common::String().Format(L"0x%X %s", e.code(), e.message().c_str())); +WEX::Logging::Log::Comment(L"P18"); } +WEX::Logging::Log::Comment(L"20"); try { +WEX::Logging::Log::Comment(L"21"); winrt::Microsoft::Windows::Management::Deployment::PackageSet packageSet; +WEX::Logging::Log::Comment(L"22"); PCWSTR c_packageSetId{ L"Does.Not.Exist" }; packageSet.Id(c_packageSetId); +WEX::Logging::Log::Comment(L"23"); winrt::Microsoft::Windows::Management::Deployment::PackageSetItem packageSetItem; packageSet.Items().Append(packageSetItem); +WEX::Logging::Log::Comment(L"24"); packageDeploymentManager.IsPackageSetReady(packageSet); +WEX::Logging::Log::Comment(L"25"); VERIFY_FAIL(L"Success is not expected"); +WEX::Logging::Log::Comment(L"26"); } catch (winrt::hresult_error& e) { +WEX::Logging::Log::Comment(L"27"); VERIFY_ARE_EQUAL(E_INVALIDARG, e.code(), WEX::Common::String().Format(L"0x%X %s", e.code(), e.message().c_str())); +WEX::Logging::Log::Comment(L"28"); } +WEX::Logging::Log::Comment(L"30"); try { +WEX::Logging::Log::Comment(L"31"); winrt::Microsoft::Windows::Management::Deployment::PackageSet packageSet; +WEX::Logging::Log::Comment(L"32"); PCWSTR c_packageSetId{ L"Does.Not.Exist" }; packageSet.Id(c_packageSetId); +WEX::Logging::Log::Comment(L"33"); winrt::Microsoft::Windows::Management::Deployment::PackageSetItem packageSetItem; +WEX::Logging::Log::Comment(L"34"); PCWSTR c_packageFamilyName{ L"Not a valid Package Family Name" }; packageSetItem.PackageFamilyName(c_packageFamilyName); +WEX::Logging::Log::Comment(L"35"); packageSet.Items().Append(packageSetItem); +WEX::Logging::Log::Comment(L"36"); packageDeploymentManager.IsPackageSetReady(packageSet); +WEX::Logging::Log::Comment(L"37"); VERIFY_FAIL(L"Success is not expected"); +WEX::Logging::Log::Comment(L"38"); } catch (winrt::hresult_error& e) { +WEX::Logging::Log::Comment(L"39"); VERIFY_ARE_EQUAL(E_INVALIDARG, e.code(), WEX::Common::String().Format(L"0x%X %s", e.code(), e.message().c_str())); } +WEX::Logging::Log::Comment(L"40"); try { +WEX::Logging::Log::Comment(L"41"); winrt::Microsoft::Windows::Management::Deployment::PackageSet packageSet; +WEX::Logging::Log::Comment(L"42"); PCWSTR c_packageSetId{ L"Does.Not.Exist" }; packageSet.Id(c_packageSetId); +WEX::Logging::Log::Comment(L"43"); winrt::Microsoft::Windows::Management::Deployment::PackageSetItem packageSetItem; +WEX::Logging::Log::Comment(L"44"); PCWSTR c_packageUriAsString{ L"https://doesnotexist.com/assemble.msix" }; winrt::Windows::Foundation::Uri packageUri{ c_packageUriAsString }; +WEX::Logging::Log::Comment(L"45"); packageSetItem.PackageUri(packageUri); +WEX::Logging::Log::Comment(L"46"); packageSet.Items().Append(packageSetItem); +WEX::Logging::Log::Comment(L"47"); packageDeploymentManager.IsPackageSetReady(packageSet); +WEX::Logging::Log::Comment(L"48"); VERIFY_FAIL(L"Success is not expected"); +WEX::Logging::Log::Comment(L"49"); } catch (winrt::hresult_error& e) { +WEX::Logging::Log::Comment(L"4A"); VERIFY_ARE_EQUAL(E_INVALIDARG, e.code(), WEX::Common::String().Format(L"0x%X %s", e.code(), e.message().c_str())); +WEX::Logging::Log::Comment(L"4B"); } } From bfb462360cbafa2cf5faca786557cbb2765fcc19 Mon Sep 17 00:00:00 2001 From: Howard Kapustein Date: Mon, 7 Oct 2024 19:14:28 -0700 Subject: [PATCH 06/27] Added IsWindows11_24H2OrGreater(). Changed URFW to only delegate to OS RFW on >=24H1 (where DynDep will delegate to OS DynDep). Fixed some bad sprintfs. Changed Is*Supported(PackageDeploymentFeature::PackageUriScheme_ms_uup) to use the Is*Supported function --- dev/Common/IsWindowsVersion.h | 17 +++++++++++------ .../API/M.W.M.D.PackageDeploymentManager.cpp | 15 ++++++++++----- dev/UndockedRegFreeWinRT/urfw.cpp | 8 ++++++++ 3 files changed, 29 insertions(+), 11 deletions(-) diff --git a/dev/Common/IsWindowsVersion.h b/dev/Common/IsWindowsVersion.h index 96b17a5684..f7fe5ee17c 100644 --- a/dev/Common/IsWindowsVersion.h +++ b/dev/Common/IsWindowsVersion.h @@ -33,30 +33,35 @@ inline bool IsExportPresent( inline bool IsWindows10_19H1OrGreater() { - // GetPackageInfo2() added to kernelbase.dll in NTDDI_WIN10_19H1 (aka 19H1) + // GetPackageInfo2() added to kernelbase.dll in 19H1 (aka NTDDI_WIN10_19H1) return IsExportPresent(L"kernelbase.dll", "GetPackageInfo2"); } inline bool IsWindows10_20H1OrGreater() { - // GetPackageInfo3() added to kernelbase.dll in NTDDI_WIN10_VB (aka 20H1) + // GetPackageInfo3() added to kernelbase.dll in 20H1 (aka NTDDI_WIN10_VB) return IsExportPresent(L"kernelbase.dll", "GetPackageInfo3"); } inline bool IsWindows11_21H2OrGreater() { - // GetMachineTypeAttributes() added to kernelbase.dll in NTDDI_WIN10_CO (aka Windows 11 21H2) + // GetMachineTypeAttributes() added to kernelbase.dll in Windows 11 21H2 (aka NTDDI_WIN10_CO) return IsExportPresent(L"kernelbase.dll", "GetMachineTypeAttributes"); } inline bool IsWindows11_22H2OrGreater() { - // GetPackageGraphRevisionId() added to kernelbase.dll in NTDDI_WIN10_NI (aka Windows 11 22H2) + // GetPackageGraphRevisionId() added to kernelbase.dll in Windows 11 22H2 (aka NTDDI_WIN10_NI) return IsExportPresent(L"kernelbase.dll", "GetPackageGraphRevisionId"); } -inline bool IsWindows11_23H1OrGreater() +inline bool IsWindows11_24H1OrGreater() { - // TryCreatePackageDependency2() added to in NTDDI_WIN10_GE (aka Windows 11 23H1) + // TryCreatePackageDependency2() added to in Windows 11 24H1 (aka NTDDI_WIN11_GE) return IsExportPresent(L"kernelbase.dll", "TryCreatePackageDependency2"); } +inline bool IsWindows11_24H2OrGreater() +{ + // MsixIsPackageFeatureSupported() added to in Windows 11 24H2 (aka NTDDI_WIN11_GE) + return IsExportPresent(L"appxdeploymentclient.dll", "MsixIsPackageFeatureSupported"); +} } #endif // __ISWINDOWSVERSION_H diff --git a/dev/PackageManager/API/M.W.M.D.PackageDeploymentManager.cpp b/dev/PackageManager/API/M.W.M.D.PackageDeploymentManager.cpp index 94b4fe8e7b..02f506cb68 100644 --- a/dev/PackageManager/API/M.W.M.D.PackageDeploymentManager.cpp +++ b/dev/PackageManager/API/M.W.M.D.PackageDeploymentManager.cpp @@ -119,9 +119,14 @@ namespace winrt::Microsoft::Windows::Management::Deployment::implementation { case winrt::Microsoft::Windows::Management::Deployment::PackageDeploymentFeature::PackageUriScheme_ms_uup: { - //TODO Feature lookup - // Relies on PackageManagement_IsFeatureSupported(L"PackageUriScheme.ms-uup") exist in Microsoft.FrameworkUdk and enabled - return ::WindowsVersion::IsExportPresent(L"appxdeploymentclient.dll", "MsixRemovePackageByUriAsync"); + BOOL isSupported{}; + const HRESULT hr{ PackageManagement_IsFeatureSupported(L"PackageUriScheme.ms-uup", &isSupported) }; + if (hr == E_NOTIMPL) + { + return false; + } + THROW_IF_FAILED_MSG(hr, "PackageUriScheme_ms_uup"); + return !!isSupported; } case winrt::Microsoft::Windows::Management::Deployment::PackageDeploymentFeature::IsPackageReadyOrNewerAvailable: { @@ -1212,7 +1217,7 @@ namespace winrt::Microsoft::Windows::Management::Deployment::implementation catch (...) { const auto exception{ hresult_error(to_hresult(), take_ownership_from_abi) }; - error = LOG_HR_MSG(exception.code(), "ExtendedError:0x%08X PackageUri:%ls PackageFamilyName:%ls PackageUri:%ls", + error = LOG_HR_MSG(exception.code(), "ExtendedError:0x%08X PackageFullName:%ls PackageUri:%ls", extendedError, packageFullName, packageUriAsString.c_str()); } if (FAILED(error)) @@ -1382,7 +1387,7 @@ namespace winrt::Microsoft::Windows::Management::Deployment::implementation catch (...) { const auto exception{ hresult_error(to_hresult(), take_ownership_from_abi) }; - error = LOG_HR_MSG(exception.code(), "ExtendedError:0x%08X PackageUri:%ls PackageFamilyName:%ls PackageUri:%ls", + error = LOG_HR_MSG(exception.code(), "ExtendedError:0x%08X PackageFullName:%ls PackageUri:%ls", extendedError, packageFullName, packageUriAsString.c_str()); } if (FAILED(error)) diff --git a/dev/UndockedRegFreeWinRT/urfw.cpp b/dev/UndockedRegFreeWinRT/urfw.cpp index bba8852165..be8f6e66a3 100644 --- a/dev/UndockedRegFreeWinRT/urfw.cpp +++ b/dev/UndockedRegFreeWinRT/urfw.cpp @@ -407,6 +407,7 @@ HRESULT ExtRoLoadCatalog() HRESULT UrfwInitialize() noexcept { +#if defined(TODO_URFW_DELEGATE_TO_OS_19H1PLUS) // Windows' Reg-Free WinRT first appeared in Windows 10 Version 1903, May 2019 Update (aka 19H1) // https://blogs.windows.com/windowsdeveloper/2019/04/30/enhancing-non-packaged-desktop-apps-using-windows-runtime-components/ // Delegate to the OS' implementation when available @@ -414,6 +415,13 @@ HRESULT UrfwInitialize() noexcept { return S_OK; } +#else + // Delegate to the OS' implementation on >= Windows 11 24H1 + if (WindowsVersion::IsWindows11_24H1OrGreater()) + { + return S_OK; + } +#endif // OS Reg-Free WinRT isn't available so let's do it ourselves... DetourAttach(&(PVOID&)TrueRoActivateInstance, RoActivateInstanceDetour); From 921330a486bc8ef007145ebb3f4b6d38f28b9570 Mon Sep 17 00:00:00 2001 From: Howard Kapustein Date: Tue, 8 Oct 2024 00:50:44 -0700 Subject: [PATCH 07/27] More diagnostics --- .../WindowsAppSDK-RunTests-Steps.yml | 8 ++++++++ test/ApplicationData/ApplicationDataTests.cpp | 2 ++ .../API/PackageDeploymentManagerTests_IsReady.cpp | 6 ++++++ 3 files changed, 16 insertions(+) diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-RunTests-Steps.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-RunTests-Steps.yml index e6638babff..67b4d00445 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-RunTests-Steps.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-RunTests-Steps.yml @@ -143,6 +143,14 @@ steps: Write-Host "Get-WinSystemLocale" Get-WinSystemLocale + - task: PowerShell@2 + displayName: 'Dump services' + inputs: + targetType: 'inline' + script: | + sc queryex te.service + sc qc te.service + - task: PowerShell@2 displayName: 'Run TAEF Tests' inputs: diff --git a/test/ApplicationData/ApplicationDataTests.cpp b/test/ApplicationData/ApplicationDataTests.cpp index 84ed4a7c0a..9bdb11bb92 100644 --- a/test/ApplicationData/ApplicationDataTests.cpp +++ b/test/ApplicationData/ApplicationDataTests.cpp @@ -119,7 +119,9 @@ namespace Test::PackageManager::Tests WEX::Logging::Log::Result(WEX::Logging::TestResults::Skipped, L"ApplicationData requires Win11 >= 21H2 (SV1). Skipping tests"); return true; } +WEX::Logging::Log::Comment(WEX::Common::String().Format(L"S1")); ::TB::Setup(); +WEX::Logging::Log::Comment(WEX::Common::String().Format(L"S2")); return true; } diff --git a/test/PackageManager/API/PackageDeploymentManagerTests_IsReady.cpp b/test/PackageManager/API/PackageDeploymentManagerTests_IsReady.cpp index d855f4a869..19c533a183 100644 --- a/test/PackageManager/API/PackageDeploymentManagerTests_IsReady.cpp +++ b/test/PackageManager/API/PackageDeploymentManagerTests_IsReady.cpp @@ -32,11 +32,17 @@ namespace Test::PackageManager::Tests WEX::Logging::Log::Result(WEX::Logging::TestResults::Skipped, L"PackageDeploymentManager requires >= 20H1 (Vibranium). Skipping tests"); return true; } +WEX::Logging::Log::Comment(L"S1"); RemovePackage_Blue(); +WEX::Logging::Log::Comment(L"S2"); RemovePackage_Green(); +WEX::Logging::Log::Comment(L"S3"); RemovePackage_Redder(); +WEX::Logging::Log::Comment(L"S4"); RemovePackage_Red(); +WEX::Logging::Log::Comment(L"S5"); ::TB::Setup(); +WEX::Logging::Log::Comment(L"S6"); return true; } From 1f7d875df9a63728de2e4388523e0d2d8d23e141 Mon Sep 17 00:00:00 2001 From: Howard Kapustein Date: Tue, 8 Oct 2024 19:44:38 -0700 Subject: [PATCH 08/27] Bumped TAEF to latest version 10.95.240918004 --- dev/MRTCore/mrt/Core/unittests/packages.config | 2 +- .../UnpackagedTests/packages.config | 2 +- dev/MRTCore/mrt/mrm/UnitTests/packages.config | 2 +- eng/Version.Dependencies.xml | 2 +- installer/test/InstallerFunctionalTests/packages.config | 2 +- test/AccessControlTests/packages.config | 2 +- test/AppLifecycle/packages.config | 2 +- test/AppNotificationBuilderTests/packages.config | 2 +- test/AppNotificationTests/packages.config | 2 +- test/ApplicationData/packages.config | 2 +- test/Common/packages.config | 2 +- test/Deployment/API/packages.config | 2 +- test/DynamicDependency/Test_Win32/packages.config | 2 +- test/DynamicDependency/Test_WinRT/packages.config | 2 +- test/EnvironmentManagerTests/packages.config | 2 +- test/LRPTests/packages.config | 2 +- test/PackageManager/API/packages.config | 2 +- test/PowerNotifications/packages.config | 2 +- test/PushNotificationTests/packages.config | 2 +- test/TestApps/AccessControlTestApp/packages.config | 2 +- test/TestApps/AppLifecycleTestApp/packages.config | 2 +- test/TestApps/ManualTestApp/packages.config | 2 +- test/TestApps/PushNotificationsDemoApp/packages.config | 2 +- test/TestApps/PushNotificationsTestApp/packages.config | 2 +- test/TestApps/ToastNotificationsDemoApp/packages.config | 2 +- test/TestApps/ToastNotificationsTestApp/packages.config | 2 +- test/VersionInfo/packages.config | 2 +- tools/ProjectTemplates/test.cpp.dll.taef/packages.config | 2 +- 28 files changed, 28 insertions(+), 28 deletions(-) diff --git a/dev/MRTCore/mrt/Core/unittests/packages.config b/dev/MRTCore/mrt/Core/unittests/packages.config index 7a6d727c53..67e4a6c953 100644 --- a/dev/MRTCore/mrt/Core/unittests/packages.config +++ b/dev/MRTCore/mrt/Core/unittests/packages.config @@ -1,4 +1,4 @@  - + diff --git a/dev/MRTCore/mrt/Microsoft.Windows.ApplicationModel.Resources/UnpackagedTests/packages.config b/dev/MRTCore/mrt/Microsoft.Windows.ApplicationModel.Resources/UnpackagedTests/packages.config index 197b5e0d97..e1c30306ec 100644 --- a/dev/MRTCore/mrt/Microsoft.Windows.ApplicationModel.Resources/UnpackagedTests/packages.config +++ b/dev/MRTCore/mrt/Microsoft.Windows.ApplicationModel.Resources/UnpackagedTests/packages.config @@ -1,4 +1,4 @@  - + diff --git a/dev/MRTCore/mrt/mrm/UnitTests/packages.config b/dev/MRTCore/mrt/mrm/UnitTests/packages.config index ae625459a8..1209567b82 100644 --- a/dev/MRTCore/mrt/mrm/UnitTests/packages.config +++ b/dev/MRTCore/mrt/mrm/UnitTests/packages.config @@ -1,5 +1,5 @@  - + diff --git a/eng/Version.Dependencies.xml b/eng/Version.Dependencies.xml index 2b871b0695..0e6b7db3c1 100644 --- a/eng/Version.Dependencies.xml +++ b/eng/Version.Dependencies.xml @@ -29,7 +29,7 @@ - + diff --git a/installer/test/InstallerFunctionalTests/packages.config b/installer/test/InstallerFunctionalTests/packages.config index c182a0398a..bbbb6af252 100644 --- a/installer/test/InstallerFunctionalTests/packages.config +++ b/installer/test/InstallerFunctionalTests/packages.config @@ -1,6 +1,6 @@  - + diff --git a/test/AccessControlTests/packages.config b/test/AccessControlTests/packages.config index 5d08f56b6e..8a88e2246d 100644 --- a/test/AccessControlTests/packages.config +++ b/test/AccessControlTests/packages.config @@ -1,5 +1,5 @@  - + diff --git a/test/AppLifecycle/packages.config b/test/AppLifecycle/packages.config index c182a0398a..bbbb6af252 100644 --- a/test/AppLifecycle/packages.config +++ b/test/AppLifecycle/packages.config @@ -1,6 +1,6 @@  - + diff --git a/test/AppNotificationBuilderTests/packages.config b/test/AppNotificationBuilderTests/packages.config index c182a0398a..bbbb6af252 100644 --- a/test/AppNotificationBuilderTests/packages.config +++ b/test/AppNotificationBuilderTests/packages.config @@ -1,6 +1,6 @@  - + diff --git a/test/AppNotificationTests/packages.config b/test/AppNotificationTests/packages.config index c182a0398a..bbbb6af252 100644 --- a/test/AppNotificationTests/packages.config +++ b/test/AppNotificationTests/packages.config @@ -1,6 +1,6 @@  - + diff --git a/test/ApplicationData/packages.config b/test/ApplicationData/packages.config index b8a4d04bd0..0c13ff7b9c 100644 --- a/test/ApplicationData/packages.config +++ b/test/ApplicationData/packages.config @@ -3,7 +3,7 @@ - + diff --git a/test/Common/packages.config b/test/Common/packages.config index c182a0398a..bbbb6af252 100644 --- a/test/Common/packages.config +++ b/test/Common/packages.config @@ -1,6 +1,6 @@  - + diff --git a/test/Deployment/API/packages.config b/test/Deployment/API/packages.config index c182a0398a..bbbb6af252 100644 --- a/test/Deployment/API/packages.config +++ b/test/Deployment/API/packages.config @@ -1,6 +1,6 @@  - + diff --git a/test/DynamicDependency/Test_Win32/packages.config b/test/DynamicDependency/Test_Win32/packages.config index 7a6d727c53..67e4a6c953 100644 --- a/test/DynamicDependency/Test_Win32/packages.config +++ b/test/DynamicDependency/Test_Win32/packages.config @@ -1,4 +1,4 @@  - + diff --git a/test/DynamicDependency/Test_WinRT/packages.config b/test/DynamicDependency/Test_WinRT/packages.config index 7a6d727c53..67e4a6c953 100644 --- a/test/DynamicDependency/Test_WinRT/packages.config +++ b/test/DynamicDependency/Test_WinRT/packages.config @@ -1,4 +1,4 @@  - + diff --git a/test/EnvironmentManagerTests/packages.config b/test/EnvironmentManagerTests/packages.config index c182a0398a..bbbb6af252 100644 --- a/test/EnvironmentManagerTests/packages.config +++ b/test/EnvironmentManagerTests/packages.config @@ -1,6 +1,6 @@  - + diff --git a/test/LRPTests/packages.config b/test/LRPTests/packages.config index c182a0398a..bbbb6af252 100644 --- a/test/LRPTests/packages.config +++ b/test/LRPTests/packages.config @@ -1,6 +1,6 @@  - + diff --git a/test/PackageManager/API/packages.config b/test/PackageManager/API/packages.config index 25965155ba..9f0578ed13 100644 --- a/test/PackageManager/API/packages.config +++ b/test/PackageManager/API/packages.config @@ -3,7 +3,7 @@ - + diff --git a/test/PowerNotifications/packages.config b/test/PowerNotifications/packages.config index c182a0398a..bbbb6af252 100644 --- a/test/PowerNotifications/packages.config +++ b/test/PowerNotifications/packages.config @@ -1,6 +1,6 @@  - + diff --git a/test/PushNotificationTests/packages.config b/test/PushNotificationTests/packages.config index c182a0398a..bbbb6af252 100644 --- a/test/PushNotificationTests/packages.config +++ b/test/PushNotificationTests/packages.config @@ -1,6 +1,6 @@  - + diff --git a/test/TestApps/AccessControlTestApp/packages.config b/test/TestApps/AccessControlTestApp/packages.config index c182a0398a..bbbb6af252 100644 --- a/test/TestApps/AccessControlTestApp/packages.config +++ b/test/TestApps/AccessControlTestApp/packages.config @@ -1,6 +1,6 @@  - + diff --git a/test/TestApps/AppLifecycleTestApp/packages.config b/test/TestApps/AppLifecycleTestApp/packages.config index c182a0398a..bbbb6af252 100644 --- a/test/TestApps/AppLifecycleTestApp/packages.config +++ b/test/TestApps/AppLifecycleTestApp/packages.config @@ -1,6 +1,6 @@  - + diff --git a/test/TestApps/ManualTestApp/packages.config b/test/TestApps/ManualTestApp/packages.config index c182a0398a..bbbb6af252 100644 --- a/test/TestApps/ManualTestApp/packages.config +++ b/test/TestApps/ManualTestApp/packages.config @@ -1,6 +1,6 @@  - + diff --git a/test/TestApps/PushNotificationsDemoApp/packages.config b/test/TestApps/PushNotificationsDemoApp/packages.config index c182a0398a..bbbb6af252 100644 --- a/test/TestApps/PushNotificationsDemoApp/packages.config +++ b/test/TestApps/PushNotificationsDemoApp/packages.config @@ -1,6 +1,6 @@  - + diff --git a/test/TestApps/PushNotificationsTestApp/packages.config b/test/TestApps/PushNotificationsTestApp/packages.config index c182a0398a..bbbb6af252 100644 --- a/test/TestApps/PushNotificationsTestApp/packages.config +++ b/test/TestApps/PushNotificationsTestApp/packages.config @@ -1,6 +1,6 @@  - + diff --git a/test/TestApps/ToastNotificationsDemoApp/packages.config b/test/TestApps/ToastNotificationsDemoApp/packages.config index c182a0398a..bbbb6af252 100644 --- a/test/TestApps/ToastNotificationsDemoApp/packages.config +++ b/test/TestApps/ToastNotificationsDemoApp/packages.config @@ -1,6 +1,6 @@  - + diff --git a/test/TestApps/ToastNotificationsTestApp/packages.config b/test/TestApps/ToastNotificationsTestApp/packages.config index c182a0398a..bbbb6af252 100644 --- a/test/TestApps/ToastNotificationsTestApp/packages.config +++ b/test/TestApps/ToastNotificationsTestApp/packages.config @@ -1,6 +1,6 @@  - + diff --git a/test/VersionInfo/packages.config b/test/VersionInfo/packages.config index c182a0398a..bbbb6af252 100644 --- a/test/VersionInfo/packages.config +++ b/test/VersionInfo/packages.config @@ -1,6 +1,6 @@  - + diff --git a/tools/ProjectTemplates/test.cpp.dll.taef/packages.config b/tools/ProjectTemplates/test.cpp.dll.taef/packages.config index b8a4d04bd0..0c13ff7b9c 100644 --- a/tools/ProjectTemplates/test.cpp.dll.taef/packages.config +++ b/tools/ProjectTemplates/test.cpp.dll.taef/packages.config @@ -3,7 +3,7 @@ - + From 8ae5157712df368563b5d6afda07a54034bc1573 Mon Sep 17 00:00:00 2001 From: Howard Kapustein Date: Wed, 9 Oct 2024 11:03:28 -0700 Subject: [PATCH 09/27] Moar debugging --- .../AzurePipelinesTemplates/WindowsAppSDK-RunTests-Steps.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-RunTests-Steps.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-RunTests-Steps.yml index 67b4d00445..bde697e17e 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-RunTests-Steps.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-RunTests-Steps.yml @@ -148,8 +148,8 @@ steps: inputs: targetType: 'inline' script: | - sc queryex te.service - sc qc te.service + sc queryex te.service | Write-Host + sc qc te.service | Write-Host - task: PowerShell@2 displayName: 'Run TAEF Tests' From b075a9018b9901572a7f6f1d49d1c6877fcb7a93 Mon Sep 17 00:00:00 2001 From: Howard Kapustein Date: Wed, 9 Oct 2024 14:18:14 -0700 Subject: [PATCH 10/27] Fixes --- .../WindowsAppSDK-RunTests-Steps.yml | 7 ++- test/ApplicationData/ApplicationDataTests.cpp | 62 ++++++++++++++++--- 2 files changed, 57 insertions(+), 12 deletions(-) diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-RunTests-Steps.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-RunTests-Steps.yml index bde697e17e..bdd964be23 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-RunTests-Steps.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-RunTests-Steps.yml @@ -148,8 +148,11 @@ steps: inputs: targetType: 'inline' script: | - sc queryex te.service | Write-Host - sc qc te.service | Write-Host + Get-Service + Get-Service | Write-Host + Get-Service | Out-Host + sc.exe queryex te.service | Write-Host + sc.exe qc te.service | Write-Host - task: PowerShell@2 displayName: 'Run TAEF Tests' diff --git a/test/ApplicationData/ApplicationDataTests.cpp b/test/ApplicationData/ApplicationDataTests.cpp index 9bdb11bb92..bff1818cae 100644 --- a/test/ApplicationData/ApplicationDataTests.cpp +++ b/test/ApplicationData/ApplicationDataTests.cpp @@ -109,6 +109,7 @@ namespace Test::PackageManager::Tests public: BEGIN_TEST_CLASS(ApplicationDataTests) TEST_CLASS_PROPERTY(L"ThreadingModel", L"MTA") + TEST_METHOD_PROPERTY(L"RunAs", L"RestrictedUser") END_TEST_CLASS() TEST_CLASS_SETUP(ClassSetup) @@ -547,30 +548,45 @@ WEX::Logging::Log::Comment(WEX::Common::String().Format(L"A8: %ls", packageFamil } }; - +#if defined(BUG_54353582_MOVE_TO_AGGREGATOR_REPO_AS_INTEGRATED_TESTS) + // https://task.ms/54353582 + // + // ApplicationData tests need to run as LocalSystem to muck with the MachineFolder (else E_ACCESSDENIED) + // but the Framework package containing the ApplicationData WinRT API can't be registered for LocalSystem + // (until https://task.ms/46984317 or https://task.ms/32845607 or the like). These tests can work + // if moved to the Aggregator repositories where the ApplicationData DeploymentExtensionHandler (DEH) + // is available - then we can install a test package where MachineFolder's ACL'd with additional rights + // so the tests can exercise MachineFolder as needed. class ApplicationDataTests_Elevated { public: BEGIN_TEST_CLASS(ApplicationDataTests_Elevated) TEST_CLASS_PROPERTY(L"ThreadingModel", L"MTA") - TEST_CLASS_PROPERTY(L"RunAs", L"RestrictedUser") - TEST_CLASS_PROPERTY(L"RunFixtureAs", L"RestrictedUser") + TEST_CLASS_PROPERTY(L"RunAs", /*L"RestrictedUser"*/L"ElevatedUser") + TEST_CLASS_PROPERTY(L"RunFixtureAs", /*L"RestrictedUser"*/L"ElevatedUser") END_TEST_CLASS() + // @warning Fixtures and Tests run as separate processes (despite they both RunAs:RestrictedUser). + // Thus the Fixtures need to register packages whereas Tests need to enable the Bootstrapper. + // Test methods that don't enable the bootstrapper will fail with 0x80040154 Class not registered + // due to COM not finding the expected WinRT APIs in the test Framework package (which needs to be + // in the process' package graph or error). + TEST_CLASS_SETUP(ClassSetup) { + ::TD::DumpExecutionContext(); if (!::WindowsVersion::IsWindows11_21H2OrGreater()) { WEX::Logging::Log::Result(WEX::Logging::TestResults::Skipped, L"ApplicationData requires Win11 >= 21H2 (SV1). Skipping tests"); return true; } - ::TB::Setup(); + ::TB::SetupPackages(); return true; } TEST_CLASS_CLEANUP(ClassCleanup) { - ::TB::Cleanup(); + ::TB::CleanupPackages(); return true; } @@ -613,26 +629,37 @@ WEX::Logging::Log::Comment(WEX::Common::String().Format(L"A8: %ls", packageFamil TEST_METHOD_PROPERTY(L"RunAs", L"System") END_TEST_METHOD_PROPERTIES() + ::TD::DumpExecutionContext(); + ::TB::SetupBootstrap(); + const auto packageFamilyName{ Framework_PackageFamilyName }; CreateMachinePathIfNecessary(packageFamilyName); + + ::TB::CleanupBootstrap(); } TEST_METHOD(CreateMachinePathIfNecessary_Main) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_METHOD_PROPERTY(L"RunAs", L"System") + TEST_METHOD_PROPERTY(L"RunAs", /*L"System"*/L"ElevatedUser") END_TEST_METHOD_PROPERTIES() + ::TB::SetupBootstrap(); + const auto packageFamilyName{ Main_PackageFamilyName }; CreateMachinePathIfNecessary(packageFamilyName); + + ::TB::CleanupBootstrap(); } TEST_METHOD(MachineFolderAndPath_Main_Supported) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_METHOD_PROPERTY(L"RunAs", L"RestrictedUser") + TEST_METHOD_PROPERTY(L"RunAs", /*L"RestrictedUser"*/L"ElevatedUser") END_TEST_METHOD_PROPERTIES() + ::TB::SetupBootstrap(); + winrt::hstring packageFamilyName{ Main_PackageFamilyName }; auto applicationData{ winrt::Microsoft::Windows::Storage::ApplicationData::GetForPackageFamily(packageFamilyName) }; VERIFY_IS_NOT_NULL(applicationData); @@ -646,14 +673,18 @@ WEX::Logging::Log::Comment(WEX::Common::String().Format(L"A8: %ls", packageFamil const auto expectedMachinePath{ GetExpectedMachinePath(packageFamilyName) }; VERIFY_ARE_EQUAL(machinePath, winrt::hstring(expectedMachinePath.c_str())); + + ::TB::CleanupBootstrap(); } TEST_METHOD(MachineFolderAndPath_Framework_Supported) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_METHOD_PROPERTY(L"RunAs", L"RestrictedUser") + TEST_METHOD_PROPERTY(L"RunAs", /*L"RestrictedUser"*/L"ElevatedUser") END_TEST_METHOD_PROPERTIES() + ::TB::SetupBootstrap(); + winrt::hstring packageFamilyName{ Framework_PackageFamilyName }; auto applicationData{ winrt::Microsoft::Windows::Storage::ApplicationData::GetForPackageFamily(packageFamilyName) }; VERIFY_IS_NOT_NULL(applicationData); @@ -667,26 +698,37 @@ WEX::Logging::Log::Comment(WEX::Common::String().Format(L"A8: %ls", packageFamil const auto expectedMachinePath{ GetExpectedMachinePath(packageFamilyName) }; VERIFY_ARE_EQUAL(machinePath, winrt::hstring(expectedMachinePath.c_str())); + + ::TB::CleanupBootstrap(); } TEST_METHOD(RemoveMachinePathIfNecessary_Main) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_METHOD_PROPERTY(L"RunAs", L"System") + TEST_METHOD_PROPERTY(L"RunAs", /*L"System"*/L"ElevatedUser") END_TEST_METHOD_PROPERTIES() + ::TB::SetupBootstrap(); + const auto packageFamilyName{ Main_PackageFamilyName }; RemoveMachinePathIfNecessary(packageFamilyName); + + ::TB::CleanupBootstrap(); } TEST_METHOD(RemoveMachinePathIfNecessary_Framework) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_METHOD_PROPERTY(L"RunAs", L"System") + TEST_METHOD_PROPERTY(L"RunAs", /*L"System"*/L"ElevatedUser") END_TEST_METHOD_PROPERTIES() + ::TB::SetupBootstrap(); + const auto packageFamilyName{ Framework_PackageFamilyName }; RemoveMachinePathIfNecessary(packageFamilyName); + + ::TB::CleanupBootstrap(); } }; +#endif } From 2fdb8e25c780a448f332f0bfca348a85d18b45fd Mon Sep 17 00:00:00 2001 From: Howard Kapustein Date: Wed, 9 Oct 2024 23:53:53 -0700 Subject: [PATCH 11/27] Minor fix --- test/ApplicationData/ApplicationDataTests.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/ApplicationData/ApplicationDataTests.cpp b/test/ApplicationData/ApplicationDataTests.cpp index bff1818cae..dac855e430 100644 --- a/test/ApplicationData/ApplicationDataTests.cpp +++ b/test/ApplicationData/ApplicationDataTests.cpp @@ -89,7 +89,7 @@ namespace Test::PackageManager::Tests const auto Main_PackageFamilyName{ ::TP::DynamicDependencyDataStore::c_PackageFamilyName }; const auto Framework_PackageFamilyName{ ::TP::WindowsAppRuntimeFramework::c_PackageFamilyName }; - std::filesystem::path GetExpectedMachinePath(winrt::hstring const& packageFamilyName) + inline std::filesystem::path GetExpectedMachinePath(winrt::hstring const& packageFamilyName) { // Expected Path = HKLM\...apprepository...\Families\ApplicationData\...pkgfamilyname...\Machine // This is typically %ProgramData%\Microsoft\Windows\AppRepository\Families\ApplicationData\...pkgfamilyname...\Machine @@ -120,9 +120,7 @@ namespace Test::PackageManager::Tests WEX::Logging::Log::Result(WEX::Logging::TestResults::Skipped, L"ApplicationData requires Win11 >= 21H2 (SV1). Skipping tests"); return true; } -WEX::Logging::Log::Comment(WEX::Common::String().Format(L"S1")); ::TB::Setup(); -WEX::Logging::Log::Comment(WEX::Common::String().Format(L"S2")); return true; } From 01c1624d43a9958917a847af799523785061d563 Mon Sep 17 00:00:00 2001 From: Howard Kapustein Date: Thu, 10 Oct 2024 00:01:32 -0700 Subject: [PATCH 12/27] Removed previous interim block disabling Dynamic Dependencies delegation to OS Dynamic Dependencies. Let's take it for a spin and see how it handles... --- dev/DynamicDependency/API/MddWin11.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/dev/DynamicDependency/API/MddWin11.h b/dev/DynamicDependency/API/MddWin11.h index 50d82c02a8..759114ac6d 100644 --- a/dev/DynamicDependency/API/MddWin11.h +++ b/dev/DynamicDependency/API/MddWin11.h @@ -41,7 +41,7 @@ namespace MddCore::Win11 __declspec(selectany) HMODULE g_dllApisetAppmodelRuntime_1_7{}; //TODO:47775758 GetResolved2 __declspec(selectany) decltype(&::GetResolvedPackageFullNameForPackageDependency2) g_win11GetResolvedPackageFullNameForPackageDependency2{}; - __declspec(selectany) bool g_isSupported{ WindowsVersion::IsWindows11_22H2OrGreater() }; + __declspec(selectany) bool g_isSupported{ WindowsVersion::IsWindows11_24H1OrGreater() }; constexpr PackageDependencyLifetimeKind ToLifetimeKind(MddPackageDependencyLifetimeKind lifetimeKind) { @@ -95,11 +95,7 @@ namespace MddCore::Win11 inline bool IsSupported() { -#if defined(TODO_WindowsAppSDKAggregator_Test_Failures) return MddCore::Win11::details::g_isSupported; -#else - return false; -#endif } inline bool IsGetResolvedPackageFullNameForPackageDependency2Supported() From 71d3e70ea25f4b2ea1ae6930a2f31a039082daab Mon Sep 17 00:00:00 2001 From: Howard Kapustein Date: Thu, 10 Oct 2024 16:26:36 -0700 Subject: [PATCH 13/27] Fixed DevCheck not getting VS' path thus not checking VS stuff --- tools/DevCheck/DevCheck.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/DevCheck/DevCheck.ps1 b/tools/DevCheck/DevCheck.ps1 index 57b1c36956..81bd486adc 100644 --- a/tools/DevCheck/DevCheck.ps1 +++ b/tools/DevCheck/DevCheck.ps1 @@ -576,6 +576,7 @@ function Get-VisualStudio2022InstallPath $path = $path -replace [environment]::NewLine, '' Write-Verbose "Visual Studio 2022 detected at $path" $global:vspath = $path + return $path } function Test-VisualStudioComponent From 91f7404abefe99f576b51a2d08d6d038caa7655b Mon Sep 17 00:00:00 2001 From: Howard Kapustein Date: Thu, 10 Oct 2024 17:04:29 -0700 Subject: [PATCH 14/27] Split IsReady tests into RestrictedUser vs ElevatedUser --- .../PackageDeploymentManagerTests_IsReady.cpp | 45 +++++++++++++++++-- 1 file changed, 41 insertions(+), 4 deletions(-) diff --git a/test/PackageManager/API/PackageDeploymentManagerTests_IsReady.cpp b/test/PackageManager/API/PackageDeploymentManagerTests_IsReady.cpp index 19c533a183..79f218d301 100644 --- a/test/PackageManager/API/PackageDeploymentManagerTests_IsReady.cpp +++ b/test/PackageManager/API/PackageDeploymentManagerTests_IsReady.cpp @@ -439,13 +439,50 @@ WEX::Logging::Log::Comment(L"4B"); VERIFY_IS_FALSE(packageDeploymentManager.IsPackageSetReady(packageSet)); } + }; - TEST_METHOD(IsPackageSetReady_N_No_NotAllPackageStatusOK) + class PackageDeploymentManagerTests_IsReady_Elevated : PackageDeploymentManagerTests_Base + { + public: + BEGIN_TEST_CLASS(PackageDeploymentManagerTests_IsReady_Elevated) + TEST_CLASS_PROPERTY(L"ThreadingModel", L"MTA") + TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + END_TEST_CLASS() + + TEST_CLASS_SETUP(ClassSetup) { - BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") - END_TEST_METHOD_PROPERTIES() + ::TD::DumpExecutionContext(); + if (!::WindowsVersion::IsWindows10_20H1OrGreater()) + { + WEX::Logging::Log::Result(WEX::Logging::TestResults::Skipped, L"PackageDeploymentManager requires >= 20H1 (Vibranium). Skipping tests"); + return true; + } +WEX::Logging::Log::Comment(L"S1"); + RemovePackage_Blue(); +WEX::Logging::Log::Comment(L"S2"); + RemovePackage_Green(); +WEX::Logging::Log::Comment(L"S3"); + RemovePackage_Redder(); +WEX::Logging::Log::Comment(L"S4"); + RemovePackage_Red(); +WEX::Logging::Log::Comment(L"S5"); + ::TB::Setup(); +WEX::Logging::Log::Comment(L"S6"); + return true; + } + TEST_CLASS_CLEANUP(ClassCleanup) + { + RemovePackage_Blue(); + RemovePackage_Green(); + RemovePackage_Redder(); + RemovePackage_Red(); + ::TB::Cleanup(); + return true; + } + + TEST_METHOD(IsPackageSetReady_N_No_NotAllPackageStatusOK) + { auto packageDeploymentManager{ winrt::Microsoft::Windows::Management::Deployment::PackageDeploymentManager::GetDefault() }; AddPackage_Red(); From 1cd3b8961898ae29b2f887b89afa4421bdaf98fc Mon Sep 17 00:00:00 2001 From: Howard Kapustein Date: Fri, 11 Oct 2024 13:46:54 -0700 Subject: [PATCH 15/27] Fix mis-tagging of TAEF properties (though according to TAEF folks TEST_CLASS_PROPERTY is treated same as TEST_METHOD_PROPERTY if inside a BEGIN/END_METHOD_PROPERTIES() block because it's been a common mistake, so TAEF now treats it effectively as TEST_PROPERTY() scoped to the surrounding BEGIN/END_*_PROPERTY() --- test/ApplicationData/ApplicationDataTests.cpp | 2 +- .../API/PackageDeploymentManagerTests_Add.cpp | 16 ++++----- ...kageDeploymentManagerTests_EnsureReady.cpp | 8 ++--- .../PackageDeploymentManagerTests_IsReady.cpp | 2 +- ...ntManagerTests_IsReadyOrNewerAvailable.cpp | 4 +-- ...PackageDeploymentManagerTests_Register.cpp | 16 ++++----- .../PackageDeploymentManagerTests_Remove.cpp | 34 +++++++++---------- .../PackageDeploymentManagerTests_Repair.cpp | 14 ++++---- .../PackageDeploymentManagerTests_Reset.cpp | 14 ++++---- .../PackageDeploymentManagerTests_Stage.cpp | 16 ++++----- .../API/PackageRuntimeManagerTests.cpp | 8 ++--- 11 files changed, 67 insertions(+), 67 deletions(-) diff --git a/test/ApplicationData/ApplicationDataTests.cpp b/test/ApplicationData/ApplicationDataTests.cpp index dac855e430..3ecc79780f 100644 --- a/test/ApplicationData/ApplicationDataTests.cpp +++ b/test/ApplicationData/ApplicationDataTests.cpp @@ -109,7 +109,7 @@ namespace Test::PackageManager::Tests public: BEGIN_TEST_CLASS(ApplicationDataTests) TEST_CLASS_PROPERTY(L"ThreadingModel", L"MTA") - TEST_METHOD_PROPERTY(L"RunAs", L"RestrictedUser") + TEST_CLASS_PROPERTY(L"RunAs", L"RestrictedUser") END_TEST_CLASS() TEST_CLASS_SETUP(ClassSetup) diff --git a/test/PackageManager/API/PackageDeploymentManagerTests_Add.cpp b/test/PackageManager/API/PackageDeploymentManagerTests_Add.cpp index d0a342240e..ebc99acc58 100644 --- a/test/PackageManager/API/PackageDeploymentManagerTests_Add.cpp +++ b/test/PackageManager/API/PackageDeploymentManagerTests_Add.cpp @@ -82,7 +82,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(AddPackageAsync_Staged_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() StagePackage_Red(); @@ -189,7 +189,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(AddPackageByUriAsync_Staged_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() StagePackage_Red(); @@ -306,7 +306,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(AddPackageSetAsync_1_Staged_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() StagePackage_Red(); @@ -525,7 +525,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(AddPackageSetAsync_N_RegisteredAndNotInstalledAndStaged_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() AddPackage_Red(); @@ -595,7 +595,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(AddPackageAsync_RegisteredPackageStatusBad_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() auto packageDeploymentManager{ winrt::Microsoft::Windows::Management::Deployment::PackageDeploymentManager::GetDefault() }; @@ -619,7 +619,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(AddPackageByUriAsync_RegisteredPackageStatusBad_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() auto packageDeploymentManager{ winrt::Microsoft::Windows::Management::Deployment::PackageDeploymentManager::GetDefault() }; @@ -642,7 +642,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(AddPackageSetAsync_1_RegisteredPackageStatusBad_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() auto packageDeploymentManager{ winrt::Microsoft::Windows::Management::Deployment::PackageDeploymentManager::GetDefault() }; @@ -669,7 +669,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(AddPackageSetAsync_N_RegisteredPackageStatusOkAndBad_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() auto packageDeploymentManager{ winrt::Microsoft::Windows::Management::Deployment::PackageDeploymentManager::GetDefault() }; diff --git a/test/PackageManager/API/PackageDeploymentManagerTests_EnsureReady.cpp b/test/PackageManager/API/PackageDeploymentManagerTests_EnsureReady.cpp index 04d22ab0af..ca766c081e 100644 --- a/test/PackageManager/API/PackageDeploymentManagerTests_EnsureReady.cpp +++ b/test/PackageManager/API/PackageDeploymentManagerTests_EnsureReady.cpp @@ -204,7 +204,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(EnsurePackageSetReadyAsync_1_Staged_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() StagePackage_Red(); @@ -423,7 +423,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(EnsurePackageSetReadyAsync_N_RegisteredAndNotInstalledAndStaged_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() AddPackage_Red(); @@ -493,7 +493,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(EnsurePackageSetReadyAsync_1_RegisteredPackageStatusBad_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() auto packageDeploymentManager{ winrt::Microsoft::Windows::Management::Deployment::PackageDeploymentManager::GetDefault() }; @@ -520,7 +520,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(EnsurePackageSetReadyAsync_N_RegisteredPackageStatusOkAndBad_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() auto packageDeploymentManager{ winrt::Microsoft::Windows::Management::Deployment::PackageDeploymentManager::GetDefault() }; diff --git a/test/PackageManager/API/PackageDeploymentManagerTests_IsReady.cpp b/test/PackageManager/API/PackageDeploymentManagerTests_IsReady.cpp index 19c533a183..c48d128af7 100644 --- a/test/PackageManager/API/PackageDeploymentManagerTests_IsReady.cpp +++ b/test/PackageManager/API/PackageDeploymentManagerTests_IsReady.cpp @@ -443,7 +443,7 @@ WEX::Logging::Log::Comment(L"4B"); TEST_METHOD(IsPackageSetReady_N_No_NotAllPackageStatusOK) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() auto packageDeploymentManager{ winrt::Microsoft::Windows::Management::Deployment::PackageDeploymentManager::GetDefault() }; diff --git a/test/PackageManager/API/PackageDeploymentManagerTests_IsReadyOrNewerAvailable.cpp b/test/PackageManager/API/PackageDeploymentManagerTests_IsReadyOrNewerAvailable.cpp index 9a2b56a971..f2e5203d88 100644 --- a/test/PackageManager/API/PackageDeploymentManagerTests_IsReadyOrNewerAvailable.cpp +++ b/test/PackageManager/API/PackageDeploymentManagerTests_IsReadyOrNewerAvailable.cpp @@ -738,7 +738,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(IsPackageSetReadyOrNewerAvailable_N_No_NotAllPackageStatusOK) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() if (TPMT::SkipIfFeatureNotSupported_IsPackageReadyOrNewerAvailable()) @@ -810,7 +810,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(IsPackageSetReady_1_RegisteredPackageStatusBad_No) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() auto packageDeploymentManager{ winrt::Microsoft::Windows::Management::Deployment::PackageDeploymentManager::GetDefault() }; diff --git a/test/PackageManager/API/PackageDeploymentManagerTests_Register.cpp b/test/PackageManager/API/PackageDeploymentManagerTests_Register.cpp index ec2cb9a6c1..469f043fcf 100644 --- a/test/PackageManager/API/PackageDeploymentManagerTests_Register.cpp +++ b/test/PackageManager/API/PackageDeploymentManagerTests_Register.cpp @@ -88,7 +88,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(RegisterPackageAsync_Framework_Staged_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() RETURN_IF_SKIP_ON_WIN10_DUE_TO_0x80073D2B_IN_TEST(); @@ -112,7 +112,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(RegisterPackageAsync_Main_Staged_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() RETURN_IF_SKIP_ON_WIN10_DUE_TO_0x80073D2B_IN_TEST(); @@ -240,7 +240,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(RegisterPackageByUriAsync_Framework_Staged_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() RETURN_IF_SKIP_ON_WIN10_DUE_TO_0x80073D2B_IN_TEST(); @@ -266,7 +266,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(RegisterPackageByUriAsync_Main_Staged_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() RETURN_IF_SKIP_ON_WIN10_DUE_TO_0x80073D2B_IN_TEST(); @@ -388,7 +388,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(RegisterPackageSetAsync_Framework_1_Staged_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() RETURN_IF_SKIP_ON_WIN10_DUE_TO_0x80073D2B_IN_TEST(); @@ -414,7 +414,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(RegisterPackageSetAsync_Main_1_Staged_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() RETURN_IF_SKIP_ON_WIN10_DUE_TO_0x80073D2B_IN_TEST(); @@ -654,7 +654,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(RegisterPackageSetAsync_Framework_N_RegisteredAndStaged_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() RETURN_IF_SKIP_ON_WIN10_DUE_TO_0x80073D2B_IN_TEST(); @@ -683,7 +683,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(RegisterPackageSetAsync_Main_N_RegisteredAndStaged_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() RETURN_IF_SKIP_ON_WIN10_DUE_TO_0x80073D2B_IN_TEST(); diff --git a/test/PackageManager/API/PackageDeploymentManagerTests_Remove.cpp b/test/PackageManager/API/PackageDeploymentManagerTests_Remove.cpp index 4db273f145..854bfd399d 100644 --- a/test/PackageManager/API/PackageDeploymentManagerTests_Remove.cpp +++ b/test/PackageManager/API/PackageDeploymentManagerTests_Remove.cpp @@ -103,7 +103,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(RemovePackageAsync_PackageFullName_Staged_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() StagePackage_Red(); @@ -189,7 +189,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(RemovePackageAsync_PackageFamilyName_Staged_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() StagePackage_Red(); @@ -279,7 +279,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(RemovePackageByFullNameAsync_Staged_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() StagePackage_Red(); @@ -346,7 +346,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(RemovePackageByFamilyNameAsync_Staged_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() StagePackage_Red(); @@ -430,7 +430,7 @@ WEX::Logging::Log::Comment(WEX::Common::String().Format(L"ErrorText: %s", deploy TEST_METHOD(RemovePackageByUriAsync_Staged_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() if (TPMT::SkipIfFeatureNotSupported_RemovePackageByUri() || TPMT::SkipIfFeatureNotSupported_PackageUriScheme_ms_uup()) @@ -544,7 +544,7 @@ WEX::Logging::Log::Comment(WEX::Common::String().Format(L"ErrorText: %s", deploy TEST_METHOD(RemovePackageSetAsync_Uri_1_Staged_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() StagePackage_Red(); @@ -745,7 +745,7 @@ WEX::Logging::Log::Comment(WEX::Common::String().Format(L"ErrorText: %s", deploy TEST_METHOD(RemovePackageSetAsync_Uri_N_RegisteredAndNotInstalledAndStaged_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() AddPackage_Red(); @@ -855,7 +855,7 @@ WEX::Logging::Log::Comment(WEX::Common::String().Format(L"ErrorText: %s", deploy TEST_METHOD(RemovePackageSetAsync_NoUri_1_Staged_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() StagePackage_Red(); @@ -1022,7 +1022,7 @@ WEX::Logging::Log::Comment(WEX::Common::String().Format(L"ErrorText: %s", deploy TEST_METHOD(RemovePackageSetAsync_NoUri_N_RegisteredAndNotInstalledAndStaged_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() AddPackage_Red(); @@ -1096,7 +1096,7 @@ WEX::Logging::Log::Comment(WEX::Common::String().Format(L"ErrorText: %s", deploy TEST_METHOD(RemovePackageAsync_PackageFullName_RegisteredPackageStatusBad_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() auto packageDeploymentManager{ winrt::Microsoft::Windows::Management::Deployment::PackageDeploymentManager::GetDefault() }; @@ -1120,7 +1120,7 @@ WEX::Logging::Log::Comment(WEX::Common::String().Format(L"ErrorText: %s", deploy TEST_METHOD(RemovePackageAsync_PackageFamilyName_RegisteredPackageStatusBad_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() auto packageDeploymentManager{ winrt::Microsoft::Windows::Management::Deployment::PackageDeploymentManager::GetDefault() }; @@ -1144,7 +1144,7 @@ WEX::Logging::Log::Comment(WEX::Common::String().Format(L"ErrorText: %s", deploy TEST_METHOD(RemovePackageByFullNameAsync_RegisteredPackageStatusBad_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() auto packageDeploymentManager{ winrt::Microsoft::Windows::Management::Deployment::PackageDeploymentManager::GetDefault() }; @@ -1168,7 +1168,7 @@ WEX::Logging::Log::Comment(WEX::Common::String().Format(L"ErrorText: %s", deploy TEST_METHOD(RemovePackageByFamilyNameAsync_RegisteredPackageStatusBad_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() auto packageDeploymentManager{ winrt::Microsoft::Windows::Management::Deployment::PackageDeploymentManager::GetDefault() }; @@ -1202,7 +1202,7 @@ WEX::Logging::Log::Comment(WEX::Common::String().Format(L"ErrorText: %s", deploy TEST_METHOD(RemovePackageSetAsync_Uri_1_RegisteredPackageStatusBad_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() auto packageDeploymentManager{ winrt::Microsoft::Windows::Management::Deployment::PackageDeploymentManager::GetDefault() }; @@ -1237,7 +1237,7 @@ WEX::Logging::Log::Comment(WEX::Common::String().Format(L"ErrorText: %s", deploy TEST_METHOD(RemovePackageSetAsync_Uri_N_RegisteredPackageStatusOkAndBad_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() auto packageDeploymentManager{ winrt::Microsoft::Windows::Management::Deployment::PackageDeploymentManager::GetDefault() }; @@ -1272,7 +1272,7 @@ WEX::Logging::Log::Comment(WEX::Common::String().Format(L"ErrorText: %s", deploy TEST_METHOD(RemovePackageSetAsync_NoUri_1_RegisteredPackageStatusBad_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() auto packageDeploymentManager{ winrt::Microsoft::Windows::Management::Deployment::PackageDeploymentManager::GetDefault() }; @@ -1302,7 +1302,7 @@ WEX::Logging::Log::Comment(WEX::Common::String().Format(L"ErrorText: %s", deploy TEST_METHOD(RemovePackageSetAsync_NoUri_N_RegisteredPackageStatusOkAndBad_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() auto packageDeploymentManager{ winrt::Microsoft::Windows::Management::Deployment::PackageDeploymentManager::GetDefault() }; diff --git a/test/PackageManager/API/PackageDeploymentManagerTests_Repair.cpp b/test/PackageManager/API/PackageDeploymentManagerTests_Repair.cpp index d343106747..ab89daada0 100644 --- a/test/PackageManager/API/PackageDeploymentManagerTests_Repair.cpp +++ b/test/PackageManager/API/PackageDeploymentManagerTests_Repair.cpp @@ -92,7 +92,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(RepairPackageAsync_PackageFullName_Staged_Fail) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() if (TPMT::SkipIfFeatureNotSupported_RepairPackage()) @@ -162,7 +162,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(RepairPackageAsync_PackageFamilyName_Staged_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() if (TPMT::SkipIfFeatureNotSupported_RepairPackage()) @@ -238,7 +238,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(RepairPackageByUriAsync_Staged_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() if (TPMT::SkipIfFeatureNotSupported_RepairPackage() || TPMT::SkipIfFeatureNotSupported_PackageUriScheme_ms_uup()) @@ -316,7 +316,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(RepairPackageSetAsync_1_Staged_Fail) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() if (TPMT::SkipIfFeatureNotSupported_RepairPackage()) @@ -464,7 +464,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(RepairPackageSetAsync_N_RegisteredAndNotInstalledAndStaged_Fail) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() if (TPMT::SkipIfFeatureNotSupported_RepairPackage()) @@ -541,7 +541,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(RepairPackageAsync_PackageFullName_RegisteredPackageStatusBad_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() if (TPMT::SkipIfFeatureNotSupported_RepairPackage()) @@ -568,7 +568,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(RepairPackageAsync_PackageFamilyName_RegisteredPackageStatusBad_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() if (TPMT::SkipIfFeatureNotSupported_RepairPackage()) diff --git a/test/PackageManager/API/PackageDeploymentManagerTests_Reset.cpp b/test/PackageManager/API/PackageDeploymentManagerTests_Reset.cpp index 0c2dcc7fec..ef514f27f1 100644 --- a/test/PackageManager/API/PackageDeploymentManagerTests_Reset.cpp +++ b/test/PackageManager/API/PackageDeploymentManagerTests_Reset.cpp @@ -92,7 +92,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(ResetPackageAsync_PackageFullName_Staged_Fail) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() if (TPMT::SkipIfFeatureNotSupported_ResetPackage()) @@ -166,7 +166,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(ResetPackageAsync_PackageFamilyName_Staged_Fail) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() if (TPMT::SkipIfFeatureNotSupported_ResetPackage()) @@ -246,7 +246,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(ResetPackageByUriAsync_Staged_Fail) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() if (TPMT::SkipIfFeatureNotSupported_ResetPackage() || TPMT::SkipIfFeatureNotSupported_PackageUriScheme_ms_uup()) @@ -324,7 +324,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(ResetPackageSetAsync_1_Staged_Fail) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() if (TPMT::SkipIfFeatureNotSupported_ResetPackage()) @@ -472,7 +472,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(ResetPackageSetAsync_N_RegisteredAndNotInstalledAndStaged_Fail) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() if (TPMT::SkipIfFeatureNotSupported_ResetPackage()) @@ -549,7 +549,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(ResetPackageAsync_PackageFullName_RegisteredPackageStatusBad_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() if (TPMT::SkipIfFeatureNotSupported_ResetPackage()) @@ -580,7 +580,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(ResetPackageAsync_PackageFamilyName_RegisteredPackageStatusBad_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() if (TPMT::SkipIfFeatureNotSupported_ResetPackage()) diff --git a/test/PackageManager/API/PackageDeploymentManagerTests_Stage.cpp b/test/PackageManager/API/PackageDeploymentManagerTests_Stage.cpp index 5f302b58ad..5e5c59d96a 100644 --- a/test/PackageManager/API/PackageDeploymentManagerTests_Stage.cpp +++ b/test/PackageManager/API/PackageDeploymentManagerTests_Stage.cpp @@ -89,7 +89,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(StagePackageAsync_Staged_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() RemovePackageFamily_Red(); @@ -206,7 +206,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(StagePackageByUriAsync_Staged_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() RemovePackageFamily_Red(); @@ -334,7 +334,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(StagePackageSetAsync_1_Staged_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() RemovePackageFamily_Red(); @@ -654,7 +654,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(StagePackageSetAsync_N_StagedAndNotInstalledAndStaged_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() RemovePackageFamily_Red(); @@ -729,7 +729,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(StagePackageAsync_StagedPackageStatusBad_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() auto packageDeploymentManager{ winrt::Microsoft::Windows::Management::Deployment::PackageDeploymentManager::GetDefault() }; @@ -754,7 +754,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(StagePackageByUriAsync_StagedPackageStatusBad_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() auto packageDeploymentManager{ winrt::Microsoft::Windows::Management::Deployment::PackageDeploymentManager::GetDefault() }; @@ -778,7 +778,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(StagePackageSetAsync_1_StagedPackageStatusBad_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() auto packageDeploymentManager{ winrt::Microsoft::Windows::Management::Deployment::PackageDeploymentManager::GetDefault() }; @@ -806,7 +806,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(StagePackageSetAsync_N_StagedPackageStatusOkAndBad_Success) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() auto packageDeploymentManager{ winrt::Microsoft::Windows::Management::Deployment::PackageDeploymentManager::GetDefault() }; diff --git a/test/PackageManager/API/PackageRuntimeManagerTests.cpp b/test/PackageManager/API/PackageRuntimeManagerTests.cpp index 8e7e4f0179..c107382360 100644 --- a/test/PackageManager/API/PackageRuntimeManagerTests.cpp +++ b/test/PackageManager/API/PackageRuntimeManagerTests.cpp @@ -231,7 +231,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(AddPackageSet_1_Staged_Fail) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() RemovePackage_Red(); @@ -330,7 +330,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(AddPackageSet_1_RegisteredPackageStatusBad_Fail) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() AddPackage_Red(); @@ -509,7 +509,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(AddPackageSet_N_RegisteredAndNotInstalledAndStaged_Fail) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() AddPackage_Red(); @@ -545,7 +545,7 @@ namespace Test::PackageManager::Tests TEST_METHOD(AddPackageSet_N_RegisteredPackageStatusOkAndBad_Fail) { BEGIN_TEST_METHOD_PROPERTIES() - TEST_CLASS_PROPERTY(L"RunAs", L"ElevatedUser") + TEST_METHOD_PROPERTY(L"RunAs", L"ElevatedUser") END_TEST_METHOD_PROPERTIES() AddPackage_Red(); From e7f005a7ec5adc05669352fd73ba124fa2c822f1 Mon Sep 17 00:00:00 2001 From: Howard Kapustein Date: Tue, 22 Oct 2024 13:01:12 -0700 Subject: [PATCH 16/27] DevCheck -SyncDependencies update --- dev/WindowsAppRuntime_DLL/packages.config | 2 +- test/PackageManager/API/packages.config | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/WindowsAppRuntime_DLL/packages.config b/dev/WindowsAppRuntime_DLL/packages.config index 9bb9012e6d..017744cb51 100644 --- a/dev/WindowsAppRuntime_DLL/packages.config +++ b/dev/WindowsAppRuntime_DLL/packages.config @@ -5,5 +5,5 @@ - + diff --git a/test/PackageManager/API/packages.config b/test/PackageManager/API/packages.config index 9f0578ed13..7b9279313e 100644 --- a/test/PackageManager/API/packages.config +++ b/test/PackageManager/API/packages.config @@ -6,5 +6,5 @@ - + From 8a76d2809b15f545f8c6f9133f8346af95eb2ca9 Mon Sep 17 00:00:00 2001 From: Howard Kapustein Date: Tue, 22 Oct 2024 13:47:30 -0700 Subject: [PATCH 17/27] Removed FrameworkUdk references in packages.config. Added Build Dependencies in WindowsAppRuntime.sln for anything using FrUdk on the Microsoft.FrameworkUdk.PackageReferences.csproj as th SexyNewfangledWay(TM) to restore FrameworkUdk (when necessary) --- WindowsAppRuntime.sln | 22 ++++++++++++++++++++++ dev/WindowsAppRuntime_DLL/packages.config | 1 - test/PackageManager/API/packages.config | 1 - 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/WindowsAppRuntime.sln b/WindowsAppRuntime.sln index afe7629998..d7fab7e390 100644 --- a/WindowsAppRuntime.sln +++ b/WindowsAppRuntime.sln @@ -15,6 +15,9 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{8630F7AA-2969-4DC9-8700-9B468C1DC21D}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WindowsAppRuntime_DLL", "dev\WindowsAppRuntime_DLL\WindowsAppRuntime_DLL.vcxproj", "{B73AD907-6164-4294-88FB-F3C9C10DA1F1}" + ProjectSection(ProjectDependencies) = postProject + {FD0CC14A-ED4B-4936-B68B-F31E58372E32} = {FD0CC14A-ED4B-4936-B68B-F31E58372E32} + EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AppLifecycle", "AppLifecycle", "{3DE93B2F-F887-437D-B512-6B1024ABA290}" EndProject @@ -69,6 +72,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Microsoft.WindowsAppRuntime ProjectSection(ProjectDependencies) = postProject {4410D374-A90C-4ADF-8B15-AA2AAE2636BF} = {4410D374-A90C-4ADF-8B15-AA2AAE2636BF} {BC5E5A3E-E733-4388-8B00-F8495DA7C778} = {BC5E5A3E-E733-4388-8B00-F8495DA7C778} + {FD0CC14A-ED4B-4936-B68B-F31E58372E32} = {FD0CC14A-ED4B-4936-B68B-F31E58372E32} EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DynamicDependencyDataStore", "DynamicDependencyDataStore", "{441A3BB0-7FD2-4902-AEDB-A1C57B528C77}" @@ -172,6 +176,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PushNotificationTests", "te EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PushNotificationsLongRunningTask", "dev\PushNotifications\PushNotificationsLongRunningTask\PushNotificationsLongRunningTask.vcxproj", "{1307DD1B-BBE8-4CD0-B1A0-0DB6D61EEAA0}" + ProjectSection(ProjectDependencies) = postProject + {FD0CC14A-ED4B-4936-B68B-F31E58372E32} = {FD0CC14A-ED4B-4936-B68B-F31E58372E32} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PushNotificationsLongRunningTask.ProxyStub", "dev\PushNotifications\PushNotificationsLongRunningTask.ProxyStub\PushNotificationsLongRunningTask.ProxyStub.vcxproj", "{BF3FCED0-CADB-490A-93A7-4D90E1F45AB0}" EndProject @@ -185,6 +192,9 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PowerNotifications", "dev\PowerNotifications\PowerNotifications.vcxitems", "{B75C1B22-553C-40E4-B38E-6AB4D01FDB9D}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PowerNotifications", "test\PowerNotifications\PowerNotifications.vcxproj", "{CBD95746-61CE-4F31-B6CC-C5ABF1766180}" + ProjectSection(ProjectDependencies) = postProject + {FD0CC14A-ED4B-4936-B68B-F31E58372E32} = {FD0CC14A-ED4B-4936-B68B-F31E58372E32} + EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Projections", "Projections", "{6CD616F9-173E-42CD-89A1-8FDFD86283AA}" EndProject @@ -206,6 +216,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Windows.AppLifecy EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WindowsAppRuntime.Test.Singleton.Msix", "test\DynamicDependency\data\WindowsAppRuntime.Test.Singleton.Msix\WindowsAppRuntime.Test.Singleton.Msix.vcxproj", "{8F2C21F1-47AB-428C-A110-EE33FD7D9493}" + ProjectSection(ProjectDependencies) = postProject + {FD0CC14A-ED4B-4936-B68B-F31E58372E32} = {FD0CC14A-ED4B-4936-B68B-F31E58372E32} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DeploymentTests", "test\Deployment\API\DeploymentTests.vcxproj", "{E5659A29-FE68-417B-9BC5-613073DD54DF}" ProjectSection(ProjectDependencies) = postProject @@ -219,6 +232,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EnvironmentManagerTests", " {A7391725-4EF5-438F-8DE1-645423E46955} = {A7391725-4EF5-438F-8DE1-645423E46955} {B71E818A-882E-456A-87E5-4DE4A6602B99} = {B71E818A-882E-456A-87E5-4DE4A6602B99} {B73AD907-6164-4294-88FB-F3C9C10DA1F1} = {B73AD907-6164-4294-88FB-F3C9C10DA1F1} + {FD0CC14A-ED4B-4936-B68B-F31E58372E32} = {FD0CC14A-ED4B-4936-B68B-F31E58372E32} EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Bootstrap", "Bootstrap", "{8746775A-899E-49DD-A46C-2FE0899FFFEA}" @@ -351,6 +365,9 @@ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Test_BootstrapAutoInitialize_CS_Options_None", "test\DynamicDependency\Test_BootstrapAutoInitialize\CS\Test_BootstrapAutoInitialize_CS_Options_None\Test_BootstrapAutoInitialize_CS_Options_None.csproj", "{4A74BBED-3B20-44A7-B6FF-3373160DE741}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AppNotificationTests", "test\AppNotificationTests\AppNotificationTests.vcxproj", "{1C9477D2-7330-4992-B06C-F7E2193CF379}" + ProjectSection(ProjectDependencies) = postProject + {FD0CC14A-ED4B-4936-B68B-F31E58372E32} = {FD0CC14A-ED4B-4936-B68B-F31E58372E32} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DeploymentAgent", "dev\DeploymentAgent\DeploymentAgent.vcxproj", "{4410D374-A90C-4ADF-8B15-AA2AAE2636BF}" ProjectSection(ProjectDependencies) = postProject @@ -360,6 +377,9 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AppNotificationBuilder", "dev\AppNotifications\AppNotificationBuilder\AppNotificationBuilder.vcxitems", "{E49329F3-5196-4BBA-B5C4-E11CE7EFB07A}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AppNotificationBuilderTests", "test\AppNotificationBuilderTests\AppNotificationBuilderTests.vcxproj", "{131DE0C4-AA1E-4649-B5BC-7B43508FA93A}" + ProjectSection(ProjectDependencies) = postProject + {FD0CC14A-ED4B-4936-B68B-F31E58372E32} = {FD0CC14A-ED4B-4936-B68B-F31E58372E32} + EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Windows.Security.AccessControl.Projection", "dev\Projections\CS\Microsoft.Windows.Security.AccessControl.Projection\Microsoft.Windows.Security.AccessControl.Projection.csproj", "{E6D59245-696F-4D13-ACF6-7ECE6E653367}" ProjectSection(ProjectDependencies) = postProject @@ -432,6 +452,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LRPTests", "test\LRPTests\L ProjectSection(ProjectDependencies) = postProject {B73AD907-6164-4294-88FB-F3C9C10DA1F1} = {B73AD907-6164-4294-88FB-F3C9C10DA1F1} {F76B776E-86F5-48C5-8FC7-D2795ECC9746} = {F76B776E-86F5-48C5-8FC7-D2795ECC9746} + {FD0CC14A-ED4B-4936-B68B-F31E58372E32} = {FD0CC14A-ED4B-4936-B68B-F31E58372E32} EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "VersionInfo", "VersionInfo", "{2A2D1131-273C-4E17-BCD3-8812170A4B95}" @@ -472,6 +493,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PackageManagerTests", "test {D0A1DFB8-8CEE-4CFC-B57B-B7C574B411C2} = {D0A1DFB8-8CEE-4CFC-B57B-B7C574B411C2} {F2946790-DAF7-4DFF-A754-BA471A12E494} = {F2946790-DAF7-4DFF-A754-BA471A12E494} {FBAE1876-C50A-4EFC-A686-3008B6438731} = {FBAE1876-C50A-4EFC-A686-3008B6438731} + {FD0CC14A-ED4B-4936-B68B-F31E58372E32} = {FD0CC14A-ED4B-4936-B68B-F31E58372E32} EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "data", "data", "{6213B1A3-E854-498F-AAFA-4CFC1E71023E}" diff --git a/dev/WindowsAppRuntime_DLL/packages.config b/dev/WindowsAppRuntime_DLL/packages.config index 017744cb51..cbd27520b0 100644 --- a/dev/WindowsAppRuntime_DLL/packages.config +++ b/dev/WindowsAppRuntime_DLL/packages.config @@ -5,5 +5,4 @@ - diff --git a/test/PackageManager/API/packages.config b/test/PackageManager/API/packages.config index 7b9279313e..0c13ff7b9c 100644 --- a/test/PackageManager/API/packages.config +++ b/test/PackageManager/API/packages.config @@ -6,5 +6,4 @@ - From 0c6135029fba2f384d927afb546fe2eb0fb20cef Mon Sep 17 00:00:00 2001 From: Howard Kapustein Date: Fri, 25 Oct 2024 14:08:35 -0700 Subject: [PATCH 18/27] PackageManager test tweaks --- .../PackageDeploymentManagerTests_IsReady.cpp | 27 +++++++++++++++---- ...ntManagerTests_IsReadyOrNewerAvailable.cpp | 6 ++--- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/test/PackageManager/API/PackageDeploymentManagerTests_IsReady.cpp b/test/PackageManager/API/PackageDeploymentManagerTests_IsReady.cpp index b01a75e5bb..e0f9eae67a 100644 --- a/test/PackageManager/API/PackageDeploymentManagerTests_IsReady.cpp +++ b/test/PackageManager/API/PackageDeploymentManagerTests_IsReady.cpp @@ -32,6 +32,7 @@ namespace Test::PackageManager::Tests WEX::Logging::Log::Result(WEX::Logging::TestResults::Skipped, L"PackageDeploymentManager requires >= 20H1 (Vibranium). Skipping tests"); return true; } +//TODO Remove WEX::Logging::Log::Comment(L"S1"); RemovePackage_Blue(); WEX::Logging::Log::Comment(L"S2"); @@ -72,7 +73,7 @@ WEX::Logging::Log::Comment(L"S6"); } } - TEST_METHOD(IsPackageReady_NoSuchPackage_No) + TEST_METHOD(IsPackageReady_PackageFullName_NoSuchPackage_No) { auto packageDeploymentManager{ winrt::Microsoft::Windows::Management::Deployment::PackageDeploymentManager::GetDefault() }; @@ -81,7 +82,7 @@ WEX::Logging::Log::Comment(L"S6"); VERIFY_IS_FALSE(packageDeploymentManager.IsPackageReady(c_packageFullName)); } - TEST_METHOD(IsPackageReady_NotInstalled_No) + TEST_METHOD(IsPackageReady_PackageFullName_NotInstalled_No) { RemovePackage_Red(); @@ -92,7 +93,7 @@ WEX::Logging::Log::Comment(L"S6"); VERIFY_IS_FALSE(packageDeploymentManager.IsPackageReady(packageFullName)); } - TEST_METHOD(IsPackageReady_Registered_Yes) + TEST_METHOD(IsPackageReady_PackageFullName_Registered_Yes) { AddPackage_Red(); @@ -103,7 +104,7 @@ WEX::Logging::Log::Comment(L"S6"); VERIFY_IS_TRUE(packageDeploymentManager.IsPackageReady(packageFullName)); } - TEST_METHOD(IsPackageReady_OlderRegistered_No) + TEST_METHOD(IsPackageReady_PackageFullName_OlderRegistered_No) { AddPackage_Red(); @@ -114,7 +115,7 @@ WEX::Logging::Log::Comment(L"S6"); VERIFY_IS_FALSE(packageDeploymentManager.IsPackageReady(packageFullName)); } - TEST_METHOD(IsPackageReady_NewerRegistered_Yes) + TEST_METHOD(IsPackageReady_PackageFullName_NewerRegistered_Yes) { AddPackage_Redder(); @@ -127,6 +128,22 @@ WEX::Logging::Log::Comment(L"S6"); RemovePackage_Redder(); } + TEST_METHOD(IsPackageReady_PackageFamilyName_InvalidParameter) + { + auto packageDeploymentManager{ winrt::Microsoft::Windows::Management::Deployment::PackageDeploymentManager::GetDefault() }; + + try + { + PCWSTR c_packageFamilyName{ L"Does.Not.Exist_1234567890abc" }; + packageDeploymentManager.IsPackageReady(c_packageFamilyName); + VERIFY_FAIL(L"Success is not expected"); + } + catch (winrt::hresult_error& e) + { + VERIFY_ARE_EQUAL(E_INVALIDARG, e.code(), WEX::Common::String().Format(L"0x%X %s", e.code(), e.message().c_str())); + } + } + TEST_METHOD(IsPackageSetReady_InvalidParameter) { WEX::Logging::Log::Comment(L"P1"); diff --git a/test/PackageManager/API/PackageDeploymentManagerTests_IsReadyOrNewerAvailable.cpp b/test/PackageManager/API/PackageDeploymentManagerTests_IsReadyOrNewerAvailable.cpp index f2e5203d88..2624a48faf 100644 --- a/test/PackageManager/API/PackageDeploymentManagerTests_IsReadyOrNewerAvailable.cpp +++ b/test/PackageManager/API/PackageDeploymentManagerTests_IsReadyOrNewerAvailable.cpp @@ -48,7 +48,7 @@ namespace Test::PackageManager::Tests return true; } - TEST_METHOD(IsPackageReadyOrNewerAvailable_PackageFullName_InvalidParameter) + TEST_METHOD(IsPackageReadyOrNewerAvailable_InvalidParameter) { if (TPMT::SkipIfFeatureNotSupported_IsPackageReadyOrNewerAvailable()) { @@ -178,8 +178,8 @@ namespace Test::PackageManager::Tests try { - PCWSTR packageFamilyName{ L"Not a valid Package Family Name" }; - packageDeploymentManager.IsPackageReadyOrNewerAvailable(packageFamilyName); + PCWSTR c_packageFamilyName{ L"Does.Not.Exist_1234567890abc" }; + packageDeploymentManager.IsPackageReadyOrNewerAvailable(c_packageFamilyName); VERIFY_FAIL(L"Success is not expected"); } catch (winrt::hresult_error& e) From e63d322e97be5cea422397671d0fbcd9df5e5221 Mon Sep 17 00:00:00 2001 From: Howard Kapustein Date: Fri, 25 Oct 2024 14:09:09 -0700 Subject: [PATCH 19/27] Expanded enablement for further test investigation --- dev/DynamicDependency/API/MddWin11.h | 4 ++++ dev/UndockedRegFreeWinRT/urfw.cpp | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/dev/DynamicDependency/API/MddWin11.h b/dev/DynamicDependency/API/MddWin11.h index 759114ac6d..97b6a7bfab 100644 --- a/dev/DynamicDependency/API/MddWin11.h +++ b/dev/DynamicDependency/API/MddWin11.h @@ -41,7 +41,11 @@ namespace MddCore::Win11 __declspec(selectany) HMODULE g_dllApisetAppmodelRuntime_1_7{}; //TODO:47775758 GetResolved2 __declspec(selectany) decltype(&::GetResolvedPackageFullNameForPackageDependency2) g_win11GetResolvedPackageFullNameForPackageDependency2{}; +#if defined(TODO_SEEME_PRODUCT_TARGET) __declspec(selectany) bool g_isSupported{ WindowsVersion::IsWindows11_24H1OrGreater() }; +#else + __declspec(selectany) bool g_isSupported{ WindowsVersion::IsWindows11_22H2OrGreater() }; +#endif constexpr PackageDependencyLifetimeKind ToLifetimeKind(MddPackageDependencyLifetimeKind lifetimeKind) { diff --git a/dev/UndockedRegFreeWinRT/urfw.cpp b/dev/UndockedRegFreeWinRT/urfw.cpp index be8f6e66a3..26b45f3a1e 100644 --- a/dev/UndockedRegFreeWinRT/urfw.cpp +++ b/dev/UndockedRegFreeWinRT/urfw.cpp @@ -415,6 +415,12 @@ HRESULT UrfwInitialize() noexcept { return S_OK; } +#elif defined(TODO_SEEME_PRODUCT_TARGET) + // Delegate to the OS' implementation on >= Windows 11 24H1 + if (WindowsVersion::IsWindows11_22H2OrGreater()) + { + return S_OK; + } #else // Delegate to the OS' implementation on >= Windows 11 24H1 if (WindowsVersion::IsWindows11_24H1OrGreater()) From b91e284d912dcfbd86c5d702e4040c55b20260fd Mon Sep 17 00:00:00 2001 From: Howard Kapustein Date: Wed, 30 Oct 2024 20:15:20 -0700 Subject: [PATCH 20/27] Fixed test to account for OS vs WinAppSDK error detection --- test/DynamicDependency/Test_Win32/TestMddBootstrap.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/DynamicDependency/Test_Win32/TestMddBootstrap.cpp b/test/DynamicDependency/Test_Win32/TestMddBootstrap.cpp index 6777d02ce9..8c7694d7ee 100644 --- a/test/DynamicDependency/Test_Win32/TestMddBootstrap.cpp +++ b/test/DynamicDependency/Test_Win32/TestMddBootstrap.cpp @@ -289,7 +289,8 @@ namespace Test::DynamicDependency const PACKAGE_VERSION c_minVersion3{}; VERIFY_ARE_EQUAL(c_minVersion3.Version, c_minVersion1.Version); VERIFY_ARE_NOT_EQUAL(c_minVersion3.Version, c_minVersion2.Version); - VERIFY_ARE_EQUAL(STATEREPOSITORY_E_DEPENDENCY_NOT_RESOLVED, MddBootstrapInitialize(c_Version_MajorMinor3, L"NoSuchShortVersionTagActuallUsedByAnyPackageAndEvenIfTherIsThePackageFamilyNameWouldBeTooLong", c_minVersion3)); + const HRESULT hr{ MddBootstrapInitialize(c_Version_MajorMinor3, L"NoSuchShortVersionTagActuallUsedByAnyPackageAndEvenIfTherIsThePackageFamilyNameWouldBeTooLong", c_minVersion3) }; + VERIFY_IS_TRUE((hr == STATEREPOSITORY_E_DEPENDENCY_NOT_RESOLVED) || (hr == E_INVALIDARG), WEX::Common::String().Format(L"HRESULT:0x%08X")); VERIFY_ARE_EQUAL(STATEREPOSITORY_E_DEPENDENCY_NOT_RESOLVED, MddBootstrapInitialize(c_Version_MajorMinor3, L"Zathras", c_minVersion3)); // Incompatible criteria. Verify Initialize+Shutdown brought us From cae1e08228859659f561e87f74205d74bfe9097b Mon Sep 17 00:00:00 2001 From: Howard Kapustein Date: Mon, 4 Nov 2024 23:00:04 -0800 Subject: [PATCH 21/27] Fixed RegisterNewerIfAvailable --- .../API/M.W.M.D.PackageDeploymentManager.cpp | 28 ++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/dev/PackageManager/API/M.W.M.D.PackageDeploymentManager.cpp b/dev/PackageManager/API/M.W.M.D.PackageDeploymentManager.cpp index 4e0b786349..03204f50ec 100644 --- a/dev/PackageManager/API/M.W.M.D.PackageDeploymentManager.cpp +++ b/dev/PackageManager/API/M.W.M.D.PackageDeploymentManager.cpp @@ -434,7 +434,17 @@ namespace winrt::Microsoft::Windows::Management::Deployment::implementation const double c_progressPercentageStartOfIsReady{ 0.01 }; packageDeploymentProgress.Progress = c_progressPercentageStartOfIsReady; progress(packageDeploymentProgress); - if (IsPackageSetReady(packageSet)) + bool isReady{}; + if (options.RegisterNewerIfAvailable()) + { + THROW_HR_IF_MSG(E_NOTIMPL, !IsPackageDeploymentFeatureSupported(winrt::Microsoft::Windows::Management::Deployment::PackageDeploymentFeature::IsPackageReadyOrNewerAvailable), "RegisterNewerIfAvailable is not supported on this system"); + isReady = (IsPackageSetReadyOrNewerAvailable(packageSet) == winrt::Microsoft::Windows::Management::Deployment::PackageReadyOrNewerAvailableStatus::Ready); + } + else + { + isReady = IsPackageSetReady(packageSet); + } + if (isReady) { co_return winrt::make(PackageDeploymentStatus::CompletedSuccess, winrt::guid{}); } @@ -1617,7 +1627,7 @@ namespace winrt::Microsoft::Windows::Management::Deployment::implementation } winrt::Windows::Foundation::IAsyncOperationWithProgress - PackageDeploymentManager::RegisterPackageByPackageFamilyNameAsync(winrt::hstring const& packageFamilyName, winrt::Microsoft::Windows::Management::Deployment::RegisterPackageOptions options) + PackageDeploymentManager::RegisterPackageByPackageFamilyNameAsync(const winrt::hstring packageFamilyName, winrt::Microsoft::Windows::Management::Deployment::RegisterPackageOptions options) { auto logTelemetry{ PackageManagementTelemetry::RegisterPackageByPackageFamilyNameAsync::Start(packageFamilyName) }; @@ -1665,7 +1675,7 @@ namespace winrt::Microsoft::Windows::Management::Deployment::implementation } winrt::Windows::Foundation::IAsyncOperationWithProgress - PackageDeploymentManager::RegisterPackageByPackageFullNameAsync(winrt::hstring const& packageFullName, winrt::Microsoft::Windows::Management::Deployment::RegisterPackageOptions options) + PackageDeploymentManager::RegisterPackageByPackageFullNameAsync(const winrt::hstring packageFullName, winrt::Microsoft::Windows::Management::Deployment::RegisterPackageOptions options) { auto logTelemetry{ PackageManagementTelemetry::RegisterPackageByPackageFullNameAsync::Start(packageFullName) }; @@ -1897,7 +1907,17 @@ namespace winrt::Microsoft::Windows::Management::Deployment::implementation errorText.clear(); activityId = winrt::guid{}; - if (IsReady(packageSetItem)) + bool isReady{}; + if (options.RegisterNewerIfAvailable()) + { + // Our caller already verified PackageDeploymentFeature::IsPackageReadyOrNewerAvailable is supported so no need to check again + isReady = (IsReadyOrNewerAvailable(packageSetItem) == winrt::Microsoft::Windows::Management::Deployment::PackageReadyOrNewerAvailableStatus::Ready); + } + else + { + isReady = IsReady(packageSetItem); + } + if (isReady) { return S_OK; } From 0a95f7a0f91b830bb41a97d8d688d096a6a05b4d Mon Sep 17 00:00:00 2001 From: Howard Kapustein Date: Mon, 4 Nov 2024 23:06:11 -0800 Subject: [PATCH 22/27] Removed 22H2 testing --- dev/DynamicDependency/API/MddWin11.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/dev/DynamicDependency/API/MddWin11.h b/dev/DynamicDependency/API/MddWin11.h index 97b6a7bfab..759114ac6d 100644 --- a/dev/DynamicDependency/API/MddWin11.h +++ b/dev/DynamicDependency/API/MddWin11.h @@ -41,11 +41,7 @@ namespace MddCore::Win11 __declspec(selectany) HMODULE g_dllApisetAppmodelRuntime_1_7{}; //TODO:47775758 GetResolved2 __declspec(selectany) decltype(&::GetResolvedPackageFullNameForPackageDependency2) g_win11GetResolvedPackageFullNameForPackageDependency2{}; -#if defined(TODO_SEEME_PRODUCT_TARGET) __declspec(selectany) bool g_isSupported{ WindowsVersion::IsWindows11_24H1OrGreater() }; -#else - __declspec(selectany) bool g_isSupported{ WindowsVersion::IsWindows11_22H2OrGreater() }; -#endif constexpr PackageDependencyLifetimeKind ToLifetimeKind(MddPackageDependencyLifetimeKind lifetimeKind) { From c09ccc35f23d5e57b3c34c457debe0f47ec3545a Mon Sep 17 00:00:00 2001 From: Howard Kapustein Date: Tue, 5 Nov 2024 11:31:10 -0800 Subject: [PATCH 23/27] Fixed h/cpp mismatch --- dev/PackageManager/API/M.W.M.D.PackageDeploymentManager.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/PackageManager/API/M.W.M.D.PackageDeploymentManager.h b/dev/PackageManager/API/M.W.M.D.PackageDeploymentManager.h index 4c8cb0f4ba..35a997a7d0 100644 --- a/dev/PackageManager/API/M.W.M.D.PackageDeploymentManager.h +++ b/dev/PackageManager/API/M.W.M.D.PackageDeploymentManager.h @@ -60,8 +60,8 @@ namespace winrt::Microsoft::Windows::Management::Deployment::implementation private: winrt::Windows::Foundation::IAsyncOperationWithProgress AddPackageByAppInstallerFileAsync(winrt::Windows::Foundation::Uri packageUri, winrt::Microsoft::Windows::Management::Deployment::AddPackageOptions options); - winrt::Windows::Foundation::IAsyncOperationWithProgress RegisterPackageByPackageFamilyNameAsync(winrt::hstring const& packageFamilyName, winrt::Microsoft::Windows::Management::Deployment::RegisterPackageOptions options); - winrt::Windows::Foundation::IAsyncOperationWithProgress RegisterPackageByPackageFullNameAsync(winrt::hstring const& packageFullName, winrt::Microsoft::Windows::Management::Deployment::RegisterPackageOptions options); + winrt::Windows::Foundation::IAsyncOperationWithProgress RegisterPackageByPackageFamilyNameAsync(const winrt::hstring packageFamilyName, winrt::Microsoft::Windows::Management::Deployment::RegisterPackageOptions options); + winrt::Windows::Foundation::IAsyncOperationWithProgress RegisterPackageByPackageFullNameAsync(const winrt::hstring packageFullName, winrt::Microsoft::Windows::Management::Deployment::RegisterPackageOptions options); private: winrt::hstring GetUupProductIdIfMsUup(winrt::Windows::Foundation::Uri const& uri) const; From 912119eca123e1292b037d03ee808dd5af29b322 Mon Sep 17 00:00:00 2001 From: Howard Kapustein Date: Mon, 11 Nov 2024 21:18:51 -0800 Subject: [PATCH 24/27] Removed non-existent GUID/reference (bad merge?) --- WindowsAppRuntime.sln | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/WindowsAppRuntime.sln b/WindowsAppRuntime.sln index 45d655d927..266ae49a34 100644 --- a/WindowsAppRuntime.sln +++ b/WindowsAppRuntime.sln @@ -15,9 +15,6 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{8630F7AA-2969-4DC9-8700-9B468C1DC21D}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WindowsAppRuntime_DLL", "dev\WindowsAppRuntime_DLL\WindowsAppRuntime_DLL.vcxproj", "{B73AD907-6164-4294-88FB-F3C9C10DA1F1}" - ProjectSection(ProjectDependencies) = postProject - {FD0CC14A-ED4B-4936-B68B-F31E58372E32} = {FD0CC14A-ED4B-4936-B68B-F31E58372E32} - EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AppLifecycle", "AppLifecycle", "{3DE93B2F-F887-437D-B512-6B1024ABA290}" EndProject @@ -72,7 +69,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Microsoft.WindowsAppRuntime ProjectSection(ProjectDependencies) = postProject {4410D374-A90C-4ADF-8B15-AA2AAE2636BF} = {4410D374-A90C-4ADF-8B15-AA2AAE2636BF} {BC5E5A3E-E733-4388-8B00-F8495DA7C778} = {BC5E5A3E-E733-4388-8B00-F8495DA7C778} - {FD0CC14A-ED4B-4936-B68B-F31E58372E32} = {FD0CC14A-ED4B-4936-B68B-F31E58372E32} EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DynamicDependencyDataStore", "DynamicDependencyDataStore", "{441A3BB0-7FD2-4902-AEDB-A1C57B528C77}" @@ -176,9 +172,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PushNotificationTests", "te EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PushNotificationsLongRunningTask", "dev\PushNotifications\PushNotificationsLongRunningTask\PushNotificationsLongRunningTask.vcxproj", "{1307DD1B-BBE8-4CD0-B1A0-0DB6D61EEAA0}" - ProjectSection(ProjectDependencies) = postProject - {FD0CC14A-ED4B-4936-B68B-F31E58372E32} = {FD0CC14A-ED4B-4936-B68B-F31E58372E32} - EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PushNotificationsLongRunningTask.ProxyStub", "dev\PushNotifications\PushNotificationsLongRunningTask.ProxyStub\PushNotificationsLongRunningTask.ProxyStub.vcxproj", "{BF3FCED0-CADB-490A-93A7-4D90E1F45AB0}" EndProject @@ -192,9 +185,6 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PowerNotifications", "dev\PowerNotifications\PowerNotifications.vcxitems", "{B75C1B22-553C-40E4-B38E-6AB4D01FDB9D}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PowerNotifications", "test\PowerNotifications\PowerNotifications.vcxproj", "{CBD95746-61CE-4F31-B6CC-C5ABF1766180}" - ProjectSection(ProjectDependencies) = postProject - {FD0CC14A-ED4B-4936-B68B-F31E58372E32} = {FD0CC14A-ED4B-4936-B68B-F31E58372E32} - EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Projections", "Projections", "{6CD616F9-173E-42CD-89A1-8FDFD86283AA}" EndProject @@ -216,9 +206,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Windows.AppLifecy EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WindowsAppRuntime.Test.Singleton.Msix", "test\DynamicDependency\data\WindowsAppRuntime.Test.Singleton.Msix\WindowsAppRuntime.Test.Singleton.Msix.vcxproj", "{8F2C21F1-47AB-428C-A110-EE33FD7D9493}" - ProjectSection(ProjectDependencies) = postProject - {FD0CC14A-ED4B-4936-B68B-F31E58372E32} = {FD0CC14A-ED4B-4936-B68B-F31E58372E32} - EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DeploymentTests", "test\Deployment\API\DeploymentTests.vcxproj", "{E5659A29-FE68-417B-9BC5-613073DD54DF}" ProjectSection(ProjectDependencies) = postProject @@ -232,7 +219,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EnvironmentManagerTests", " {A7391725-4EF5-438F-8DE1-645423E46955} = {A7391725-4EF5-438F-8DE1-645423E46955} {B71E818A-882E-456A-87E5-4DE4A6602B99} = {B71E818A-882E-456A-87E5-4DE4A6602B99} {B73AD907-6164-4294-88FB-F3C9C10DA1F1} = {B73AD907-6164-4294-88FB-F3C9C10DA1F1} - {FD0CC14A-ED4B-4936-B68B-F31E58372E32} = {FD0CC14A-ED4B-4936-B68B-F31E58372E32} EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Bootstrap", "Bootstrap", "{8746775A-899E-49DD-A46C-2FE0899FFFEA}" @@ -365,9 +351,6 @@ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Test_BootstrapAutoInitialize_CS_Options_None", "test\DynamicDependency\Test_BootstrapAutoInitialize\CS\Test_BootstrapAutoInitialize_CS_Options_None\Test_BootstrapAutoInitialize_CS_Options_None.csproj", "{4A74BBED-3B20-44A7-B6FF-3373160DE741}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AppNotificationTests", "test\AppNotificationTests\AppNotificationTests.vcxproj", "{1C9477D2-7330-4992-B06C-F7E2193CF379}" - ProjectSection(ProjectDependencies) = postProject - {FD0CC14A-ED4B-4936-B68B-F31E58372E32} = {FD0CC14A-ED4B-4936-B68B-F31E58372E32} - EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DeploymentAgent", "dev\DeploymentAgent\DeploymentAgent.vcxproj", "{4410D374-A90C-4ADF-8B15-AA2AAE2636BF}" ProjectSection(ProjectDependencies) = postProject @@ -377,9 +360,6 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AppNotificationBuilder", "dev\AppNotifications\AppNotificationBuilder\AppNotificationBuilder.vcxitems", "{E49329F3-5196-4BBA-B5C4-E11CE7EFB07A}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AppNotificationBuilderTests", "test\AppNotificationBuilderTests\AppNotificationBuilderTests.vcxproj", "{131DE0C4-AA1E-4649-B5BC-7B43508FA93A}" - ProjectSection(ProjectDependencies) = postProject - {FD0CC14A-ED4B-4936-B68B-F31E58372E32} = {FD0CC14A-ED4B-4936-B68B-F31E58372E32} - EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Windows.Security.AccessControl.Projection", "dev\Projections\CS\Microsoft.Windows.Security.AccessControl.Projection\Microsoft.Windows.Security.AccessControl.Projection.csproj", "{E6D59245-696F-4D13-ACF6-7ECE6E653367}" ProjectSection(ProjectDependencies) = postProject @@ -452,7 +432,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LRPTests", "test\LRPTests\L ProjectSection(ProjectDependencies) = postProject {B73AD907-6164-4294-88FB-F3C9C10DA1F1} = {B73AD907-6164-4294-88FB-F3C9C10DA1F1} {F76B776E-86F5-48C5-8FC7-D2795ECC9746} = {F76B776E-86F5-48C5-8FC7-D2795ECC9746} - {FD0CC14A-ED4B-4936-B68B-F31E58372E32} = {FD0CC14A-ED4B-4936-B68B-F31E58372E32} EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "VersionInfo", "VersionInfo", "{2A2D1131-273C-4E17-BCD3-8812170A4B95}" @@ -491,7 +470,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PackageManagerTests", "test {D0A1DFB8-8CEE-4CFC-B57B-B7C574B411C2} = {D0A1DFB8-8CEE-4CFC-B57B-B7C574B411C2} {F2946790-DAF7-4DFF-A754-BA471A12E494} = {F2946790-DAF7-4DFF-A754-BA471A12E494} {FBAE1876-C50A-4EFC-A686-3008B6438731} = {FBAE1876-C50A-4EFC-A686-3008B6438731} - {FD0CC14A-ED4B-4936-B68B-F31E58372E32} = {FD0CC14A-ED4B-4936-B68B-F31E58372E32} EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "data", "data", "{6213B1A3-E854-498F-AAFA-4CFC1E71023E}" From 744554145abbfe96a58b028009d4ea74a42a475e Mon Sep 17 00:00:00 2001 From: Howard Kapustein Date: Thu, 21 Nov 2024 10:04:46 -0800 Subject: [PATCH 25/27] Fixed test bug not handling all behavior coming out of OS API --- .../Test_Win32/Test_GetCurrentPackageInfo.cpp | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/test/DynamicDependency/Test_Win32/Test_GetCurrentPackageInfo.cpp b/test/DynamicDependency/Test_Win32/Test_GetCurrentPackageInfo.cpp index 943d88ff6f..2f643a33f5 100644 --- a/test/DynamicDependency/Test_Win32/Test_GetCurrentPackageInfo.cpp +++ b/test/DynamicDependency/Test_Win32/Test_GetCurrentPackageInfo.cpp @@ -153,7 +153,7 @@ namespace Test::DynamicDependency VerifyGetCurrentPackageInfo123(PACKAGE_FILTER_HEAD | PACKAGE_FILTER_DIRECT | PACKAGE_FILTER_IS_IN_RELATED_SET | PACKAGE_FILTER_STATIC | PACKAGE_FILTER_DYNAMIC, HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), 1, 1, HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), 1, 1); // Verify GetCurrentPackageInfo for GenerationId - VerifyGenerationId(1, S_OK); + VerifyGenerationId(1); // -- Remove MddRemovePackageDependency(packageDependencyContext_FrameworkMathAdd); @@ -231,8 +231,7 @@ namespace Test::DynamicDependency } void VerifyGenerationId( - const UINT32 expectedGenerationId, - const HRESULT expectedHR = HRESULT_FROM_WIN32(APPMODEL_ERROR_NO_PACKAGE)) + const UINT32 expectedGenerationId) { if (!IsGetCurrentPackageInfo3Supported()) { @@ -243,12 +242,21 @@ namespace Test::DynamicDependency UINT32 bufferSize{ static_cast(sizeof(generationId)) }; const auto hr{ m_getCurrentPackageInfo3(0, PackageInfoType_PackageInfoGeneration, &bufferSize, &generationId, nullptr) }; auto message{ wil::str_printf(L"Get...GenerationId: hr:0x%X id:%u\n" - L" Expected: hr:0x%X id:%u", - hr, generationId, expectedHR, expectedGenerationId) }; + L" Expected: hr:0x%X or 0x0 id:%u", + hr, generationId, + HRESULT_FROM_WIN32(APPMODEL_ERROR_NO_PACKAGE), expectedGenerationId) }; VERIFY_IS_TRUE(true, message.get()); OutputDebugStringW(message.get()); - VERIFY_ARE_EQUAL(expectedHR, hr); VERIFY_ARE_EQUAL(expectedGenerationId, generationId); + if (expectedGenerationId == 0) + { + VERIFY_IS_TRUE((hr == S_OK) || (hr == HRESULT_FROM_WIN32(APPMODEL_ERROR_NO_PACKAGE)), + WEX::Common::String().Format(L"hr: 0x%08X expected: 0x0 or 0x%08X", hr, HRESULT_FROM_WIN32(APPMODEL_ERROR_NO_PACKAGE))); + } + else + { + VERIFY_ARE_EQUAL(S_OK, hr); + } const auto actualGenerationId{ MddGetGenerationId() }; VERIFY_ARE_EQUAL(expectedGenerationId, actualGenerationId); From 46532582e1fd11e8b4b340c04b8c959b10eb392b Mon Sep 17 00:00:00 2001 From: Howard Kapustein Date: Thu, 21 Nov 2024 11:03:40 -0800 Subject: [PATCH 26/27] Fixed tests --- .../Test_Win32/Test_GetCurrentPackageInfo.cpp | 2 + .../Test_Win32/Test_Win32.cpp | 37 ++++++++++++++++++- .../DynamicDependency/Test_Win32/Test_Win32.h | 10 +++++ .../Test_Win32/Test_Win32_Add_Rank_A0_B10.cpp | 6 ++- .../Test_Win32_Add_Rank_B-10_A0.cpp | 6 ++- .../Test_Win32_Add_Rank_B0prepend_A0.cpp | 6 ++- ...Win32_Create_Add_Architectures_Current.cpp | 6 ++- ...in32_Create_Add_Architectures_Explicit.cpp | 8 ++-- ...Create_DoNotVerifyDependencyResolution.cpp | 6 ++- ...ifecycle_FilePathLifetime_Frameworks_2.cpp | 7 +++- ...Lifecycle_ProcessLifetime_Frameworks_2.cpp | 6 ++- ...ifecycle_RegistryLifetime_Frameworks_2.cpp | 7 +++- .../Test_Win32/Test_Win32_WinRTReentrancy.cpp | 6 ++- 13 files changed, 90 insertions(+), 23 deletions(-) diff --git a/test/DynamicDependency/Test_Win32/Test_GetCurrentPackageInfo.cpp b/test/DynamicDependency/Test_Win32/Test_GetCurrentPackageInfo.cpp index 2f643a33f5..55e56cf84b 100644 --- a/test/DynamicDependency/Test_Win32/Test_GetCurrentPackageInfo.cpp +++ b/test/DynamicDependency/Test_Win32/Test_GetCurrentPackageInfo.cpp @@ -156,9 +156,11 @@ namespace Test::DynamicDependency VerifyGenerationId(1); // -- Remove + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"MddRemovePackageDependency(%p)...", packageDependencyContext_FrameworkMathAdd)); MddRemovePackageDependency(packageDependencyContext_FrameworkMathAdd); // -- Delete + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"MddDeletePackageDependency(%s)...", packageDependencyId_FrameworkMathAdd.get())); MddDeletePackageDependency(packageDependencyId_FrameworkMathAdd.get()); } diff --git a/test/DynamicDependency/Test_Win32/Test_Win32.cpp b/test/DynamicDependency/Test_Win32/Test_Win32.cpp index 8ac78a2e7b..5e9f9c90b5 100644 --- a/test/DynamicDependency/Test_Win32/Test_Win32.cpp +++ b/test/DynamicDependency/Test_Win32/Test_Win32.cpp @@ -95,6 +95,7 @@ void Test::DynamicDependency::Test_Win32::Create_Delete() wil::unique_process_heap_string packageDependencyId; VERIFY_ARE_EQUAL(S_OK, MddTryCreatePackageDependency(nullptr, packageFamilyName, minVersion, architectureFilter, lifetimeKind, lifetimeArtifact, options, &packageDependencyId)); + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"MddDeletePackageDependency(%s)...", packageDependencyId.get())); MddDeletePackageDependency(packageDependencyId.get()); VerifyPackageGraphRevisionId(1); @@ -136,7 +137,7 @@ void Test::DynamicDependency::Test_Win32::FullLifecycle_ProcessLifetime_Framewor VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); VerifyPackageNotInPackageGraph(expectedPackageFullName_FrameworkMathAdd, S_OK); VerifyPathEnvironmentVariable(packagePath_WindowsAppRuntimeFramework, pathEnvironmentVariable.c_str()); - VerifyPackageDependency(packageDependencyId_FrameworkMathAdd.get(), S_OK, expectedPackageFullName_FrameworkMathAdd); + VerifyPackageDependency_Win11NotResolved(packageDependencyId_FrameworkMathAdd.get(), S_OK, expectedPackageFullName_FrameworkMathAdd); VerifyPackageGraphRevisionId(1); // -- Add @@ -180,16 +181,18 @@ void Test::DynamicDependency::Test_Win32::FullLifecycle_ProcessLifetime_Framewor // -- Remove + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"MddRemovePackageDependency(%p)...", packageDependencyContext_FrameworkMathAdd)); MddRemovePackageDependency(packageDependencyContext_FrameworkMathAdd); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); VerifyPackageNotInPackageGraph(expectedPackageFullName_FrameworkMathAdd, S_OK); VerifyPathEnvironmentVariable(packagePath_WindowsAppRuntimeFramework, pathEnvironmentVariable.c_str()); - VerifyPackageDependency(packageDependencyId_FrameworkMathAdd.get(), S_OK, expectedPackageFullName_FrameworkMathAdd); + VerifyPackageDependency_Win11NotResolved(packageDependencyId_FrameworkMathAdd.get(), S_OK, expectedPackageFullName_FrameworkMathAdd); VerifyPackageGraphRevisionId(3); // -- Delete + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"MddDeletePackageDependency(%s)...", packageDependencyId_FrameworkMathAdd.get())); MddDeletePackageDependency(packageDependencyId_FrameworkMathAdd.get()); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); @@ -229,7 +232,9 @@ void Test::DynamicDependency::Test_Win32::GetIdForPackageDependencyContext() VERIFY_ARE_EQUAL(S_OK, MddGetIdForPackageDependencyContext(packageDependencyContext_FrameworkMathAdd, wil::out_param(id))); VERIFY_ARE_EQUAL(std::wstring(packageDependencyId_FrameworkMathAdd.get()), std::wstring(id.get())); + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"MddRemovePackageDependency(%p)...", packageDependencyContext_FrameworkMathAdd)); MddRemovePackageDependency(packageDependencyContext_FrameworkMathAdd); + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"MddDeletePackageDependency(%s)...", packageDependencyId_FrameworkMathAdd.get())); MddDeletePackageDependency(packageDependencyId_FrameworkMathAdd.get()); } @@ -286,6 +291,34 @@ void Test::DynamicDependency::Test_Win32::VerifyPackageDependency( VerifyPackageDependency(packageDependencyId, expectedHR, expectedPackageFullName.c_str()); } +void Test::DynamicDependency::Test_Win32::VerifyPackageDependency_Win11NotResolved( + PCWSTR packageDependencyId, + const HRESULT expectedHR, + PCWSTR expectedPackageFullName) +{ + // Expected PackageFullName will be NULL if it's not resolved yet + // This can occur in the OS DynamicDependency API depending on order + // of operations and options. This differs from WinAppSDK DynamicDependency + // API in some cases. Tests use this method instad of VerifyPackageDependency() + // to handle this "expect NULL if we're using the OS API". + if (MddCore::Win11::IsSupported()) + { + VerifyPackageDependency(packageDependencyId, expectedHR, nullptr); + } + else + { + VerifyPackageDependency(packageDependencyId, expectedHR, expectedPackageFullName); + } +} + +void Test::DynamicDependency::Test_Win32::VerifyPackageDependency_Win11NotResolved( + PCWSTR packageDependencyId, + const HRESULT expectedHR, + const std::wstring& expectedPackageFullName) +{ + VerifyPackageDependency_Win11NotResolved(packageDependencyId, expectedHR, expectedPackageFullName.c_str()); +} + void Test::DynamicDependency::Test_Win32::VerifyPathEnvironmentVariable(PCWSTR path) { // N/A when DynamicDependency delegates to the Win11 OS API diff --git a/test/DynamicDependency/Test_Win32/Test_Win32.h b/test/DynamicDependency/Test_Win32/Test_Win32.h index 434ea31932..6071aa9d8c 100644 --- a/test/DynamicDependency/Test_Win32/Test_Win32.h +++ b/test/DynamicDependency/Test_Win32/Test_Win32.h @@ -57,6 +57,16 @@ namespace Test::DynamicDependency const HRESULT expectedHR, const std::wstring& expectedPackageFullName); + static void VerifyPackageDependency_Win11NotResolved( + PCWSTR packageDependencyId, + const HRESULT expectedHR, + PCWSTR expectedPackageFullName = nullptr); + + static void VerifyPackageDependency_Win11NotResolved( + PCWSTR packageDependencyId, + const HRESULT expectedHR, + const std::wstring& expectedPackageFullName); + static void VerifyPathEnvironmentVariable(PCWSTR path); static void VerifyPathEnvironmentVariable(PCWSTR path1, PCWSTR path); diff --git a/test/DynamicDependency/Test_Win32/Test_Win32_Add_Rank_A0_B10.cpp b/test/DynamicDependency/Test_Win32/Test_Win32_Add_Rank_A0_B10.cpp index 863b58a833..ad477ba5b3 100644 --- a/test/DynamicDependency/Test_Win32/Test_Win32_Add_Rank_A0_B10.cpp +++ b/test/DynamicDependency/Test_Win32/Test_Win32_Add_Rank_A0_B10.cpp @@ -33,7 +33,7 @@ void Test::DynamicDependency::Test_Win32::Add_Rank_A0_B10() VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); VerifyPackageNotInPackageGraph(expectedPackageFullName_FrameworkMathAdd, S_OK); VerifyPathEnvironmentVariable(packagePath_WindowsAppRuntimeFramework, pathEnvironmentVariable.c_str()); - VerifyPackageDependency(packageDependencyId_FrameworkMathAdd.get(), S_OK, expectedPackageFullName_FrameworkMathAdd); + VerifyPackageDependency_Win11NotResolved(packageDependencyId_FrameworkMathAdd.get(), S_OK, expectedPackageFullName_FrameworkMathAdd); // -- Add @@ -72,15 +72,17 @@ void Test::DynamicDependency::Test_Win32::Add_Rank_A0_B10() // -- Remove + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"MddRemovePackageDependency(%p)...", packageDependencyContext_FrameworkMathAdd)); MddRemovePackageDependency(packageDependencyContext_FrameworkMathAdd); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); VerifyPackageNotInPackageGraph(expectedPackageFullName_FrameworkMathAdd, S_OK); VerifyPathEnvironmentVariable(packagePath_WindowsAppRuntimeFramework, pathEnvironmentVariable.c_str()); - VerifyPackageDependency(packageDependencyId_FrameworkMathAdd.get(), S_OK, expectedPackageFullName_FrameworkMathAdd); + VerifyPackageDependency_Win11NotResolved(packageDependencyId_FrameworkMathAdd.get(), S_OK, expectedPackageFullName_FrameworkMathAdd); // -- Delete + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"MddDeletePackageDependency(%s)...", packageDependencyId_FrameworkMathAdd.get())); MddDeletePackageDependency(packageDependencyId_FrameworkMathAdd.get()); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); diff --git a/test/DynamicDependency/Test_Win32/Test_Win32_Add_Rank_B-10_A0.cpp b/test/DynamicDependency/Test_Win32/Test_Win32_Add_Rank_B-10_A0.cpp index 24aaa84fdf..59de7356bf 100644 --- a/test/DynamicDependency/Test_Win32/Test_Win32_Add_Rank_B-10_A0.cpp +++ b/test/DynamicDependency/Test_Win32/Test_Win32_Add_Rank_B-10_A0.cpp @@ -33,7 +33,7 @@ void Test::DynamicDependency::Test_Win32::Add_Rank_Bneg10_A0() VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); VerifyPackageNotInPackageGraph(expectedPackageFullName_FrameworkMathAdd, S_OK); VerifyPathEnvironmentVariable(packagePath_WindowsAppRuntimeFramework, pathEnvironmentVariable.c_str()); - VerifyPackageDependency(packageDependencyId_FrameworkMathAdd.get(), S_OK, expectedPackageFullName_FrameworkMathAdd); + VerifyPackageDependency_Win11NotResolved(packageDependencyId_FrameworkMathAdd.get(), S_OK, expectedPackageFullName_FrameworkMathAdd); // -- Add @@ -72,15 +72,17 @@ void Test::DynamicDependency::Test_Win32::Add_Rank_Bneg10_A0() // -- Remove + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"MddRemovePackageDependency(%p)...", packageDependencyContext_FrameworkMathAdd)); MddRemovePackageDependency(packageDependencyContext_FrameworkMathAdd); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); VerifyPackageNotInPackageGraph(expectedPackageFullName_FrameworkMathAdd, S_OK); VerifyPathEnvironmentVariable(packagePath_WindowsAppRuntimeFramework, pathEnvironmentVariable.c_str()); - VerifyPackageDependency(packageDependencyId_FrameworkMathAdd.get(), S_OK, expectedPackageFullName_FrameworkMathAdd); + VerifyPackageDependency_Win11NotResolved(packageDependencyId_FrameworkMathAdd.get(), S_OK, expectedPackageFullName_FrameworkMathAdd); // -- Delete + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"MddDeletePackageDependency(%s)...", packageDependencyId_FrameworkMathAdd.get())); MddDeletePackageDependency(packageDependencyId_FrameworkMathAdd.get()); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); diff --git a/test/DynamicDependency/Test_Win32/Test_Win32_Add_Rank_B0prepend_A0.cpp b/test/DynamicDependency/Test_Win32/Test_Win32_Add_Rank_B0prepend_A0.cpp index 101901f3d5..38aaa0eedc 100644 --- a/test/DynamicDependency/Test_Win32/Test_Win32_Add_Rank_B0prepend_A0.cpp +++ b/test/DynamicDependency/Test_Win32/Test_Win32_Add_Rank_B0prepend_A0.cpp @@ -33,7 +33,7 @@ void Test::DynamicDependency::Test_Win32::Add_Rank_B0prepend_A0() VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); VerifyPackageNotInPackageGraph(expectedPackageFullName_FrameworkMathAdd, S_OK); VerifyPathEnvironmentVariable(packagePath_WindowsAppRuntimeFramework, pathEnvironmentVariable.c_str()); - VerifyPackageDependency(packageDependencyId_FrameworkMathAdd.get(), S_OK, expectedPackageFullName_FrameworkMathAdd); + VerifyPackageDependency_Win11NotResolved(packageDependencyId_FrameworkMathAdd.get(), S_OK, expectedPackageFullName_FrameworkMathAdd); // -- Add @@ -72,15 +72,17 @@ void Test::DynamicDependency::Test_Win32::Add_Rank_B0prepend_A0() // -- Remove + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"MddRemovePackageDependency(%p)...", packageDependencyContext_FrameworkMathAdd)); MddRemovePackageDependency(packageDependencyContext_FrameworkMathAdd); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); VerifyPackageNotInPackageGraph(expectedPackageFullName_FrameworkMathAdd, S_OK); VerifyPathEnvironmentVariable(packagePath_WindowsAppRuntimeFramework, pathEnvironmentVariable.c_str()); - VerifyPackageDependency(packageDependencyId_FrameworkMathAdd.get(), S_OK, expectedPackageFullName_FrameworkMathAdd); + VerifyPackageDependency_Win11NotResolved(packageDependencyId_FrameworkMathAdd.get(), S_OK, expectedPackageFullName_FrameworkMathAdd); // -- Delete + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"MddDeletePackageDependency(%s)...", packageDependencyId_FrameworkMathAdd.get())); MddDeletePackageDependency(packageDependencyId_FrameworkMathAdd.get()); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); diff --git a/test/DynamicDependency/Test_Win32/Test_Win32_Create_Add_Architectures_Current.cpp b/test/DynamicDependency/Test_Win32/Test_Win32_Create_Add_Architectures_Current.cpp index 8e1c89777e..136b219130 100644 --- a/test/DynamicDependency/Test_Win32/Test_Win32_Create_Add_Architectures_Current.cpp +++ b/test/DynamicDependency/Test_Win32/Test_Win32_Create_Add_Architectures_Current.cpp @@ -37,7 +37,7 @@ void Test::DynamicDependency::Test_Win32::Create_Add_Architectures_Current() VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); VerifyPackageNotInPackageGraph(expectedPackageFullName_FrameworkMathAdd, S_OK); VerifyPathEnvironmentVariable(packagePath_WindowsAppRuntimeFramework, pathEnvironmentVariable.c_str()); - VerifyPackageDependency(packageDependencyId_FrameworkMathAdd.get(), S_OK, expectedPackageFullName_FrameworkMathAdd); + VerifyPackageDependency_Win11NotResolved(packageDependencyId_FrameworkMathAdd.get(), S_OK, expectedPackageFullName_FrameworkMathAdd); // -- Add @@ -75,15 +75,17 @@ void Test::DynamicDependency::Test_Win32::Create_Add_Architectures_Current() // -- Remove + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"MddRemovePackageDependency(%p)...", packageDependencyContext_FrameworkMathAdd)); MddRemovePackageDependency(packageDependencyContext_FrameworkMathAdd); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); VerifyPackageNotInPackageGraph(expectedPackageFullName_FrameworkMathAdd, S_OK); VerifyPathEnvironmentVariable(packagePath_WindowsAppRuntimeFramework, pathEnvironmentVariable.c_str()); - VerifyPackageDependency(packageDependencyId_FrameworkMathAdd.get(), S_OK, expectedPackageFullName_FrameworkMathAdd); + VerifyPackageDependency_Win11NotResolved(packageDependencyId_FrameworkMathAdd.get(), S_OK, expectedPackageFullName_FrameworkMathAdd); // -- Delete + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"MddDeletePackageDependency(%s)...", packageDependencyId_FrameworkMathAdd.get())); MddDeletePackageDependency(packageDependencyId_FrameworkMathAdd.get()); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); diff --git a/test/DynamicDependency/Test_Win32/Test_Win32_Create_Add_Architectures_Explicit.cpp b/test/DynamicDependency/Test_Win32/Test_Win32_Create_Add_Architectures_Explicit.cpp index a36ed6674d..c21bf468b7 100644 --- a/test/DynamicDependency/Test_Win32/Test_Win32_Create_Add_Architectures_Explicit.cpp +++ b/test/DynamicDependency/Test_Win32/Test_Win32_Create_Add_Architectures_Explicit.cpp @@ -28,7 +28,7 @@ void Test::DynamicDependency::Test_Win32::Create_Add_Architectures_Explicit() // -- TryCreate - // We include the Neutral arhitecture as that's our test package's defined architecture. + // We include the Neutral architecture as that's our test package's defined architecture. // That's OK, what matters is we're not using MddPackageDependencyProcessorArchitectures::None // so we exercise the not-default-whatever-deemed-appropriate architecture codepath. auto architectures{ @@ -43,7 +43,7 @@ void Test::DynamicDependency::Test_Win32::Create_Add_Architectures_Explicit() VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); VerifyPackageNotInPackageGraph(expectedPackageFullName_FrameworkMathAdd, S_OK); VerifyPathEnvironmentVariable(packagePath_WindowsAppRuntimeFramework, pathEnvironmentVariable.c_str()); - VerifyPackageDependency(packageDependencyId_FrameworkMathAdd.get(), S_OK, expectedPackageFullName_FrameworkMathAdd); + VerifyPackageDependency_Win11NotResolved(packageDependencyId_FrameworkMathAdd.get(), S_OK, expectedPackageFullName_FrameworkMathAdd); // -- Add @@ -81,15 +81,17 @@ void Test::DynamicDependency::Test_Win32::Create_Add_Architectures_Explicit() // -- Remove + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"MddRemovePackageDependency(%p)...", packageDependencyContext_FrameworkMathAdd)); MddRemovePackageDependency(packageDependencyContext_FrameworkMathAdd); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); VerifyPackageNotInPackageGraph(expectedPackageFullName_FrameworkMathAdd, S_OK); VerifyPathEnvironmentVariable(packagePath_WindowsAppRuntimeFramework, pathEnvironmentVariable.c_str()); - VerifyPackageDependency(packageDependencyId_FrameworkMathAdd.get(), S_OK, expectedPackageFullName_FrameworkMathAdd); + VerifyPackageDependency_Win11NotResolved(packageDependencyId_FrameworkMathAdd.get(), S_OK, expectedPackageFullName_FrameworkMathAdd); // -- Delete + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"MddDeletePackageDependency(%s)...", packageDependencyId_FrameworkMathAdd.get())); MddDeletePackageDependency(packageDependencyId_FrameworkMathAdd.get()); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); diff --git a/test/DynamicDependency/Test_Win32/Test_Win32_Create_DoNotVerifyDependencyResolution.cpp b/test/DynamicDependency/Test_Win32/Test_Win32_Create_DoNotVerifyDependencyResolution.cpp index fe98d6413e..cdcf4df0ea 100644 --- a/test/DynamicDependency/Test_Win32/Test_Win32_Create_DoNotVerifyDependencyResolution.cpp +++ b/test/DynamicDependency/Test_Win32/Test_Win32_Create_DoNotVerifyDependencyResolution.cpp @@ -38,7 +38,7 @@ void Test::DynamicDependency::Test_Win32::Create_DoNotVerifyDependencyResolution VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); VerifyPackageNotInPackageGraph(expectedPackageFullName_FrameworkMathAdd, S_OK); VerifyPathEnvironmentVariable(packagePath_WindowsAppRuntimeFramework, pathEnvironmentVariable.c_str()); - VerifyPackageDependency(packageDependencyId_FrameworkMathAdd.get(), S_OK, nullptr); + VerifyPackageDependency_Win11NotResolved(packageDependencyId_FrameworkMathAdd.get(), S_OK, nullptr); TP::AddPackage_FrameworkMathAdd(); @@ -78,15 +78,17 @@ void Test::DynamicDependency::Test_Win32::Create_DoNotVerifyDependencyResolution // -- Remove + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"MddRemovePackageDependency(%p)...", packageDependencyContext_FrameworkMathAdd)); MddRemovePackageDependency(packageDependencyContext_FrameworkMathAdd); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); VerifyPackageNotInPackageGraph(expectedPackageFullName_FrameworkMathAdd, S_OK); VerifyPathEnvironmentVariable(packagePath_WindowsAppRuntimeFramework, pathEnvironmentVariable.c_str()); - VerifyPackageDependency(packageDependencyId_FrameworkMathAdd.get(), S_OK, expectedPackageFullName_FrameworkMathAdd); + VerifyPackageDependency_Win11NotResolved(packageDependencyId_FrameworkMathAdd.get(), S_OK, expectedPackageFullName_FrameworkMathAdd); // -- Delete + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"MddDeletePackageDependency(%s)...", packageDependencyId_FrameworkMathAdd.get())); MddDeletePackageDependency(packageDependencyId_FrameworkMathAdd.get()); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); diff --git a/test/DynamicDependency/Test_Win32/Test_Win32_FullLifecycle_FilePathLifetime_Frameworks_2.cpp b/test/DynamicDependency/Test_Win32/Test_Win32_FullLifecycle_FilePathLifetime_Frameworks_2.cpp index 542f5fe029..06a1493385 100644 --- a/test/DynamicDependency/Test_Win32/Test_Win32_FullLifecycle_FilePathLifetime_Frameworks_2.cpp +++ b/test/DynamicDependency/Test_Win32/Test_Win32_FullLifecycle_FilePathLifetime_Frameworks_2.cpp @@ -38,7 +38,7 @@ void Test::DynamicDependency::Test_Win32::FullLifecycle_FilePathLifetime_Framewo VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); VerifyPackageNotInPackageGraph(expectedPackageFullName_FrameworkMathAdd, S_OK); VerifyPathEnvironmentVariable(packagePath_WindowsAppRuntimeFramework, pathEnvironmentVariable.c_str()); - VerifyPackageDependency(packageDependencyId_FrameworkMathAdd.get(), S_OK, expectedPackageFullName_FrameworkMathAdd); + VerifyPackageDependency_Win11NotResolved(packageDependencyId_FrameworkMathAdd.get(), S_OK, expectedPackageFullName_FrameworkMathAdd); // -- Add @@ -70,6 +70,7 @@ void Test::DynamicDependency::Test_Win32::FullLifecycle_FilePathLifetime_Framewo VerifyPackageDependency(packageDependencyId_FrameworkMathAdd.get(), S_OK, expectedPackageFullName_FrameworkMathAdd); // Remove our 2nd instance. PackageGraph = [ Fwk, MathAdd ] + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"MddRemovePackageDependency(%p)...", context)); MddRemovePackageDependency(context); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); VerifyPackageInPackageGraph(expectedPackageFullName_FrameworkMathAdd, S_OK); @@ -98,15 +99,17 @@ void Test::DynamicDependency::Test_Win32::FullLifecycle_FilePathLifetime_Framewo // -- Remove + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"MddRemovePackageDependency(%p)...", packageDependencyContext_FrameworkMathAdd)); MddRemovePackageDependency(packageDependencyContext_FrameworkMathAdd); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); VerifyPackageNotInPackageGraph(expectedPackageFullName_FrameworkMathAdd, S_OK); VerifyPathEnvironmentVariable(packagePath_WindowsAppRuntimeFramework, pathEnvironmentVariable.c_str()); - VerifyPackageDependency(packageDependencyId_FrameworkMathAdd.get(), S_OK, expectedPackageFullName_FrameworkMathAdd); + VerifyPackageDependency_Win11NotResolved(packageDependencyId_FrameworkMathAdd.get(), S_OK, expectedPackageFullName_FrameworkMathAdd); // -- Delete + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"MddDeletePackageDependency(%s)...", packageDependencyId_FrameworkMathAdd.get())); MddDeletePackageDependency(packageDependencyId_FrameworkMathAdd.get()); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); diff --git a/test/DynamicDependency/Test_Win32/Test_Win32_FullLifecycle_ProcessLifetime_Frameworks_2.cpp b/test/DynamicDependency/Test_Win32/Test_Win32_FullLifecycle_ProcessLifetime_Frameworks_2.cpp index 1a12aed0ad..f37645e5c7 100644 --- a/test/DynamicDependency/Test_Win32/Test_Win32_FullLifecycle_ProcessLifetime_Frameworks_2.cpp +++ b/test/DynamicDependency/Test_Win32/Test_Win32_FullLifecycle_ProcessLifetime_Frameworks_2.cpp @@ -33,7 +33,7 @@ void Test::DynamicDependency::Test_Win32::FullLifecycle_ProcessLifetime_Framewor VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); VerifyPackageNotInPackageGraph(expectedPackageFullName_FrameworkMathAdd, S_OK); VerifyPathEnvironmentVariable(packagePath_WindowsAppRuntimeFramework, pathEnvironmentVariable.c_str()); - VerifyPackageDependency(packageDependencyId_FrameworkMathAdd.get(), S_OK, expectedPackageFullName_FrameworkMathAdd); + VerifyPackageDependency_Win11NotResolved(packageDependencyId_FrameworkMathAdd.get(), S_OK, expectedPackageFullName_FrameworkMathAdd); // -- Add @@ -71,15 +71,17 @@ void Test::DynamicDependency::Test_Win32::FullLifecycle_ProcessLifetime_Framewor // -- Remove + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"MddRemovePackageDependency(%p)...", packageDependencyContext_FrameworkMathAdd)); MddRemovePackageDependency(packageDependencyContext_FrameworkMathAdd); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); VerifyPackageNotInPackageGraph(expectedPackageFullName_FrameworkMathAdd, S_OK); VerifyPathEnvironmentVariable(packagePath_WindowsAppRuntimeFramework, pathEnvironmentVariable.c_str()); - VerifyPackageDependency(packageDependencyId_FrameworkMathAdd.get(), S_OK, expectedPackageFullName_FrameworkMathAdd); + VerifyPackageDependency_Win11NotResolved(packageDependencyId_FrameworkMathAdd.get(), S_OK, expectedPackageFullName_FrameworkMathAdd); // -- Delete + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"MddDeletePackageDependency(%s)...", packageDependencyId_FrameworkMathAdd.get())); MddDeletePackageDependency(packageDependencyId_FrameworkMathAdd.get()); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); diff --git a/test/DynamicDependency/Test_Win32/Test_Win32_FullLifecycle_RegistryLifetime_Frameworks_2.cpp b/test/DynamicDependency/Test_Win32/Test_Win32_FullLifecycle_RegistryLifetime_Frameworks_2.cpp index 9f79e9643e..4a8390e476 100644 --- a/test/DynamicDependency/Test_Win32/Test_Win32_FullLifecycle_RegistryLifetime_Frameworks_2.cpp +++ b/test/DynamicDependency/Test_Win32/Test_Win32_FullLifecycle_RegistryLifetime_Frameworks_2.cpp @@ -38,7 +38,7 @@ void Test::DynamicDependency::Test_Win32::FullLifecycle_RegistryLifetime_Framewo VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); VerifyPackageNotInPackageGraph(expectedPackageFullName_FrameworkMathAdd, S_OK); VerifyPathEnvironmentVariable(packagePath_WindowsAppRuntimeFramework, pathEnvironmentVariable.c_str()); - VerifyPackageDependency(packageDependencyId_FrameworkMathAdd.get(), S_OK, expectedPackageFullName_FrameworkMathAdd); + VerifyPackageDependency_Win11NotResolved(packageDependencyId_FrameworkMathAdd.get(), S_OK, expectedPackageFullName_FrameworkMathAdd); // -- Add @@ -68,6 +68,7 @@ void Test::DynamicDependency::Test_Win32::FullLifecycle_RegistryLifetime_Framewo VerifyPackageDependency(packageDependencyId_FrameworkMathAdd.get(), S_OK, expectedPackageFullName_FrameworkMathAdd); // Remove our 2nd instance. PackageGraph = [ Fwk, MathAdd ] + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"MddRemovePackageDependency(%p)...", context)); MddRemovePackageDependency(context); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); VerifyPackageInPackageGraph(expectedPackageFullName_FrameworkMathAdd, S_OK); @@ -96,15 +97,17 @@ void Test::DynamicDependency::Test_Win32::FullLifecycle_RegistryLifetime_Framewo // -- Remove + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"MddRemovePackageDependency(%p)...", packageDependencyContext_FrameworkMathAdd)); MddRemovePackageDependency(packageDependencyContext_FrameworkMathAdd); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); VerifyPackageNotInPackageGraph(expectedPackageFullName_FrameworkMathAdd, S_OK); VerifyPathEnvironmentVariable(packagePath_WindowsAppRuntimeFramework, pathEnvironmentVariable.c_str()); - VerifyPackageDependency(packageDependencyId_FrameworkMathAdd.get(), S_OK, expectedPackageFullName_FrameworkMathAdd); + VerifyPackageDependency_Win11NotResolved(packageDependencyId_FrameworkMathAdd.get(), S_OK, expectedPackageFullName_FrameworkMathAdd); // -- Delete + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"MddDeletePackageDependency(%s)...", packageDependencyId_FrameworkMathAdd.get())); MddDeletePackageDependency(packageDependencyId_FrameworkMathAdd.get()); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); diff --git a/test/DynamicDependency/Test_Win32/Test_Win32_WinRTReentrancy.cpp b/test/DynamicDependency/Test_Win32/Test_Win32_WinRTReentrancy.cpp index ceeece1e9e..3653dea855 100644 --- a/test/DynamicDependency/Test_Win32/Test_Win32_WinRTReentrancy.cpp +++ b/test/DynamicDependency/Test_Win32/Test_Win32_WinRTReentrancy.cpp @@ -36,7 +36,7 @@ void Test::DynamicDependency::Test_Win32::WinRTReentrancy() VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); VerifyPackageNotInPackageGraph(expectedPackageFullName_FrameworkWidgets, S_OK); VerifyPathEnvironmentVariable(packagePath_WindowsAppRuntimeFramework, pathEnvironmentVariable.c_str()); - VerifyPackageDependency(packageDependencyId_FrameworkWidgets.get(), S_OK, expectedPackageFullName_FrameworkWidgets); + VerifyPackageDependency_Win11NotResolved(packageDependencyId_FrameworkWidgets.get(), S_OK, expectedPackageFullName_FrameworkWidgets); // -- Add @@ -105,15 +105,17 @@ void Test::DynamicDependency::Test_Win32::WinRTReentrancy() // -- Remove + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"MddRemovePackageDependency(%p)...", packageDependencyContext_FrameworkWidgets)); MddRemovePackageDependency(packageDependencyContext_FrameworkWidgets); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); VerifyPackageNotInPackageGraph(expectedPackageFullName_FrameworkWidgets, S_OK); VerifyPathEnvironmentVariable(packagePath_WindowsAppRuntimeFramework, pathEnvironmentVariable.c_str()); - VerifyPackageDependency(packageDependencyId_FrameworkWidgets.get(), S_OK, expectedPackageFullName_FrameworkWidgets); + VerifyPackageDependency_Win11NotResolved(packageDependencyId_FrameworkWidgets.get(), S_OK, expectedPackageFullName_FrameworkWidgets); // -- Delete + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"MddDeletePackageDependency(%s)...", packageDependencyId_FrameworkWidgets.get())); MddDeletePackageDependency(packageDependencyId_FrameworkWidgets.get()); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); From 96323ecc85a79fa3ff91b979d054ea8533db2630 Mon Sep 17 00:00:00 2001 From: Howard Kapustein Date: Thu, 21 Nov 2024 21:47:09 -0800 Subject: [PATCH 27/27] Updated WinRT tests akin to Win32 --- .../Test_WinRT/Test_WinRT.cpp | 63 ++++++++++++++++++- .../DynamicDependency/Test_WinRT/Test_WinRT.h | 28 +++++++++ .../Test_WinRT/Test_WinRT_Add_Rank_A0_B10.cpp | 4 +- .../Test_WinRT_Add_Rank_B-10_A0.cpp | 4 +- .../Test_WinRT_Add_Rank_B0prepend_A0.cpp | 4 +- ...WinRT_Create_Add_Architectures_Current.cpp | 4 +- ...inRT_Create_Add_Architectures_Explicit.cpp | 4 +- ...Create_DoNotVerifyDependencyResolution.cpp | 4 +- ...ifecycle_FilePathLifetime_Frameworks_2.cpp | 5 +- ...Lifecycle_ProcessLifetime_Frameworks_2.cpp | 4 +- ...ifecycle_RegistryLifetime_Frameworks_2.cpp | 5 +- 11 files changed, 119 insertions(+), 10 deletions(-) diff --git a/test/DynamicDependency/Test_WinRT/Test_WinRT.cpp b/test/DynamicDependency/Test_WinRT/Test_WinRT.cpp index e22781776f..ab63869500 100644 --- a/test/DynamicDependency/Test_WinRT/Test_WinRT.cpp +++ b/test/DynamicDependency/Test_WinRT/Test_WinRT.cpp @@ -89,6 +89,7 @@ void Test::DynamicDependency::Test_WinRT::Create_Delete() const winrt::Windows::ApplicationModel::PackageVersion minVersion{}; auto packageDependency{ winrt::Microsoft::Windows::ApplicationModel::DynamicDependency::PackageDependency::Create(packageFamilyName, minVersion) }; + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"PackageDependencyId(%s).Delete()...", packageDependency.Id().c_str())); packageDependency.Delete(); VerifyGenerationId(1); @@ -193,16 +194,18 @@ void Test::DynamicDependency::Test_WinRT::FullLifecycle_ProcessLifetime_Framewor // -- Remove + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"PackageDependencyContext(%llu).Remove()...", packageDependencyContext_FrameworkMathAdd.ContextId().Id)); packageDependencyContext_FrameworkMathAdd.Remove(); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); VerifyPackageNotInPackageGraph(expectedPackageFullName_FrameworkMathAdd, S_OK); VerifyPathEnvironmentVariable(packagePath_WindowsAppRuntimeFramework, pathEnvironmentVariable.c_str()); - VerifyPackageDependency(packageDependencyId_FrameworkMathAdd, S_OK, expectedPackageFullName_FrameworkMathAdd); + VerifyPackageDependency_Win11NotResolved(packageDependencyId_FrameworkMathAdd, S_OK, expectedPackageFullName_FrameworkMathAdd); VerifyGenerationId(3); // -- Delete + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"PackageDependencyId(%s).Delete()...", packageDependency_FrameworkMathAdd.Id().c_str())); packageDependency_FrameworkMathAdd.Delete(); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); @@ -337,6 +340,64 @@ void Test::DynamicDependency::Test_WinRT::VerifyPackageDependency( VerifyPackageDependency(packageDependency.Id().c_str(), expectedHR, expectedPackageFullName.c_str()); } +void Test::DynamicDependency::Test_WinRT::VerifyPackageDependency_Win11NotResolved( + PCWSTR packageDependencyId, + const HRESULT expectedHR, + PCWSTR expectedPackageFullName) +{ + // Expected PackageFullName will be NULL if it's not resolved yet + // This can occur in the OS DynamicDependency API depending on order + // of operations and options. This differs from WinAppSDK DynamicDependency + // API in some cases. Tests use this method instad of VerifyPackageDependency() + // to handle this "expect NULL if we're using the OS API". + if (MddCore::Win11::IsSupported()) + { + VerifyPackageDependency(packageDependencyId, expectedHR, nullptr); + } + else + { + VerifyPackageDependency(packageDependencyId, expectedHR, expectedPackageFullName); + } +} + +void Test::DynamicDependency::Test_WinRT::VerifyPackageDependency_Win11NotResolved( + PCWSTR packageDependencyId, + const HRESULT expectedHR, + const std::wstring& expectedPackageFullName) +{ + VerifyPackageDependency_Win11NotResolved(packageDependencyId, expectedHR, expectedPackageFullName.c_str()); +} + +void Test::DynamicDependency::Test_WinRT::VerifyPackageDependency_Win11NotResolved( + const winrt::hstring& packageDependencyId, + const HRESULT expectedHR) +{ + VerifyPackageDependency_Win11NotResolved(packageDependencyId.c_str(), expectedHR); +} + +void Test::DynamicDependency::Test_WinRT::VerifyPackageDependency_Win11NotResolved( + const winrt::hstring& packageDependencyId, + const HRESULT expectedHR, + const winrt::hstring& expectedPackageFullName) +{ + VerifyPackageDependency_Win11NotResolved(packageDependencyId.c_str(), expectedHR, expectedPackageFullName.c_str()); +} + +void Test::DynamicDependency::Test_WinRT::VerifyPackageDependency_Win11NotResolved( + const winrt::Microsoft::Windows::ApplicationModel::DynamicDependency::PackageDependency& packageDependency, + const HRESULT expectedHR) +{ + VerifyPackageDependency_Win11NotResolved(packageDependency.Id().c_str(), expectedHR); +} + +void Test::DynamicDependency::Test_WinRT::VerifyPackageDependency_Win11NotResolved( + const winrt::Microsoft::Windows::ApplicationModel::DynamicDependency::PackageDependency& packageDependency, + const HRESULT expectedHR, + const winrt::hstring& expectedPackageFullName) +{ + VerifyPackageDependency_Win11NotResolved(packageDependency.Id().c_str(), expectedHR, expectedPackageFullName.c_str()); +} + void Test::DynamicDependency::Test_WinRT::VerifyPathEnvironmentVariable(PCWSTR path) { // N/A when DynamicDependency delegates to the Win11 OS API diff --git a/test/DynamicDependency/Test_WinRT/Test_WinRT.h b/test/DynamicDependency/Test_WinRT/Test_WinRT.h index 0948ee5b3e..33ca16e949 100644 --- a/test/DynamicDependency/Test_WinRT/Test_WinRT.h +++ b/test/DynamicDependency/Test_WinRT/Test_WinRT.h @@ -71,6 +71,34 @@ namespace Test::DynamicDependency const HRESULT expectedHR, const winrt::hstring& expectedPackageFullName); + static void VerifyPackageDependency_Win11NotResolved( + PCWSTR packageDependencyId, + const HRESULT expectedHR, + PCWSTR expectedPackageFullName = nullptr); + + static void VerifyPackageDependency_Win11NotResolved( + PCWSTR packageDependencyId, + const HRESULT expectedHR, + const std::wstring& expectedPackageFullName); + + void VerifyPackageDependency_Win11NotResolved( + const winrt::hstring& packageDependencyId, + const HRESULT expectedHR); + + static void VerifyPackageDependency_Win11NotResolved( + const winrt::hstring& packageDependencyId, + const HRESULT expectedHR, + const winrt::hstring& expectedPackageFullName); + + static void VerifyPackageDependency_Win11NotResolved( + const winrt::Microsoft::Windows::ApplicationModel::DynamicDependency::PackageDependency& packageDependency, + const HRESULT expectedHR); + + static void VerifyPackageDependency_Win11NotResolved( + const winrt::Microsoft::Windows::ApplicationModel::DynamicDependency::PackageDependency& packageDependency, + const HRESULT expectedHR, + const winrt::hstring& expectedPackageFullName); + static void VerifyPathEnvironmentVariable(PCWSTR path); static void VerifyPathEnvironmentVariable(PCWSTR path1, PCWSTR path); diff --git a/test/DynamicDependency/Test_WinRT/Test_WinRT_Add_Rank_A0_B10.cpp b/test/DynamicDependency/Test_WinRT/Test_WinRT_Add_Rank_A0_B10.cpp index f8315da0dc..4a508fa758 100644 --- a/test/DynamicDependency/Test_WinRT/Test_WinRT_Add_Rank_A0_B10.cpp +++ b/test/DynamicDependency/Test_WinRT/Test_WinRT_Add_Rank_A0_B10.cpp @@ -74,15 +74,17 @@ void Test::DynamicDependency::Test_WinRT::Add_Rank_A0_B10() // -- Remove + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"PackageDependencyContext(%llu).Remove()...", packageDependencyContext_FrameworkMathAdd.ContextId().Id)); packageDependencyContext_FrameworkMathAdd.Remove(); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); VerifyPackageNotInPackageGraph(expectedPackageFullName_FrameworkMathAdd, S_OK); VerifyPathEnvironmentVariable(packagePath_WindowsAppRuntimeFramework, pathEnvironmentVariable.c_str()); - VerifyPackageDependency(packageDependencyId_FrameworkMathAdd, S_OK, expectedPackageFullName_FrameworkMathAdd); + VerifyPackageDependency_Win11NotResolved(packageDependencyId_FrameworkMathAdd, S_OK, expectedPackageFullName_FrameworkMathAdd); // -- Delete + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"PackageDependencyId(%s).Delete()...", packageDependency_FrameworkMathAdd.Id().c_str())); packageDependency_FrameworkMathAdd.Delete(); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); diff --git a/test/DynamicDependency/Test_WinRT/Test_WinRT_Add_Rank_B-10_A0.cpp b/test/DynamicDependency/Test_WinRT/Test_WinRT_Add_Rank_B-10_A0.cpp index 444e7e460d..4180f6e026 100644 --- a/test/DynamicDependency/Test_WinRT/Test_WinRT_Add_Rank_B-10_A0.cpp +++ b/test/DynamicDependency/Test_WinRT/Test_WinRT_Add_Rank_B-10_A0.cpp @@ -74,15 +74,17 @@ void Test::DynamicDependency::Test_WinRT::Add_Rank_Bneg10_A0() // -- Remove + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"PackageDependencyContext(%llu).Remove()...", packageDependencyContext_FrameworkMathAdd.ContextId().Id)); packageDependencyContext_FrameworkMathAdd.Remove(); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); VerifyPackageNotInPackageGraph(expectedPackageFullName_FrameworkMathAdd, S_OK); VerifyPathEnvironmentVariable(packagePath_WindowsAppRuntimeFramework, pathEnvironmentVariable.c_str()); - VerifyPackageDependency(packageDependencyId_FrameworkMathAdd, S_OK, expectedPackageFullName_FrameworkMathAdd); + VerifyPackageDependency_Win11NotResolved(packageDependencyId_FrameworkMathAdd, S_OK, expectedPackageFullName_FrameworkMathAdd); // -- Delete + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"PackageDependencyId(%s).Delete()...", packageDependency_FrameworkMathAdd.Id().c_str())); packageDependency_FrameworkMathAdd.Delete(); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); diff --git a/test/DynamicDependency/Test_WinRT/Test_WinRT_Add_Rank_B0prepend_A0.cpp b/test/DynamicDependency/Test_WinRT/Test_WinRT_Add_Rank_B0prepend_A0.cpp index 026f695b31..545c2ee411 100644 --- a/test/DynamicDependency/Test_WinRT/Test_WinRT_Add_Rank_B0prepend_A0.cpp +++ b/test/DynamicDependency/Test_WinRT/Test_WinRT_Add_Rank_B0prepend_A0.cpp @@ -74,15 +74,17 @@ void Test::DynamicDependency::Test_WinRT::Add_Rank_B0prepend_A0() // -- Remove + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"PackageDependencyContext(%llu).Remove()...", packageDependencyContext_FrameworkMathAdd.ContextId().Id)); packageDependencyContext_FrameworkMathAdd.Remove(); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); VerifyPackageNotInPackageGraph(expectedPackageFullName_FrameworkMathAdd, S_OK); VerifyPathEnvironmentVariable(packagePath_WindowsAppRuntimeFramework, pathEnvironmentVariable.c_str()); - VerifyPackageDependency(packageDependencyId_FrameworkMathAdd, S_OK, expectedPackageFullName_FrameworkMathAdd); + VerifyPackageDependency_Win11NotResolved(packageDependencyId_FrameworkMathAdd, S_OK, expectedPackageFullName_FrameworkMathAdd); // -- Delete + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"PackageDependencyId(%s).Delete()...", packageDependency_FrameworkMathAdd.Id().c_str())); packageDependency_FrameworkMathAdd.Delete(); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); diff --git a/test/DynamicDependency/Test_WinRT/Test_WinRT_Create_Add_Architectures_Current.cpp b/test/DynamicDependency/Test_WinRT/Test_WinRT_Create_Add_Architectures_Current.cpp index 066ae9a6f0..b822a847ae 100644 --- a/test/DynamicDependency/Test_WinRT/Test_WinRT_Create_Add_Architectures_Current.cpp +++ b/test/DynamicDependency/Test_WinRT/Test_WinRT_Create_Add_Architectures_Current.cpp @@ -76,15 +76,17 @@ void Test::DynamicDependency::Test_WinRT::Create_Add_Architectures_Current() // -- Remove + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"PackageDependencyContext(%llu).Remove()...", packageDependencyContext_FrameworkMathAdd.ContextId().Id)); packageDependencyContext_FrameworkMathAdd.Remove(); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); VerifyPackageNotInPackageGraph(expectedPackageFullName_FrameworkMathAdd, S_OK); VerifyPathEnvironmentVariable(packagePath_WindowsAppRuntimeFramework, pathEnvironmentVariable.c_str()); - VerifyPackageDependency(packageDependencyId_FrameworkMathAdd, S_OK, expectedPackageFullName_FrameworkMathAdd); + VerifyPackageDependency_Win11NotResolved(packageDependencyId_FrameworkMathAdd, S_OK, expectedPackageFullName_FrameworkMathAdd); // -- Delete + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"PackageDependencyId(%s).Delete()...", packageDependency_FrameworkMathAdd.Id().c_str())); packageDependency_FrameworkMathAdd.Delete(); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); diff --git a/test/DynamicDependency/Test_WinRT/Test_WinRT_Create_Add_Architectures_Explicit.cpp b/test/DynamicDependency/Test_WinRT/Test_WinRT_Create_Add_Architectures_Explicit.cpp index b816ceb19c..7c9adea899 100644 --- a/test/DynamicDependency/Test_WinRT/Test_WinRT_Create_Add_Architectures_Explicit.cpp +++ b/test/DynamicDependency/Test_WinRT/Test_WinRT_Create_Add_Architectures_Explicit.cpp @@ -82,15 +82,17 @@ void Test::DynamicDependency::Test_WinRT::Create_Add_Architectures_Explicit() // -- Remove + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"PackageDependencyContext(%llu).Remove()...", packageDependencyContext_FrameworkMathAdd.ContextId().Id)); packageDependencyContext_FrameworkMathAdd.Remove(); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); VerifyPackageNotInPackageGraph(expectedPackageFullName_FrameworkMathAdd, S_OK); VerifyPathEnvironmentVariable(packagePath_WindowsAppRuntimeFramework, pathEnvironmentVariable.c_str()); - VerifyPackageDependency(packageDependencyId_FrameworkMathAdd, S_OK, expectedPackageFullName_FrameworkMathAdd); + VerifyPackageDependency_Win11NotResolved(packageDependencyId_FrameworkMathAdd, S_OK, expectedPackageFullName_FrameworkMathAdd); // -- Delete + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"PackageDependencyId(%s).Delete()...", packageDependency_FrameworkMathAdd.Id().c_str())); packageDependency_FrameworkMathAdd.Delete(); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); diff --git a/test/DynamicDependency/Test_WinRT/Test_WinRT_Create_DoNotVerifyDependencyResolution.cpp b/test/DynamicDependency/Test_WinRT/Test_WinRT_Create_DoNotVerifyDependencyResolution.cpp index 0672d0a32a..b20d20ddbf 100644 --- a/test/DynamicDependency/Test_WinRT/Test_WinRT_Create_DoNotVerifyDependencyResolution.cpp +++ b/test/DynamicDependency/Test_WinRT/Test_WinRT_Create_DoNotVerifyDependencyResolution.cpp @@ -80,15 +80,17 @@ void Test::DynamicDependency::Test_WinRT::Create_DoNotVerifyDependencyResolution // -- Remove + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"PackageDependencyContext(%llu).Remove()...", packageDependencyContext_FrameworkMathAdd.ContextId().Id)); packageDependencyContext_FrameworkMathAdd.Remove(); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); VerifyPackageNotInPackageGraph(expectedPackageFullName_FrameworkMathAdd, S_OK); VerifyPathEnvironmentVariable(packagePath_WindowsAppRuntimeFramework, pathEnvironmentVariable.c_str()); - VerifyPackageDependency(packageDependencyId_FrameworkMathAdd, S_OK, expectedPackageFullName_FrameworkMathAdd); + VerifyPackageDependency_Win11NotResolved(packageDependencyId_FrameworkMathAdd, S_OK, expectedPackageFullName_FrameworkMathAdd); // -- Delete + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"PackageDependencyId(%s).Delete()...", packageDependency_FrameworkMathAdd.Id().c_str())); packageDependency_FrameworkMathAdd.Delete(); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); diff --git a/test/DynamicDependency/Test_WinRT/Test_WinRT_FullLifecycle_FilePathLifetime_Frameworks_2.cpp b/test/DynamicDependency/Test_WinRT/Test_WinRT_FullLifecycle_FilePathLifetime_Frameworks_2.cpp index d97dcdf213..3db5f2cb7a 100644 --- a/test/DynamicDependency/Test_WinRT/Test_WinRT_FullLifecycle_FilePathLifetime_Frameworks_2.cpp +++ b/test/DynamicDependency/Test_WinRT/Test_WinRT_FullLifecycle_FilePathLifetime_Frameworks_2.cpp @@ -74,6 +74,7 @@ void Test::DynamicDependency::Test_WinRT::FullLifecycle_FilePathLifetime_Framewo VerifyPackageDependency(packageDependencyId_FrameworkMathAdd, S_OK, expectedPackageFullName_FrameworkMathAdd); // Remove our 2nd instance. PackageGraph = [ Fwk, MathAdd ] + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"PackageDependencyContext(%llu).Remove()...", context.ContextId().Id)); context.Remove(); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); @@ -103,15 +104,17 @@ void Test::DynamicDependency::Test_WinRT::FullLifecycle_FilePathLifetime_Framewo // -- Remove + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"PackageDependencyContext(%llu).Remove()...", packageDependencyContext_FrameworkMathAdd.ContextId().Id)); packageDependencyContext_FrameworkMathAdd.Remove(); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); VerifyPackageNotInPackageGraph(expectedPackageFullName_FrameworkMathAdd, S_OK); VerifyPathEnvironmentVariable(packagePath_WindowsAppRuntimeFramework, pathEnvironmentVariable.c_str()); - VerifyPackageDependency(packageDependencyId_FrameworkMathAdd, S_OK, expectedPackageFullName_FrameworkMathAdd); + VerifyPackageDependency_Win11NotResolved(packageDependencyId_FrameworkMathAdd, S_OK, expectedPackageFullName_FrameworkMathAdd); // -- Delete + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"PackageDependencyId(%s).Delete()...", packageDependency_FrameworkMathAdd.Id().c_str())); packageDependency_FrameworkMathAdd.Delete(); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); diff --git a/test/DynamicDependency/Test_WinRT/Test_WinRT_FullLifecycle_ProcessLifetime_Frameworks_2.cpp b/test/DynamicDependency/Test_WinRT/Test_WinRT_FullLifecycle_ProcessLifetime_Frameworks_2.cpp index cabffc28b7..77a24da2db 100644 --- a/test/DynamicDependency/Test_WinRT/Test_WinRT_FullLifecycle_ProcessLifetime_Frameworks_2.cpp +++ b/test/DynamicDependency/Test_WinRT/Test_WinRT_FullLifecycle_ProcessLifetime_Frameworks_2.cpp @@ -72,15 +72,17 @@ void Test::DynamicDependency::Test_WinRT::FullLifecycle_ProcessLifetime_Framewor // -- Remove + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"PackageDependencyContext(%llu).Remove()...", packageDependencyContext_FrameworkMathAdd.ContextId().Id)); packageDependencyContext_FrameworkMathAdd.Remove(); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); VerifyPackageNotInPackageGraph(expectedPackageFullName_FrameworkMathAdd, S_OK); VerifyPathEnvironmentVariable(packagePath_WindowsAppRuntimeFramework, pathEnvironmentVariable.c_str()); - VerifyPackageDependency(packageDependencyId_FrameworkMathAdd, S_OK, expectedPackageFullName_FrameworkMathAdd); + VerifyPackageDependency_Win11NotResolved(packageDependencyId_FrameworkMathAdd, S_OK, expectedPackageFullName_FrameworkMathAdd); // -- Delete + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"PackageDependencyId(%s).Delete()...", packageDependency_FrameworkMathAdd.Id().c_str())); packageDependency_FrameworkMathAdd.Delete(); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); diff --git a/test/DynamicDependency/Test_WinRT/Test_WinRT_FullLifecycle_RegistryLifetime_Frameworks_2.cpp b/test/DynamicDependency/Test_WinRT/Test_WinRT_FullLifecycle_RegistryLifetime_Frameworks_2.cpp index 03a71d842a..fe68c26b4a 100644 --- a/test/DynamicDependency/Test_WinRT/Test_WinRT_FullLifecycle_RegistryLifetime_Frameworks_2.cpp +++ b/test/DynamicDependency/Test_WinRT/Test_WinRT_FullLifecycle_RegistryLifetime_Frameworks_2.cpp @@ -70,6 +70,7 @@ void Test::DynamicDependency::Test_WinRT::FullLifecycle_RegistryLifetime_Framewo VerifyPackageDependency(packageDependencyId_FrameworkMathAdd, S_OK, expectedPackageFullName_FrameworkMathAdd); // Remove our 2nd instance. PackageGraph = [ Fwk, MathAdd ] + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"PackageDependencyContext(%llu).Remove()...", context.ContextId().Id)); context.Remove(); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); @@ -99,15 +100,17 @@ void Test::DynamicDependency::Test_WinRT::FullLifecycle_RegistryLifetime_Framewo // -- Remove + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"PackageDependencyContext(%llu).Remove()...", packageDependencyContext_FrameworkMathAdd.ContextId().Id)); packageDependencyContext_FrameworkMathAdd.Remove(); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK); VerifyPackageNotInPackageGraph(expectedPackageFullName_FrameworkMathAdd, S_OK); VerifyPathEnvironmentVariable(packagePath_WindowsAppRuntimeFramework, pathEnvironmentVariable.c_str()); - VerifyPackageDependency(packageDependencyId_FrameworkMathAdd, S_OK, expectedPackageFullName_FrameworkMathAdd); + VerifyPackageDependency_Win11NotResolved(packageDependencyId_FrameworkMathAdd, S_OK, expectedPackageFullName_FrameworkMathAdd); // -- Delete + WEX::Logging::Log::Comment(WEX::Common::String().Format(L"PackageDependencyId(%s).Delete()...", packageDependency_FrameworkMathAdd.Id().c_str())); packageDependency_FrameworkMathAdd.Delete(); VerifyPackageInPackageGraph(expectedPackageFullName_WindowsAppRuntimeFramework, S_OK);