@@ -49,13 +49,14 @@ class AsyncHandlerMock_UserSetting
49
49
MOCK_METHOD (void , onCaptionsChanged, (const bool enabled));
50
50
MOCK_METHOD (void , onPreferredCaptionsLanguagesChanged, (const string preferredLanguages));
51
51
MOCK_METHOD (void , onPreferredClosedCaptionServiceChanged, (const string service));
52
- MOCK_METHOD (void , onPinControlChanged, (const bool enabled ));
52
+ MOCK_METHOD (void , onPinControlChanged, (const bool pinControl ));
53
53
MOCK_METHOD (void , onViewingRestrictionsChanged, (const string viewingRestrictions));
54
54
MOCK_METHOD (void , onViewingRestrictionsWindowChanged, (const string viewingRestrictionsWindow));
55
- MOCK_METHOD (void , onLiveWatershedChanged, (const bool enabled));
56
- MOCK_METHOD (void , onPlaybackWatershedChanged, (const bool enabled));
57
- MOCK_METHOD (void , onBlockNotRatedContentChanged, (const bool enabled));
58
- MOCK_METHOD (void , onPinOnPurchaseChanged, (const bool enabled));
55
+ MOCK_METHOD (void , onLiveWatershedChanged, (const bool liveWatershed));
56
+ MOCK_METHOD (void , onPlaybackWatershedChanged, (const bool playbackWatershed));
57
+ MOCK_METHOD (void , onBlockNotRatedContentChanged, (const bool blockNotRatedContent));
58
+ MOCK_METHOD (void , onPinOnPurchaseChanged, (const bool pinOnPurchase));
59
+
59
60
};
60
61
61
62
class NotificationHandler : public Exchange ::IUserSettings::INotification {
@@ -149,11 +150,11 @@ class NotificationHandler : public Exchange::IUserSettings::INotification {
149
150
m_condition_variable.notify_one ();
150
151
}
151
152
152
- void OnPinControlChanged (const bool enabled ) override
153
+ void OnPinControlChanged (const bool pinControl ) override
153
154
{
154
155
TEST_LOG (" OnPinControlChanged event triggered ***\n " );
155
156
std::unique_lock<std::mutex> lock (m_mutex);
156
- std::string str = enabled ? " true" : " false" ;
157
+ std::string str = pinControl ? " true" : " false" ;
157
158
158
159
TEST_LOG (" OnPinControlChanged received: %s\n " , str.c_str ());
159
160
/* Notify the requester thread. */
@@ -185,47 +186,47 @@ class NotificationHandler : public Exchange::IUserSettings::INotification {
185
186
186
187
}
187
188
188
- void OnLiveWatershedChanged (const bool enabled ) override
189
+ void OnLiveWatershedChanged (const bool liveWatershed ) override
189
190
{
190
191
TEST_LOG (" OnLiveWatershedChanged event triggered ***\n " );
191
192
std::unique_lock<std::mutex> lock (m_mutex);
192
- std::string str = enabled ? " true" : " false" ;
193
+ std::string str = liveWatershed ? " true" : " false" ;
193
194
194
195
TEST_LOG (" OnLiveWatershedChanged received: %s\n " , str.c_str ());
195
196
/* Notify the requester thread. */
196
197
m_event_signalled |= UserSettings_onLiveWatershedChanged;
197
198
m_condition_variable.notify_one ();
198
199
}
199
200
200
- void OnPlaybackWatershedChanged (const bool enabled ) override
201
+ void OnPlaybackWatershedChanged (const bool playbackWatershed ) override
201
202
{
202
203
TEST_LOG (" OnPlaybackWatershedChanged event triggered ***\n " );
203
204
std::unique_lock<std::mutex> lock (m_mutex);
204
- std::string str = enabled ? " true" : " false" ;
205
+ std::string str = playbackWatershed ? " true" : " false" ;
205
206
206
207
TEST_LOG (" OnPlaybackWatershedChanged received: %s\n " , str.c_str ());
207
208
/* Notify the requester thread. */
208
209
m_event_signalled |= UserSettings_onPlaybackWatershedChanged;
209
210
m_condition_variable.notify_one ();
210
211
}
211
212
212
- void OnBlockNotRatedContentChanged (const bool enabled ) override
213
+ void OnBlockNotRatedContentChanged (const bool blockNotRatedContent ) override
213
214
{
214
215
TEST_LOG (" OnBlockNotRatedContentChanged event triggered ***\n " );
215
216
std::unique_lock<std::mutex> lock (m_mutex);
216
- std::string str = enabled ? " true" : " false" ;
217
+ std::string str = blockNotRatedContent ? " true" : " false" ;
217
218
218
219
TEST_LOG (" OnBlockNotRatedContentChanged received: %s\n " , str.c_str ());
219
220
/* Notify the requester thread. */
220
221
m_event_signalled |= UserSettings_onBlockNotRatedContentChanged;
221
222
m_condition_variable.notify_one ();
222
223
}
223
224
224
- void OnPinOnPurchaseChanged (const bool enabled ) override
225
+ void OnPinOnPurchaseChanged (const bool pinOnPurchase ) override
225
226
{
226
227
TEST_LOG (" OnPinOnPurchaseChanged event triggered ***\n " );
227
228
std::unique_lock<std::mutex> lock (m_mutex);
228
- std::string str = enabled ? " true" : " false" ;
229
+ std::string str = pinOnPurchase ? " true" : " false" ;
229
230
230
231
TEST_LOG (" OnPinOnPurchaseChanged received: %s\n " , str.c_str ());
231
232
/* Notify the requester thread. */
@@ -267,13 +268,13 @@ class UserSettingTest : public L2TestMocks {
267
268
void onCaptionsChanged (bool enabled);
268
269
void onPreferredCaptionsLanguagesChanged (const string preferredLanguages);
269
270
void onPreferredClosedCaptionServiceChanged (const string service);
270
- void onPinControlChanged (const bool enabled );
271
+ void onPinControlChanged (const bool pinControl );
271
272
void onViewingRestrictionsChanged (const string viewingRestrictions);
272
273
void onViewingRestrictionsWindowChanged (const string viewingRestrictionsWindow);
273
- void onLiveWatershedChanged (const bool enabled );
274
- void onPlaybackWatershedChanged (const bool enabled );
275
- void onBlockNotRatedContentChanged (const bool enabled );
276
- void onPinOnPurchaseChanged (const bool enabled );
274
+ void onLiveWatershedChanged (const bool liveWatershed );
275
+ void onPlaybackWatershedChanged (const bool playbackWatershed );
276
+ void onBlockNotRatedContentChanged (const bool blockNotRatedContent );
277
+ void onPinOnPurchaseChanged (const bool pinOnPurchase );
277
278
278
279
uint32_t WaitForRequestStatus (uint32_t timeout_ms,UserSettingsL2test_async_events_t expected_status);
279
280
uint32_t CreateUserSettingInterfaceObjectUsingComRPCConnection ();
@@ -463,11 +464,11 @@ void UserSettingTest::onPreferredClosedCaptionServiceChanged(const string servic
463
464
m_condition_variable.notify_one ();
464
465
}
465
466
466
- void UserSettingTest::onPinControlChanged (bool enabled )
467
+ void UserSettingTest::onPinControlChanged (bool pinControl )
467
468
{
468
469
TEST_LOG (" OnPinControlChanged event triggered ***\n " );
469
470
std::unique_lock<std::mutex> lock (m_mutex);
470
- std::string str = enabled ? " true" : " false" ;
471
+ std::string str = pinControl ? " true" : " false" ;
471
472
472
473
TEST_LOG (" OnPinControlChanged received: %s\n " , str.c_str ());
473
474
/* Notify the requester thread. */
@@ -499,47 +500,47 @@ void UserSettingTest::onViewingRestrictionsWindowChanged(const string viewingRes
499
500
500
501
}
501
502
502
- void UserSettingTest::onLiveWatershedChanged (const bool enabled )
503
+ void UserSettingTest::onLiveWatershedChanged (const bool liveWatershed )
503
504
{
504
505
TEST_LOG (" OnLiveWatershedChanged event triggered ***\n " );
505
506
std::unique_lock<std::mutex> lock (m_mutex);
506
- std::string str = enabled ? " true" : " false" ;
507
+ std::string str = liveWatershed ? " true" : " false" ;
507
508
508
509
TEST_LOG (" OnLiveWatershedChanged received: %s\n " , str.c_str ());
509
510
/* Notify the requester thread. */
510
511
m_event_signalled |= UserSettings_onLiveWatershedChanged;
511
512
m_condition_variable.notify_one ();
512
513
}
513
514
514
- void UserSettingTest::onPlaybackWatershedChanged (const bool enabled )
515
+ void UserSettingTest::onPlaybackWatershedChanged (const bool playbackWatershed )
515
516
{
516
517
TEST_LOG (" OnPlaybackWatershedChanged event triggered ***\n " );
517
518
std::unique_lock<std::mutex> lock (m_mutex);
518
- std::string str = enabled ? " true" : " false" ;
519
+ std::string str = playbackWatershed ? " true" : " false" ;
519
520
520
521
TEST_LOG (" OnPlaybackWatershedChanged received: %s\n " , str.c_str ());
521
522
/* Notify the requester thread. */
522
523
m_event_signalled |= UserSettings_onPlaybackWatershedChanged;
523
524
m_condition_variable.notify_one ();
524
525
}
525
526
526
- void UserSettingTest::onBlockNotRatedContentChanged (const bool enabled )
527
+ void UserSettingTest::onBlockNotRatedContentChanged (const bool blockNotRatedContent )
527
528
{
528
529
TEST_LOG (" OnBlockNotRatedContentChanged event triggered ***\n " );
529
530
std::unique_lock<std::mutex> lock (m_mutex);
530
- std::string str = enabled ? " true" : " false" ;
531
+ std::string str = blockNotRatedContent ? " true" : " false" ;
531
532
532
533
TEST_LOG (" OnBlockNotRatedContentChanged received: %s\n " , str.c_str ());
533
534
/* Notify the requester thread. */
534
535
m_event_signalled |= UserSettings_onBlockNotRatedContentChanged;
535
536
m_condition_variable.notify_one ();
536
537
}
537
538
538
- void UserSettingTest::onPinOnPurchaseChanged (const bool enabled )
539
+ void UserSettingTest::onPinOnPurchaseChanged (const bool pinOnPurchase )
539
540
{
540
541
TEST_LOG (" OnPinOnPurchaseChanged event triggered ***\n " );
541
542
std::unique_lock<std::mutex> lock (m_mutex);
542
- std::string str = enabled ? " true" : " false" ;
543
+ std::string str = pinOnPurchase ? " true" : " false" ;
543
544
544
545
TEST_LOG (" OnPinOnPurchaseChanged received: %s\n " , str.c_str ());
545
546
/* Notify the requester thread. */
@@ -893,6 +894,12 @@ TEST_F(UserSettingTest, SetAndGetMethodsUsingJsonRpcConnectionSuccessCase)
893
894
uint32_t signalled = UserSettings_StateInvalid;
894
895
895
896
bool enabled = true ;
897
+ bool pinControl = true ;
898
+ bool liveWatershed = true ;
899
+ bool playbackWatershed = true ;
900
+ bool blockNotRatedContent = true ;
901
+ bool pinOnPurchase = true ;
902
+
896
903
string preferredLanguages = " en" ;
897
904
string presentationLanguage = " fra" ;
898
905
string preferredCaptionsLanguages = " en,es" ;
@@ -1059,16 +1066,16 @@ TEST_F(UserSettingTest, SetAndGetMethodsUsingJsonRpcConnectionSuccessCase)
1059
1066
status = jsonrpc.Subscribe <JsonObject>(JSON_TIMEOUT,
1060
1067
_T (" onPinControlChanged" ),
1061
1068
[this , &async_handler](const JsonObject& parameters) {
1062
- bool enabled = parameters[" enabled " ].Boolean ();
1063
- async_handler.onPinControlChanged (enabled );
1069
+ bool pinControl = parameters[" pinControl " ].Boolean ();
1070
+ async_handler.onPinControlChanged (pinControl );
1064
1071
});
1065
1072
EXPECT_EQ (Core::ERROR_NONE, status);
1066
1073
1067
- EXPECT_CALL (async_handler, onPinControlChanged (MatchRequestStatusBool (enabled )))
1074
+ EXPECT_CALL (async_handler, onPinControlChanged (MatchRequestStatusBool (pinControl )))
1068
1075
.WillOnce (Invoke (this , &UserSettingTest::onPinControlChanged));
1069
1076
1070
1077
JsonObject paramsPinControl;
1071
- paramsPinControl[" enabled " ] = true ;
1078
+ paramsPinControl[" pinControl " ] = true ;
1072
1079
status = InvokeServiceMethod (" org.rdk.UserSettings" , " setPinControl" , paramsPinControl, result_json);
1073
1080
EXPECT_EQ (status,Core::ERROR_NONE);
1074
1081
@@ -1139,16 +1146,16 @@ TEST_F(UserSettingTest, SetAndGetMethodsUsingJsonRpcConnectionSuccessCase)
1139
1146
status = jsonrpc.Subscribe <JsonObject>(JSON_TIMEOUT,
1140
1147
_T (" onLiveWatershedChanged" ),
1141
1148
[this , &async_handler](const JsonObject& parameters) {
1142
- bool enabled = parameters[" enabled " ].Boolean ();
1143
- async_handler.onLiveWatershedChanged (enabled );
1149
+ bool liveWatershed = parameters[" liveWatershed " ].Boolean ();
1150
+ async_handler.onLiveWatershedChanged (liveWatershed );
1144
1151
});
1145
1152
EXPECT_EQ (Core::ERROR_NONE, status);
1146
1153
1147
- EXPECT_CALL (async_handler, onLiveWatershedChanged (MatchRequestStatusBool (enabled )))
1154
+ EXPECT_CALL (async_handler, onLiveWatershedChanged (MatchRequestStatusBool (liveWatershed )))
1148
1155
.WillOnce (Invoke (this , &UserSettingTest::onLiveWatershedChanged));
1149
1156
1150
1157
JsonObject paramsLiveWatershed;
1151
- paramsLiveWatershed[" enabled " ] = true ;
1158
+ paramsLiveWatershed[" liveWatershed " ] = true ;
1152
1159
status = InvokeServiceMethod (" org.rdk.UserSettings" , " setLiveWatershed" , paramsLiveWatershed, result_json);
1153
1160
EXPECT_EQ (status,Core::ERROR_NONE);
1154
1161
@@ -1167,16 +1174,16 @@ TEST_F(UserSettingTest, SetAndGetMethodsUsingJsonRpcConnectionSuccessCase)
1167
1174
status = jsonrpc.Subscribe <JsonObject>(JSON_TIMEOUT,
1168
1175
_T (" onPlaybackWatershedChanged" ),
1169
1176
[this , &async_handler](const JsonObject& parameters) {
1170
- bool enabled = parameters[" enabled " ].Boolean ();
1171
- async_handler.onPlaybackWatershedChanged (enabled );
1177
+ bool playbackWatershed = parameters[" playbackWatershed " ].Boolean ();
1178
+ async_handler.onPlaybackWatershedChanged (playbackWatershed );
1172
1179
});
1173
1180
EXPECT_EQ (Core::ERROR_NONE, status);
1174
1181
1175
- EXPECT_CALL (async_handler, onPlaybackWatershedChanged (MatchRequestStatusBool (enabled )))
1182
+ EXPECT_CALL (async_handler, onPlaybackWatershedChanged (MatchRequestStatusBool (playbackWatershed )))
1176
1183
.WillOnce (Invoke (this , &UserSettingTest::onPlaybackWatershedChanged));
1177
1184
1178
1185
JsonObject paramsPlaybackWatershed;
1179
- paramsPlaybackWatershed[" enabled " ] = true ;
1186
+ paramsPlaybackWatershed[" playbackWatershed " ] = true ;
1180
1187
status = InvokeServiceMethod (" org.rdk.UserSettings" , " setPlaybackWatershed" , paramsPlaybackWatershed, result_json);
1181
1188
EXPECT_EQ (status,Core::ERROR_NONE);
1182
1189
@@ -1195,16 +1202,16 @@ TEST_F(UserSettingTest, SetAndGetMethodsUsingJsonRpcConnectionSuccessCase)
1195
1202
status = jsonrpc.Subscribe <JsonObject>(JSON_TIMEOUT,
1196
1203
_T (" onBlockNotRatedContentChanged" ),
1197
1204
[this , &async_handler](const JsonObject& parameters) {
1198
- bool enabled = parameters[" enabled " ].Boolean ();
1199
- async_handler.onBlockNotRatedContentChanged (enabled );
1205
+ bool blockNotRatedContent = parameters[" blockNotRatedContent " ].Boolean ();
1206
+ async_handler.onBlockNotRatedContentChanged (blockNotRatedContent );
1200
1207
});
1201
1208
EXPECT_EQ (Core::ERROR_NONE, status);
1202
1209
1203
- EXPECT_CALL (async_handler, onBlockNotRatedContentChanged (MatchRequestStatusBool (enabled )))
1210
+ EXPECT_CALL (async_handler, onBlockNotRatedContentChanged (MatchRequestStatusBool (blockNotRatedContent )))
1204
1211
.WillOnce (Invoke (this , &UserSettingTest::onBlockNotRatedContentChanged));
1205
1212
1206
1213
JsonObject paramsBlockNotRatedContent;
1207
- paramsBlockNotRatedContent[" enabled " ] = true ;
1214
+ paramsBlockNotRatedContent[" blockNotRatedContent " ] = true ;
1208
1215
status = InvokeServiceMethod (" org.rdk.UserSettings" , " setBlockNotRatedContent" , paramsBlockNotRatedContent, result_json);
1209
1216
EXPECT_EQ (status,Core::ERROR_NONE);
1210
1217
@@ -1223,16 +1230,16 @@ TEST_F(UserSettingTest, SetAndGetMethodsUsingJsonRpcConnectionSuccessCase)
1223
1230
status = jsonrpc.Subscribe <JsonObject>(JSON_TIMEOUT,
1224
1231
_T (" onPinOnPurchaseChanged" ),
1225
1232
[this , &async_handler](const JsonObject& parameters) {
1226
- bool enabled = parameters[" enabled " ].Boolean ();
1227
- async_handler.onPinOnPurchaseChanged (enabled );
1233
+ bool pinOnPurchase = parameters[" pinOnPurchase " ].Boolean ();
1234
+ async_handler.onPinOnPurchaseChanged (pinOnPurchase );
1228
1235
});
1229
1236
EXPECT_EQ (Core::ERROR_NONE, status);
1230
1237
1231
- EXPECT_CALL (async_handler, onPinOnPurchaseChanged (MatchRequestStatusBool (enabled )))
1238
+ EXPECT_CALL (async_handler, onPinOnPurchaseChanged (MatchRequestStatusBool (pinOnPurchase )))
1232
1239
.WillOnce (Invoke (this , &UserSettingTest::onPinOnPurchaseChanged));
1233
1240
1234
1241
JsonObject paramsPinOnPurchase;
1235
- paramsPinOnPurchase[" enabled " ] = true ;
1242
+ paramsPinOnPurchase[" pinOnPurchase " ] = true ;
1236
1243
status = InvokeServiceMethod (" org.rdk.UserSettings" , " setPinOnPurchase" , paramsPinOnPurchase, result_json);
1237
1244
EXPECT_EQ (status,Core::ERROR_NONE);
1238
1245
0 commit comments