Skip to content

Commit 467d9cb

Browse files
authoredSep 12, 2022
Refactor LRP tests for notifications (#2900)
* Refactor LRP tests and notification tests * Addressing nits * Update APITests.cpp * Address nits * Wrap check_bool in no throw macro * Fix copyright
1 parent 98fc988 commit 467d9cb

21 files changed

+354
-1247
lines changed
 

‎WindowsAppRuntime.sln

+24-89
Large diffs are not rendered by default.

‎test/DynamicDependency/data/WindowsAppRuntime.Test.Singleton.Msix/appxmanifest.xml

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
<Dependencies>
2424
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
25-
<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"/>
2625
</Dependencies>
2726

2827
<Resources>

‎test/LRPTests/APITests.cpp

+157
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
// Copyright (c) Microsoft Corporation and Contributors.
2+
// Licensed under the MIT License.
3+
4+
#include "pch.h"
5+
#include <TestDef.h>
6+
#include <TlHelp32.h>
7+
#include <NotificationsLongRunningProcess_h.h>
8+
9+
using namespace WEX::Common;
10+
using namespace WEX::Logging;
11+
using namespace WEX::TestExecution;
12+
13+
using namespace winrt::Windows::Foundation;
14+
using namespace winrt::Windows::System;
15+
16+
namespace Test::LRP
17+
{
18+
static const PCWSTR c_processName = L"TAEF.exe";
19+
static const PCWSTR c_appId = L"toastAppId";
20+
21+
class LRPTests
22+
{
23+
24+
public:
25+
BEGIN_TEST_CLASS(LRPTests)
26+
TEST_CLASS_PROPERTY(L"Description", L"Windows App SDK Push Notifications Long Running Process tests")
27+
TEST_CLASS_PROPERTY(L"ThreadingModel", L"MTA")
28+
TEST_CLASS_PROPERTY(L"RunAs:Class", L"RestrictedUser")
29+
END_TEST_CLASS()
30+
31+
winrt::com_ptr<INotificationsLongRunningPlatform> GetNotificationPlatform()
32+
{
33+
winrt::com_ptr notificationPlatform{ winrt::try_create_instance<INotificationsLongRunningPlatform>(_uuidof(NotificationsLongRunningPlatform), CLSCTX_ALL) };
34+
VERIFY_IS_NOT_NULL(notificationPlatform.get());
35+
36+
return notificationPlatform;
37+
}
38+
39+
TEST_CLASS_SETUP(ClassInit)
40+
{
41+
::Test::Bootstrap::SetupPackages(Test::Bootstrap::Packages::Singleton);
42+
return true;
43+
}
44+
45+
TEST_CLASS_CLEANUP(ClassUninit)
46+
{
47+
::Test::Bootstrap::CleanupPackages(Test::Bootstrap::Packages::Singleton);
48+
return true;
49+
}
50+
51+
TEST_METHOD(LaunchLRP_FromStartupTask)
52+
{
53+
VerifyLRP_IsRunning(false);
54+
55+
STARTUPINFO startupInfo{};
56+
ZeroMemory(&startupInfo, sizeof(startupInfo));
57+
startupInfo.cb = sizeof(startupInfo);
58+
59+
// Build the Solution OutDir path where the Startup Task exe is.
60+
// Path: $OutDir/WindowsAppRuntime.Test.Singleton.Msix/msix/PushNotificationsLongRunningTask.StartupTask.exe
61+
auto startupTaskExePath{ Test::FileSystem::GetSolutionOutDirPath() / Test::Packages::WindowsAppRuntimeSingleton::c_PackageDirName };
62+
startupTaskExePath += LR"(.Msix/msix/PushNotificationsLongRunningTask.StartupTask.exe)";
63+
64+
wil::unique_process_information processInfo;
65+
VERIFY_NO_THROW(winrt::check_bool(CreateProcess(
66+
startupTaskExePath.c_str(),
67+
nullptr, // command line options
68+
nullptr, // process attributes
69+
nullptr, // thread attributes
70+
FALSE, // inherit handles
71+
NORMAL_PRIORITY_CLASS, // creation flags
72+
nullptr, // lpEnvironment
73+
nullptr, // current directory for the process
74+
&startupInfo,
75+
&processInfo)));
76+
77+
// Wait for the process to come up and be captured in the snapshot from verification step.
78+
Sleep(1000);
79+
VerifyLRP_IsRunning(true);
80+
}
81+
82+
void VerifyLRP_IsRunning(bool isRunning)
83+
{
84+
wil::unique_handle processesSnapshot(CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0));
85+
VERIFY_IS_NOT_NULL(processesSnapshot.get());
86+
87+
PROCESSENTRY32 processEntry{};
88+
processEntry.dwSize = sizeof(processEntry);
89+
90+
BOOL result{ Process32First(processesSnapshot.get(), &processEntry) };
91+
while (result != FALSE)
92+
{
93+
if (wcscmp(L"PushNotificationsLongRunningTask.exe", processEntry.szExeFile) == 0)
94+
{
95+
VERIFY_IS_TRUE(isRunning);
96+
DWORD processId{ processEntry.th32ProcessID };
97+
98+
wil::unique_handle longRunningProcessHandle(OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, processId));
99+
DWORD exitCode{};
100+
BOOL exitCodeProcess{ GetExitCodeProcess(longRunningProcessHandle.get(), &exitCode) };
101+
102+
VERIFY_SUCCEEDED(exitCodeProcess == FALSE ? GetLastError() : S_OK);
103+
VERIFY_ARE_EQUAL(exitCode, STILL_ACTIVE);
104+
105+
return;
106+
}
107+
108+
result = Process32Next(processesSnapshot.get(), &processEntry);
109+
}
110+
111+
VERIFY_IS_FALSE(isRunning);
112+
}
113+
114+
TEST_METHOD(RegisterUnregisterLongRunningActivator)
115+
{
116+
auto notificationPlatform{ GetNotificationPlatform() };
117+
118+
wil::unique_cotaskmem_string lrpAppId;
119+
VERIFY_NO_THROW(notificationPlatform->RegisterFullTrustApplication(c_processName, winrt::guid(), &lrpAppId));
120+
VERIFY_NO_THROW(notificationPlatform->RegisterLongRunningActivator(c_processName));
121+
VERIFY_NO_THROW(notificationPlatform->UnregisterLongRunningActivator(c_processName));
122+
VERIFY_NO_THROW(notificationPlatform->UnregisterFullTrustApplication(c_processName));
123+
}
124+
125+
TEST_METHOD(RegisterUnregisterLongRunningActivatorWithClsid)
126+
{
127+
auto notificationPlatform{ GetNotificationPlatform() };
128+
129+
wil::unique_cotaskmem_string lrpAppId;
130+
VERIFY_NO_THROW(notificationPlatform->RegisterFullTrustApplication(c_processName, c_remoteId, &lrpAppId));
131+
VERIFY_NO_THROW(notificationPlatform->RegisterLongRunningActivatorWithClsid(c_processName, c_remoteId));
132+
VERIFY_NO_THROW(notificationPlatform->UnregisterLongRunningActivator(c_processName));
133+
VERIFY_NO_THROW(notificationPlatform->UnregisterFullTrustApplication(c_processName));
134+
}
135+
136+
TEST_METHOD(AddRemoveToastRegistrationMappingNoSink)
137+
{
138+
auto notificationPlatform{ GetNotificationPlatform() };
139+
140+
VERIFY_NO_THROW(notificationPlatform->AddToastRegistrationMapping(c_processName, c_appId));
141+
VERIFY_NO_THROW(notificationPlatform->RemoveToastRegistrationMapping(c_processName));
142+
}
143+
144+
TEST_METHOD(AddRemoveToastRegistrationMappingWithSink)
145+
{
146+
auto notificationPlatform{ GetNotificationPlatform() };
147+
148+
wil::unique_cotaskmem_string lrpAppId;
149+
VERIFY_NO_THROW(notificationPlatform->RegisterFullTrustApplication(c_processName, c_remoteId, &lrpAppId));
150+
VERIFY_NO_THROW(notificationPlatform->RegisterLongRunningActivator(lrpAppId.get()));
151+
VERIFY_NO_THROW(notificationPlatform->AddToastRegistrationMapping(c_processName, c_appId));
152+
VERIFY_NO_THROW(notificationPlatform->RemoveToastRegistrationMapping(c_processName));
153+
VERIFY_NO_THROW(notificationPlatform->UnregisterLongRunningActivator(c_processName));
154+
VERIFY_NO_THROW(notificationPlatform->UnregisterFullTrustApplication(c_processName));
155+
}
156+
};
157+
}

‎test/LRPTests/LRPTests.vcxproj

+142
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="..\..\packages\Microsoft.Windows.CppWinRT.2.0.220531.1\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.220531.1\build\native\Microsoft.Windows.CppWinRT.props')" />
4+
<ItemGroup Label="ProjectConfigurations">
5+
<ProjectConfiguration Include="Debug|Win32">
6+
<Configuration>Debug</Configuration>
7+
<Platform>Win32</Platform>
8+
</ProjectConfiguration>
9+
<ProjectConfiguration Include="Release|Win32">
10+
<Configuration>Release</Configuration>
11+
<Platform>Win32</Platform>
12+
</ProjectConfiguration>
13+
<ProjectConfiguration Include="Debug|x64">
14+
<Configuration>Debug</Configuration>
15+
<Platform>x64</Platform>
16+
</ProjectConfiguration>
17+
<ProjectConfiguration Include="Release|x64">
18+
<Configuration>Release</Configuration>
19+
<Platform>x64</Platform>
20+
</ProjectConfiguration>
21+
<ProjectConfiguration Include="Debug|ARM64">
22+
<Configuration>Debug</Configuration>
23+
<Platform>ARM64</Platform>
24+
</ProjectConfiguration>
25+
<ProjectConfiguration Include="Release|ARM64">
26+
<Configuration>Release</Configuration>
27+
<Platform>ARM64</Platform>
28+
</ProjectConfiguration>
29+
</ItemGroup>
30+
<PropertyGroup Label="Globals">
31+
<VCProjectVersion>16.0</VCProjectVersion>
32+
<Keyword>Win32Proj</Keyword>
33+
<ProjectGuid>{978b013f-9b68-4b3e-8da4-6f3be4eb22b4}</ProjectGuid>
34+
<RootNamespace>LRPTests</RootNamespace>
35+
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
36+
</PropertyGroup>
37+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
38+
<PropertyGroup>
39+
<ConfigurationType>DynamicLibrary</ConfigurationType>
40+
<UseOfMfc>false</UseOfMfc>
41+
<PlatformToolset>v142</PlatformToolset>
42+
<CharacterSet>Unicode</CharacterSet>
43+
</PropertyGroup>
44+
<PropertyGroup Condition="'$(Configuration)'=='Release'">
45+
<UseDebugLibraries>false</UseDebugLibraries>
46+
</PropertyGroup>
47+
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
48+
<UseDebugLibraries>true</UseDebugLibraries>
49+
</PropertyGroup>
50+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
51+
<ImportGroup Label="ExtensionSettings">
52+
</ImportGroup>
53+
<ImportGroup Label="Shared" />
54+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
55+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
56+
</ImportGroup>
57+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
58+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
59+
</ImportGroup>
60+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
61+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
62+
</ImportGroup>
63+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
64+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
65+
</ImportGroup>
66+
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets">
67+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
68+
</ImportGroup>
69+
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
70+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
71+
</ImportGroup>
72+
<PropertyGroup Label="UserMacros" />
73+
<ItemDefinitionGroup>
74+
<ClCompile>
75+
<PrecompiledHeader>Use</PrecompiledHeader>
76+
<UseFullPaths>true</UseFullPaths>
77+
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
78+
<AdditionalIncludeDirectories>$(RepoRoot)\test\inc;$(RepoRoot)\Dev\Common;$(RepoRoot)\Dev\AppNotifications\AppNotificationBuilder;$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories);$(OutDir)\..\WindowsAppRuntime_DLL;$(OutDir)\..\WindowsAppRuntime_BootstrapDLL;$(OutDir)..\PushNotificationsLongRunningTask.ProxyStub</AdditionalIncludeDirectories>
79+
<AdditionalIncludeDirectories Condition="$(WindowsAppSDKBuildPipeline) == '1'">$(RepoRoot);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
80+
</ClCompile>
81+
<Link>
82+
<SubSystem>Windows</SubSystem>
83+
<AdditionalDependencies>onecore.lib;onecoreuap.lib;Microsoft.WindowsAppRuntime.lib;wex.common.lib;wex.logger.lib;te.common.lib;%(AdditionalDependencies)</AdditionalDependencies>
84+
<AdditionalLibraryDirectories>$(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories);$(OutDir)\..\WindowsAppRuntime_DLL</AdditionalLibraryDirectories>
85+
</Link>
86+
</ItemDefinitionGroup>
87+
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
88+
<ClCompile>
89+
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
90+
</ClCompile>
91+
<Link>
92+
</Link>
93+
</ItemDefinitionGroup>
94+
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
95+
<ClCompile>
96+
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
97+
</ClCompile>
98+
<Link>
99+
</Link>
100+
</ItemDefinitionGroup>
101+
<ItemDefinitionGroup Condition="'$(Platform)'=='Win32'">
102+
<ClCompile>
103+
<PreprocessorDefinitions>WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
104+
</ClCompile>
105+
</ItemDefinitionGroup>
106+
<ItemGroup>
107+
<ClCompile Include="pch.cpp">
108+
<PrecompiledHeader>Create</PrecompiledHeader>
109+
</ClCompile>
110+
<ClCompile Include="APITests.cpp" />
111+
</ItemGroup>
112+
<ItemGroup>
113+
<ClInclude Include="pch.h" />
114+
</ItemGroup>
115+
<ItemGroup>
116+
<None Include="packages.config" />
117+
</ItemGroup>
118+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
119+
<ImportGroup Label="ExtensionTargets">
120+
<Import Project="..\..\packages\Microsoft.Taef.10.58.210222006-develop\build\Microsoft.Taef.targets" Condition="Exists('..\..\packages\Microsoft.Taef.10.58.210222006-develop\build\Microsoft.Taef.targets')" />
121+
<Import Project="..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.220201.1\build\native\Microsoft.Windows.ImplementationLibrary.targets" Condition="Exists('..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.220201.1\build\native\Microsoft.Windows.ImplementationLibrary.targets')" />
122+
<Import Project="..\..\packages\Microsoft.Windows.CppWinRT.2.0.220531.1\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.220531.1\build\native\Microsoft.Windows.CppWinRT.targets')" />
123+
</ImportGroup>
124+
<ItemGroup>
125+
<ProjectReference Include="..\..\dev\PushNotifications\PushNotificationsLongRunningTask.ProxyStub\PushNotificationsLongRunningTask.ProxyStub.vcxproj">
126+
<Project>{bf3fced0-cadb-490a-93a7-4d90e1f45ab0}</Project>
127+
</ProjectReference>
128+
</ItemGroup>
129+
<Target Name="CopyFiles" AfterTargets="AfterBuild">
130+
<Copy SourceFiles="$(OutDir)\..\WindowsAppRuntime_BootstrapDLL\Microsoft.WindowsAppRuntime.Bootstrap.dll" DestinationFolder="$(OutDir)" />
131+
<Copy SourceFiles="$(OutDir)\..\WindowsAppRuntime_DLL\Microsoft.Internal.FrameworkUdk.dll" DestinationFolder="$(OutDir)" />
132+
</Target>
133+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
134+
<PropertyGroup>
135+
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
136+
</PropertyGroup>
137+
<Error Condition="!Exists('..\..\packages\Microsoft.Taef.10.58.210222006-develop\build\Microsoft.Taef.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Taef.10.58.210222006-develop\build\Microsoft.Taef.targets'))" />
138+
<Error Condition="!Exists('..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.220201.1\build\native\Microsoft.Windows.ImplementationLibrary.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.220201.1\build\native\Microsoft.Windows.ImplementationLibrary.targets'))" />
139+
<Error Condition="!Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.220531.1\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Windows.CppWinRT.2.0.220531.1\build\native\Microsoft.Windows.CppWinRT.props'))" />
140+
<Error Condition="!Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.220531.1\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Windows.CppWinRT.2.0.220531.1\build\native\Microsoft.Windows.CppWinRT.targets'))" />
141+
</Target>
142+
</Project>
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,19 @@
1515
</Filter>
1616
</ItemGroup>
1717
<ItemGroup>
18-
<Xml Include="appxmanifest.xml" />
18+
<ClInclude Include="framework.h">
19+
<Filter>Header Files</Filter>
20+
</ClInclude>
21+
<ClInclude Include="pch.h">
22+
<Filter>Header Files</Filter>
23+
</ClInclude>
1924
</ItemGroup>
2025
<ItemGroup>
21-
<None Include="Makefile.mak" />
26+
<ClCompile Include="dllmain.cpp">
27+
<Filter>Source Files</Filter>
28+
</ClCompile>
29+
<ClCompile Include="pch.cpp">
30+
<Filter>Source Files</Filter>
31+
</ClCompile>
2232
</ItemGroup>
2333
</Project>

‎test/ToastNotificationTests/packages.config ‎test/LRPTests/packages.config

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="Microsoft.Taef" version="10.58.210222006-develop" targetFramework="native" />
44
<package id="Microsoft.Windows.CppWinRT" version="2.0.220531.1" targetFramework="native" />
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
// Copyright (c) Microsoft Corporation and Contributors.
1+
// Copyright (c) Microsoft Corporation and Contributors.
22
// Licensed under the MIT License.
33

4-
// pch.cpp: source file corresponding to the pre-compiled header
5-
64
#include "pch.h"
75

86
// When you are using pre-compiled headers, this source file is necessary for compilation to succeed.

‎test/ToastNotificationTests/pch.h ‎test/LRPTests/pch.h

+16-2
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,24 @@
66

77
#include <unknwn.h>
88

9+
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
910
#include <windows.h>
1011
#include <sddl.h>
1112
#include <appmodel.h>
1213

14+
#include <vector>
15+
#include <string>
16+
#include <algorithm>
17+
#include <wil/resource.h>
18+
#include <wil/stl.h>
1319
#include <wil/result.h>
1420
#include <wil/cppwinrt.h>
1521
#include <wil/token_helpers.h>
16-
#include <wil/resource.h>
1722
#include <wrl.h>
1823
#include <WexTestClass.h>
1924

20-
#include <string>
25+
#include <sstream>
26+
#include <iomanip>
2127

2228
#include <wil/result_macros.h>
2329
#include <wil/com.h>
@@ -38,6 +44,14 @@
3844
#include <windows.applicationmodel.background.h>
3945
#include <ShObjIdl_core.h>
4046

47+
#define VERIFY_THROWS_HR(expression, hr) \
48+
VERIFY_THROWS_SPECIFIC(expression, \
49+
winrt::hresult_error, \
50+
[&](winrt::hresult_error e) -> bool \
51+
{ \
52+
return (e.code() == hr); \
53+
})
54+
4155
namespace TP = ::Test::Packages;
4256
namespace TAEF = ::Test::TAEF;
4357
#endif //PCH_H

‎test/PushNotificationTests/PushNotification-Test-Constants.h

-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@ inline const winrt::hstring c_rawNotificationPayload = L"<toast></toast>";
66
static const std::chrono::seconds c_timeout = std::chrono::seconds(300);
77
inline IID c_azureRemoteId = winrt::guid(L"a2e4a323-b518-4799-9e80-0b37aeb0d225"); // Generated from ms.portal.azure.com
88
inline IID c_dummyRemoteId = winrt::guid(L"CA1A4AB2-AC1D-4EFC-A132-E5A191CA285A"); // Dummy guid from visual studio guid tool generator
9-
inline IID c_remoteId = winrt::guid("A7652901-313C-4EFA-A303-95C371A00DAB");
109
inline IID c_comServerId = winrt::guid("ccd2ae3f-764f-4ae3-be45-9804761b28b2"); // Value from PushNotificationsTestAppPackage ComActivator in appxmanifest.
1110
inline IID c_fakeComServerId = winrt::guid("00000000-0000-0000-0000-000000000001");
Binary file not shown.

‎test/PushNotifications/PushNotificationsLongRunningTask.Msix/PushNotificationsLongRunningTask.Msix.vcxproj

-118
This file was deleted.

‎test/PushNotifications/PushNotificationsLongRunningTask.Msix/appxmanifest.xml

-81
This file was deleted.

‎test/ToastNotificationTests/APITests.cpp

-625
This file was deleted.

‎test/ToastNotificationTests/ToastNotificationTests.vcxproj

-254
This file was deleted.

‎test/ToastNotificationTests/ToastNotificationTests.vcxproj.filters

-42
This file was deleted.

‎test/inc/TestDef.h

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ static const std::wstring c_testRequestRestartNowRestartedPhaseEventName = L"Win
2222
static const std::wstring c_testRequestRestartNowRestartedPhasePackagedEventName = L"WindowsAppRuntimeTestRequestRestartNowRestartedPhasePackagedEventName";
2323

2424
static const std::wstring c_testPushPhaseEventName = L"WindowsAppRuntimeTestPushPhaseEventName";
25+
inline IID c_remoteId = winrt::guid("A7652901-313C-4EFA-A303-95C371A00DAB");
2526

2627
#ifndef WIDEN2
2728
#define WIDEN2(x) L ## x

‎test/inc/WindowsAppRuntime.Test.Package.h

-28
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,6 @@ namespace WindowsAppRuntimeSingleton
9999
constexpr PCWSTR c_PackageFullName = L"WindowsAppRuntime.Test.Singleton_" WINDOWSAPPRUNTIME_TEST_PACKAGE_DDLM_VERSION L"_neutral__" WINDOWSAPPRUNTIME_TEST_MSIX_PUBLISHERID;
100100
}
101101

102-
namespace PushNotificationsLongRunningTask
103-
{
104-
constexpr PCWSTR c_PackageDirName = L"PushNotificationsLongRunningTask";
105-
constexpr PCWSTR c_PackageFamilyName = L"WindowsAppRuntime.Test.PushNotificationsTask_" WINDOWSAPPRUNTIME_TEST_MSIX_PUBLISHERID;
106-
constexpr PCWSTR c_PackageFullName = L"WindowsAppRuntime.Test.PushNotificationsTask_" WINDOWSAPPRUNTIME_TEST_PACKAGE_DDLM_VERSION L"_neutral__" WINDOWSAPPRUNTIME_TEST_MSIX_PUBLISHERID;
107-
}
108-
109102
namespace DeploymentWindowsAppRuntimeFramework
110103
{
111104
constexpr PCWSTR c_PackageDirName = L"Deployment.WindowsAppRuntime.Test.Framework";
@@ -305,27 +298,6 @@ inline bool IsPackageRegistered_WindowsAppRuntimeSingleton()
305298
return IsPackageRegistered(Test::Packages::WindowsAppRuntimeSingleton::c_PackageFullName);
306299
}
307300

308-
inline void AddPackage_PushNotificationsLongRunningTask()
309-
{
310-
AddPackage(Test::Packages::PushNotificationsLongRunningTask::c_PackageDirName, Test::Packages::PushNotificationsLongRunningTask::c_PackageFullName);
311-
}
312-
313-
inline void RemovePackage_PushNotificationsLongRunningTask()
314-
{
315-
// Best-effort removal. PackageManager.RemovePackage errors if the package
316-
// is not registered, but if it's not registered we're good. "'Tis the destination
317-
// that matters, not the journey" so regardless how much or little work
318-
// we need do, we're happy as long as the package isn't registered when we're done
319-
//
320-
// Thus, do a *IfNecessary removal
321-
RemovePackageIfNecessary(Test::Packages::PushNotificationsLongRunningTask::c_PackageFullName);
322-
}
323-
324-
inline bool IsPackageRegistered_PushNotificationsLongRunningTask()
325-
{
326-
return IsPackageRegistered(Test::Packages::PushNotificationsLongRunningTask::c_PackageFullName);
327-
}
328-
329301
inline void AddPackage_DeploymentWindowsAppRuntimeFramework()
330302
{
331303
AddPackage(Test::Packages::DeploymentWindowsAppRuntimeFramework::c_PackageDirName, Test::Packages::DeploymentWindowsAppRuntimeFramework::c_PackageFullName);

0 commit comments

Comments
 (0)
Please sign in to comment.