From 7fd261548cfccc3e012eaaa023832703f3a12290 Mon Sep 17 00:00:00 2001 From: Eric Langlois Date: Mon, 30 Aug 2021 15:52:23 -0700 Subject: [PATCH 1/3] Adding initial unpackaged test series --- test/PushNotificationTests/APITests.cpp | 93 ++++++++++++++++++++++++- 1 file changed, 91 insertions(+), 2 deletions(-) diff --git a/test/PushNotificationTests/APITests.cpp b/test/PushNotificationTests/APITests.cpp index 3546ad45e7..85d8462200 100644 --- a/test/PushNotificationTests/APITests.cpp +++ b/test/PushNotificationTests/APITests.cpp @@ -173,6 +173,15 @@ namespace Test::PushNotifications VERIFY_NO_THROW(LocalBackgroundTask.Run(mockBackgroundTaskInstance)); } + TEST_METHOD(BackgroundActivation_Unpackaged) + { + RunTestUnpackaged(L"BackgroundActivationTest", testWaitTime()); // Need to launch one time to enable background activation. + + auto LocalBackgroundTask = winrt::create_instance(c_comServerId, CLSCTX_ALL); + auto mockBackgroundTaskInstance = winrt::make(); + VERIFY_NO_THROW(LocalBackgroundTask.Run(mockBackgroundTaskInstance)); + } + TEST_METHOD(MultipleBackgroundActivation) { RunTest(L"BackgroundActivationTest", testWaitTime()); // Need to launch one time to enable background activation. @@ -188,72 +197,142 @@ namespace Test::PushNotifications } + TEST_METHOD(MultipleBackgroundActivation_Unpackaged) + { + RunTestUnpackaged(L"BackgroundActivationTest", testWaitTime()); // Need to launch one time to enable background activation. + + auto LocalBackgroundTask1 = winrt::create_instance(c_comServerId, CLSCTX_ALL); + auto mockBackgroundTaskInstance1 = winrt::make(); + + auto LocalBackgroundTask2 = winrt::create_instance(c_comServerId, CLSCTX_ALL); + auto mockBackgroundTaskInstance2 = winrt::make(); + + VERIFY_NO_THROW(LocalBackgroundTask1.Run(mockBackgroundTaskInstance1)); + VERIFY_NO_THROW(LocalBackgroundTask2.Run(mockBackgroundTaskInstance2)); + + } + TEST_METHOD(ChannelRequestUsingNullRemoteId) { RunTest(L"ChannelRequestUsingNullRemoteId", testWaitTime()); } + TEST_METHOD(ChannelRequestUsingNullRemoteId_Unpackaged) + { + RunTestUnpackaged(L"ChannelRequestUsingNullRemoteId", testWaitTime()); + } + TEST_METHOD(ChannelRequestUsingRemoteId) { RunTest(L"ChannelRequestUsingRemoteId", channelTestWaitTime()); } + TEST_METHOD(ChannelRequestUsingRemoteId_Unpackaged) + { + RunTestUnpackaged(L"ChannelRequestUsingRemoteId", channelTestWaitTime()); + } + TEST_METHOD(MultipleChannelClose) { RunTest(L"MultipleChannelClose", channelTestWaitTime()); } + TEST_METHOD(MultipleChannelClose_Unpackaged) + { + RunTestUnpackaged(L"MultipleChannelClose", channelTestWaitTime()); + } + TEST_METHOD(MultipleChannelRequestUsingSameRemoteId) { RunTest(L"MultipleChannelRequestUsingSameRemoteId", channelTestWaitTime()); } + TEST_METHOD(MultipleChannelRequestUsingSameRemoteId_Unpackaged) + { + RunTestUnpackaged(L"MultipleChannelRequestUsingSameRemoteId", channelTestWaitTime()); + } + TEST_METHOD(MultipleChannelRequestUsingMultipleRemoteId) { RunTest(L"MultipleChannelRequestUsingMultipleRemoteId", channelTestWaitTime()); } + TEST_METHOD(MultipleChannelRequestUsingMultipleRemoteId_Unpackaged) + { + RunTestUnpackaged(L"MultipleChannelRequestUsingMultipleRemoteId", channelTestWaitTime()); + } + TEST_METHOD(ActivatorTest) { RunTest(L"ActivatorTest", testWaitTime()); } + TEST_METHOD(ActivatorTest_Unpackaged) + { + RunTestUnpackaged(L"ActivatorTest", testWaitTime()); + } + TEST_METHOD(RegisterActivatorNullDetails) { RunTest(L"RegisterActivatorNullDetails", testWaitTime()); } + TEST_METHOD(RegisterActivatorNullDetails_Unpackaged) + { + RunTestUnpackaged(L"RegisterActivatorNullDetails", testWaitTime()); + } + TEST_METHOD(RegisterActivatorNullClsid) { RunTest(L"RegisterActivatorNullClsid", testWaitTime()); } + TEST_METHOD(RegisterActivatorNullClsid_Unpackaged) + { + RunTestUnpackaged(L"RegisterActivatorNullClsid", testWaitTime()); + } + TEST_METHOD(UnregisterActivatorNullToken) { RunTest(L"UnregisterActivatorNullToken", testWaitTime()); } + TEST_METHOD(UnregisterActivatorNullToken_Unpackaged) + { + RunTestUnpackaged(L"UnregisterActivatorNullToken", testWaitTime()); + } + TEST_METHOD(UnregisterActivatorNullBackgroundRegistration) { RunTest(L"UnregisterActivatorNullBackgroundRegistration", testWaitTime()); } + TEST_METHOD(UnregisterActivatorNullBackgroundRegistration_Unpackaged) + { + RunTestUnpackaged(L"UnregisterActivatorNullBackgroundRegistration", testWaitTime()); + } + TEST_METHOD(MultipleRegisterActivatorTest) { RunTest(L"MultipleRegisterActivatorTest", testWaitTime()); } + TEST_METHOD(MultipleRegisterActivatorTest_Unpackaged) + { + RunTestUnpackaged(L"MultipleRegisterActivatorTest", testWaitTime()); + } + TEST_METHOD(VerifyComActivatorSupported) { RunTest(L"VerifyComActivatorSupported", testWaitTime()); } - TEST_METHOD(VerifyComActivatorNotSupported) + TEST_METHOD(VerifyComActivatorNotSupported_Unpackaged) { RunTestUnpackaged(L"VerifyComActivatorNotSupported", testWaitTime()); } - TEST_METHOD(VerifyProtocolActivatorSupported) + TEST_METHOD(VerifyProtocolActivatorSupported_Unpackaged) { RunTestUnpackaged(L"VerifyProtocolActivatorSupported", testWaitTime()); } @@ -268,9 +347,19 @@ namespace Test::PushNotifications RunTest(L"VerifyComAndProtocolActivatorNotSupported", testWaitTime()); } + TEST_METHOD(VerifyComAndProtocolActivatorNotSupported_Unpackaged) + { + RunTestUnpackaged(L"VerifyComAndProtocolActivatorNotSupported", testWaitTime()); + } + TEST_METHOD(VerifyNullActivatorNotSupported) { RunTest(L"VerifyNullActivatorNotSupported", testWaitTime()); } + + TEST_METHOD(VerifyNullActivatorNotSupported_Unpackaged) + { + RunTestUnpackaged(L"VerifyNullActivatorNotSupported", testWaitTime()); + } }; } From 312cde43f365fadf976dd1b419c136a60e383e22 Mon Sep 17 00:00:00 2001 From: Eric Langlois Date: Fri, 3 Sep 2021 06:01:06 -0700 Subject: [PATCH 2/3] This function now fails silently --- test/PushNotificationTests/APITests.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/test/PushNotificationTests/APITests.cpp b/test/PushNotificationTests/APITests.cpp index bb94b77bc8..dd68f8319c 100644 --- a/test/PushNotificationTests/APITests.cpp +++ b/test/PushNotificationTests/APITests.cpp @@ -232,11 +232,6 @@ namespace Test::PushNotifications RunTestUnpackaged(L"ChannelRequestUsingRemoteId", channelTestWaitTime()); } - TEST_METHOD(MultipleChannelClose) - { - RunTest(L"MultipleChannelClose", channelTestWaitTime()); - } - TEST_METHOD(MultipleChannelClose_Unpackaged) { RunTestUnpackaged(L"MultipleChannelClose", channelTestWaitTime()); From a5a60af3d14bebde8b4ffa16a943bf756ffd0198 Mon Sep 17 00:00:00 2001 From: Eric Langlois Date: Fri, 3 Sep 2021 09:33:37 -0700 Subject: [PATCH 3/3] This is not expected to work for unpackaged apps --- test/PushNotificationTests/APITests.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/test/PushNotificationTests/APITests.cpp b/test/PushNotificationTests/APITests.cpp index dd68f8319c..4f1a17ef3b 100644 --- a/test/PushNotificationTests/APITests.cpp +++ b/test/PushNotificationTests/APITests.cpp @@ -262,11 +262,6 @@ namespace Test::PushNotifications RunTest(L"ActivatorTest", testWaitTime()); } - TEST_METHOD(ActivatorTest_Unpackaged) - { - RunTestUnpackaged(L"ActivatorTest", testWaitTime()); - } - TEST_METHOD(RegisterActivatorNullDetails) { RunTest(L"RegisterActivatorNullDetails", testWaitTime());