Skip to content

Commit acce5ab

Browse files
authored
Fixing and enabling AppLifecycle tests (#5719)
* Changing names to prefixes * Enabling test * Adding script to add missing dependency * Revert "Adding script to add missing dependency" This reverts commit f396678. * Reapply "Adding script to add missing dependency" This reverts commit d1d4e86. * Adding new script to download UWP version of VCLibs * Adding the ps1 script I forgot * Trying copying from VS * Removing installation of unexisting UWP packages * Using package manifest for vclibs * Fixing version * Removing install of VClibs in yml file * Putting version to 0 * Implementing TODO * Adding entry to bypass tests * Bypassing every individual test
1 parent 8f5c6d7 commit acce5ab

6 files changed

Lines changed: 38 additions & 16 deletions

File tree

build/AzurePipelinesTemplates/WindowsAppSDK-RunTests-Steps.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,6 @@ steps:
7676
script: |
7777
$(Build.SourcesDirectory)\redist\dotnet-windowsdesktop-runtime-installer.exe /quiet /install /norestart
7878
79-
- task: powerShell@2
80-
displayName: 'Install VCLibs.Desktop'
81-
inputs:
82-
targetType: 'inline'
83-
script: |
84-
$package = "$(Build.SourcesDirectory)\redist\Microsoft.VCLibs.${{ parameters.buildPlatform }}.14.00.Desktop.appx"
85-
Add-AppxPackage $package -ErrorAction SilentlyContinue
86-
8779
- task: powerShell@2
8880
displayName: 'Install vc_redist'
8981
inputs:

test/AppLifecycle/AppLifecycle.testdef

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"Filename": "AppLifecycleTests.dll",
66
"Parameters": "",
77
"Architectures": ["x64", "arm64"],
8-
"Status": "Disabled"
8+
"Status": "Enabled"
99
}
1010
]
1111
}

test/BypassTests.json

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1525,5 +1525,18 @@
15251525
"release_x86_Windows.Server.2019.DataCenter.zh-CN.Test::Decimal::Tests::DecimalTests::from_zstring_view_localename_system",
15261526
"release_x86_Windows.Server.2019.DataCenter.zh-CN.Test::Decimal::Tests::DecimalTests::from_zwstring_view",
15271527
"release_x86_Windows.Server.2019.DataCenter.zh-CN.Test::Decimal::Tests::DecimalTests::from_zwstring_view_invariant",
1528-
"release_x86_Windows.Server.2019.DataCenter.zh-CN.Test::Decimal::Tests::DecimalTests::from_zwstring_view_localename_system"
1528+
"release_x86_Windows.Server.2019.DataCenter.zh-CN.Test::Decimal::Tests::DecimalTests::from_zwstring_view_localename_system",
1529+
"release_x64_Win10_rs5_DC.Test::AppLifecycle::FunctionalTests::GetActivatedEventArgsIsNotNull",
1530+
"release_x64_Win10_rs5_DC.Test::AppLifecycle::FunctionalTests::GetActivatedEventArgsForLaunch",
1531+
"release_x64_Win10_rs5_DC.Test::AppLifecycle::FunctionalTests::GetActivatedEventArgsForFile_Win32",
1532+
"release_x64_Win10_rs5_DC.Test::AppLifecycle::FunctionalTests::GetActivatedEventArgsForUnicodeNamedFile_Win32",
1533+
"release_x64_Win10_rs5_DC.Test::AppLifecycle::FunctionalTests::GetActivatedEventArgsForFile_PackagedWin32",
1534+
"release_x64_Win10_rs5_DC.Test::AppLifecycle::FunctionalTests::GetActivatedEventArgsForProtocol_Win32",
1535+
"release_x64_Win10_rs5_DC.Test::AppLifecycle::FunctionalTests::GetActivatedEventArgsForProtocol_PackagedWin32",
1536+
"release_x64_Win10_rs5_DC.Test::AppLifecycle::FunctionalTests::GetActivatedEventArgsForPush_Win32",
1537+
"release_x64_Win10_rs5_DC.Test::AppLifecycle::FunctionalTests::GetActivatedEventArgsForStartup_Win32",
1538+
"release_x64_Win10_rs5_DC.Test::AppLifecycle::FunctionalTests::SingleInstanceTest_Win32",
1539+
"release_x64_Win10_rs5_DC.Test::AppLifecycle::FunctionalTests::SingleInstanceTest_PackagedWin32",
1540+
"release_x64_Win10_rs5_DC.Test::AppLifecycle::FunctionalTests::RequestRestart_Win32",
1541+
"release_x64_Win10_rs5_DC.Test::AppLifecycle::FunctionalTests::RequestRestart_PackagedWin32"
15291542
]

test/TestApps/AppLifecycleTestApp/Helpers.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Microsoft Corporation and Contributors. All rights reserved.
1+
// Copyright (c) Microsoft Corporation and Contributors. All rights reserved.
22
// Licensed under the MIT License. See LICENSE in the project root for license information.
33
#include "pch.h"
44
#include "Helpers.h"
@@ -42,9 +42,9 @@ HRESULT BootstrapInitialize()
4242

4343
constexpr PCWSTR c_PackageNamePrefix{ L"WindowsAppRuntime.Test.DDLM" };
4444
constexpr PCWSTR c_PackagePublisherId{ L"8wekyb3d8bbwe" };
45-
constexpr PCWSTR c_FrameworkPackageFamilyName = L"Microsoft.WindowsAppRuntime.Framework.4.1_8wekyb3d8bbwe";
46-
constexpr PCWSTR c_MainPackageFamilyName = L"WindowsAppRuntime.Test.DynDep.DataStore.4.1_8wekyb3d8bbwe";
47-
RETURN_IF_FAILED(mddTestInitialize(c_PackageNamePrefix, c_PackagePublisherId, c_FrameworkPackageFamilyName, c_MainPackageFamilyName));
45+
constexpr PCWSTR c_FrameworkPackageNamePrefix = L"Microsoft.WindowsAppRuntime.Framework";
46+
constexpr PCWSTR c_MainPackageNamePrefix = L"WindowsAppRuntime.Test.DynDep.DataStore";
47+
RETURN_IF_FAILED(mddTestInitialize(c_PackageNamePrefix, c_PackagePublisherId, c_FrameworkPackageNamePrefix, c_MainPackageNamePrefix));
4848

4949
// Major.Minor version, MinVersion=0 to find any framework package for this major.minor version
5050
const UINT32 c_Version_MajorMinor{ 0x00040001 };

test/TestApps/AppLifecycleTestApp/main.cpp

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,15 @@ int main()
9191
}
9292
catch (...)
9393
{
94-
//TODO:Unregister should not fail if ERROR_FILE_NOT_FOUND | ERROR_PATH_NOT_FOUND
94+
// Unregister should not fail if ERROR_FILE_NOT_FOUND | ERROR_PATH_NOT_FOUND
95+
// These errors indicate the registration doesn't exist, which is the desired state
96+
auto hr = winrt::to_hresult();
97+
if (hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) || hr == HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND))
98+
{
99+
// Signal event that protocol was unregistered (or already didn't exist).
100+
SignalPhase(c_testProtocolPhaseEventName);
101+
succeeded = true;
102+
}
95103
}
96104
}
97105
else if (argument.compare(L"RegisterFile") == 0)
@@ -116,7 +124,15 @@ int main()
116124
}
117125
catch (...)
118126
{
119-
//TODO:Unregister should not fail if ERROR_FILE_NOT_FOUND | ERROR_PATH_NOT_FOUND
127+
// Unregister should not fail if ERROR_FILE_NOT_FOUND | ERROR_PATH_NOT_FOUND
128+
// These errors indicate the registration doesn't exist, which is the desired state
129+
auto hr = winrt::to_hresult();
130+
if (hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) || hr == HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND))
131+
{
132+
// Signal event that file was unregistered (or already didn't exist).
133+
SignalPhase(c_testFilePhaseEventName);
134+
succeeded = true;
135+
}
120136
}
121137
}
122138
else if (argument.compare(L"RegisterStartup") == 0)

test/TestApps/AppLifecycleTestPackage/Package.appxmanifest

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
2222
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.18362.0" />
2323
<PackageDependency Name="Microsoft.WindowsAppRuntime.Framework.4.1" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" MinVersion="0.0.0.0"/>
24+
<PackageDependency Name="Microsoft.VCLibs.140.00.UWPDesktop" MinVersion="0.0.0.0" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" />
2425
</Dependencies>
2526

2627
<Resources>

0 commit comments

Comments
 (0)