Skip to content

Commit 8c0fbcb

Browse files
committed
test(manage): bidirectional end to end tests
1 parent cadd39f commit 8c0fbcb

File tree

3 files changed

+229
-34
lines changed

3 files changed

+229
-34
lines changed

src/sdks/manage/src/cpp/sdk/cpptest/Main.cpp

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <string>
2222
#include <iostream>
2323
#include <stdexcept>
24+
#include <unistd.h>
2425
#include "ManageSDKTest.h"
2526

2627
using namespace std;
@@ -41,7 +42,8 @@ void RunAllTests() {
4142
};
4243

4344
// Ensure the connection is ready before running tests
44-
if (ManageSDKTest::WaitOnConnectionReady()) {
45+
// if (ManageSDKTest::WaitOnConnectionReady()) {
46+
sleep(2);
4547
// Advertising methods
4648
runTest(ManageSDKTest::GetAdvertisingSkipRestriction, "GetAdvertisingSkipRestriction");
4749
runTest(ManageSDKTest::SetAdvertisingSkipRestriction, "SetAdvertisingSkipRestriction");
@@ -54,29 +56,34 @@ void RunAllTests() {
5456
runTest(ManageSDKTest::GetAudioDescriptionsEnabled, "GetAudioDescriptionsEnabled");
5557
runTest(ManageSDKTest::SetAudioDescriptionsEnabled, "SetAudioDescriptionsEnabled");
5658
runTest(ManageSDKTest::SubscribeAudioDescriptionsEnabledChanged, "SubscribeAudioDescriptionsEnabledChanged");
59+
ManageSDKTest::event_trigger(ManageSDKTest::audioDescriptionsEnabledChanged);
5760
runTest(ManageSDKTest::UnsubscribeAudioDescriptionsEnabledChanged, "UnsubscribeAudioDescriptionsEnabledChanged");
5861

5962
// Device methods
6063
runTest(ManageSDKTest::GetDeviceName, "GetDeviceName");
6164
runTest(ManageSDKTest::SetDeviceName, "SetDeviceName");
6265
runTest(ManageSDKTest::SubscribeDeviceNameChanged, "SubscribeDeviceNameChanged");
66+
ManageSDKTest::event_trigger(ManageSDKTest::deviceNameChanged);
6367
runTest(ManageSDKTest::UnsubscribeDeviceNameChanged, "UnsubscribeDeviceNameChanged");
6468

6569
// ClosedCaptions methods
6670
runTest(ManageSDKTest::GetClosedCaptionsBackgroundOpacity, "GetClosedCaptionsBackgroundOpacity");
6771
runTest(ManageSDKTest::SetClosedCaptionsBackgroundOpacity, "SetClosedCaptionsBackgroundOpacity");
6872
runTest(ManageSDKTest::SubscribeClosedCaptionsBackgroundOpacityChanged, "SubscribeClosedCaptionsBackgroundOpacityChanged");
73+
ManageSDKTest::event_trigger(ManageSDKTest::backgroundOpacityChanged);
6974
runTest(ManageSDKTest::UnsubscribeClosedCaptionsBackgroundOpacityChanged, "UnsubscribeClosedCaptionsBackgroundOpacityChanged");
7075

7176
runTest(ManageSDKTest::GetClosedCaptionsFontFamily, "GetClosedCaptionsFontFamily");
7277
runTest(ManageSDKTest::SetClosedCaptionsFontFamily, "SetClosedCaptionsFontFamily");
7378
runTest(ManageSDKTest::SubscribeClosedCaptionsFontFamilyChanged, "SubscribeClosedCaptionsFontFamilyChanged");
79+
ManageSDKTest::event_trigger(ManageSDKTest::fontFamilyChanged);
7480
runTest(ManageSDKTest::UnsubscribeClosedCaptionsFontFamilyChanged, "UnsubscribeClosedCaptionsFontFamilyChanged");
7581

7682
// Localization methods
7783
runTest(ManageSDKTest::GetLocalizationPreferredAudioLanguages, "GetLocalizationPreferredAudioLanguages");
7884
runTest(ManageSDKTest::SetLocalizationPreferredAudioLanguages, "SetLocalizationPreferredAudioLanguages");
7985
runTest(ManageSDKTest::SubscribeLocalizationPreferredAudioLanguagesChanged, "SubscribeLocalizationPreferredAudioLanguagesChanged");
86+
ManageSDKTest::event_trigger(ManageSDKTest::preferredAudioLanguagesChanged);
8087
runTest(ManageSDKTest::UnsubscribeLocalizationPreferredAudioLanguagesChanged, "UnsubscribeLocalizationPreferredAudioLanguagesChanged");
8188

8289
runTest(ManageSDKTest::GetLocalizationAdditionalInfo, "GetLocalizationAdditionalInfo");
@@ -87,14 +94,17 @@ void RunAllTests() {
8794
runTest(ManageSDKTest::GetPrivacyAllowACRCollection, "GetPrivacyAllowACRCollection");
8895
runTest(ManageSDKTest::SetPrivacyAllowACRCollection, "SetPrivacyAllowACRCollection");
8996
runTest(ManageSDKTest::SubscribePrivacyAllowACRCollectionChanged, "SubscribePrivacyAllowACRCollectionChanged");
97+
ManageSDKTest::event_trigger(ManageSDKTest::allowACRCollectionChanged);
9098
runTest(ManageSDKTest::UnsubscribePrivacyAllowACRCollectionChanged, "UnsubscribePrivacyAllowACRCollectionChanged");
9199

92100
runTest(ManageSDKTest::GetPrivacySettings, "GetPrivacySettings");
93101

94102
// Discovery methods
95103
runTest(ManageSDKTest::SubscribeDiscoverySignInNotification, "SubscribeDiscoverySignInNotification");
104+
ManageSDKTest::event_trigger(ManageSDKTest::signInEvent);
96105
runTest(ManageSDKTest::UnsubscribeDiscoverySignInNotification, "UnsubscribeDiscoverySignInNotification");
97106
runTest(ManageSDKTest::SubscribeDiscoverySignOutNotification, "SubscribeDiscoverySignOutNotification");
107+
ManageSDKTest::event_trigger(ManageSDKTest::signOutEvent);
98108
runTest(ManageSDKTest::UnsubscribeDiscoverySignOutNotification, "UnsubscribeDiscoverySignOutNotification");
99109

100110
// UserGrants methods
@@ -103,25 +113,21 @@ void RunAllTests() {
103113
runTest(ManageSDKTest::DenyUserGrantsPermission, "DenyUserGrantsPermission");
104114
runTest(ManageSDKTest::ClearUserGrantsPermission, "ClearUserGrantsPermission");
105115

106-
// Wifi methods
107-
// runTest(ManageSDKTest::WifiScan, "WifiScan");
108-
// runTest(ManageSDKTest::WifiConnect, "WifiConnect");
109-
// runTest(ManageSDKTest::WifiDisconnect, "WifiDisconnect");
110-
111116
// Provider registration
112-
runTest(ManageSDKTest::RegisterKeyboardProvider, "RegisterKeyboardProvider");
113-
runTest(ManageSDKTest::SendResponseMessageToKeyboardProvider, "SendResponseMessageToKeyboardProvider");
114-
runTest(ManageSDKTest::SendErrorMessageToKeyboardProvider, "SendErrorMessageToKeyboardProvider");
117+
// runTest(ManageSDKTest::RegisterKeyboardProvider, "RegisterKeyboardProvider");
118+
// runTest(ManageSDKTest::SendResponseMessageToKeyboardProvider, "SendResponseMessageToKeyboardProvider");
119+
// runTest(ManageSDKTest::SendErrorMessageToKeyboardProvider, "SendErrorMessageToKeyboardProvider");
115120

116-
runTest(ManageSDKTest::RegisterAcknowledgeChallengeProvider, "RegisterAcknowledgeChallengeProvider");
117-
runTest(ManageSDKTest::SendResponseMessageToAcknowledgeChallengeProvider, "SendResponseMessageToAcknowledgeChallengeProvider");
118-
runTest(ManageSDKTest::SendErrorMessageToAcknowledgeChallengeProvider, "SendErrorMessageToAcknowledgeChallengeProvider");
121+
// runTest(ManageSDKTest::RegisterAcknowledgeChallengeProvider, "RegisterAcknowledgeChallengeProvider");
122+
// runTest(ManageSDKTest::SendResponseMessageToAcknowledgeChallengeProvider, "SendResponseMessageToAcknowledgeChallengeProvider");
123+
// runTest(ManageSDKTest::SendErrorMessageToAcknowledgeChallengeProvider, "SendErrorMessageToAcknowledgeChallengeProvider");
119124

120-
runTest(ManageSDKTest::RegisterPinChallengeProvider, "RegisterPinChallengeProvider");
121-
runTest(ManageSDKTest::SendResponseMessageToPinChallengeProvider, "SendResponseMessageToPinChallengeProvider");
122-
runTest(ManageSDKTest::SendErrorMessageToPinChallengeProvider, "SendErrorMessageToPinChallengeProvider");
125+
// runTest(ManageSDKTest::RegisterPinChallengeProvider, "RegisterPinChallengeProvider");
126+
// runTest(ManageSDKTest::SendResponseMessageToPinChallengeProvider, "SendResponseMessageToPinChallengeProvider");
127+
// runTest(ManageSDKTest::SendErrorMessageToPinChallengeProvider, "SendErrorMessageToPinChallengeProvider");
123128

124129
runTest(ManageSDKTest::GlobalSubscribeHdmiAutoLowLatencyModeCapableChanged, "GlobalSubscribeHdmiAutoLowLatencyModeCapableChanged");
130+
ManageSDKTest::event_trigger(ManageSDKTest::autoLowLatencyModeCapableChanged);
125131
runTest(ManageSDKTest::GlobalUnsubscribeHdmiAutoLowLatencyModeCapableChanged, "GlobalUnsubscribeHdmiAutoLowLatencyModeCapableChanged");
126132

127133
runTest(ManageSDKTest::GetAutoLowLatencyModeCapable, "GetAutoLowLatencyModeCapable");
@@ -143,10 +149,10 @@ void RunAllTests() {
143149
cout << "============================" << endl;
144150
exit(1);
145151
}
146-
} else {
147-
cout << "Manage Test not able to connect with server..." << endl;
148-
exit(1);
149-
}
152+
// } else {
153+
// cout << "Manage Test not able to connect with server..." << endl;
154+
// exit(1);
155+
// }
150156
}
151157

152158
int main(int argc, char* argv[]) {

0 commit comments

Comments
 (0)