From 72f2215d04e4d3725916decda1b5285326856365 Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Wed, 17 Feb 2021 15:12:43 -0500 Subject: Update Unit Tests --- .../commands/mobile/set_global_properties_test.cc | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_global_properties_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_global_properties_test.cc index e7e155ec48..4272005fba 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_global_properties_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_global_properties_test.cc @@ -1522,6 +1522,47 @@ TEST_F(SetGlobalPropertiesRequestTest, command->Run(); } +TEST_F(SetGlobalPropertiesRequestTest, + Run_RequestContainsMaskInputCharactersParam_KeyboardPropsCachedAsIs) { + MessageSharedPtr msg = CreateMsgParams(); + auto& keyboard_properties = + (*msg)[am::strings::msg_params][am::strings::keyboard_properties]; + keyboard_properties[am::hmi_request::mask_input_characters] = + hmi_apis::Common_KeyboardInputMask::ENABLE_INPUT_KEY_MASK; + + std::shared_ptr command( + CreateCommand(msg)); + + EXPECT_CALL(*mock_app_, set_keyboard_props(keyboard_properties)); + + command->Run(); +} + +TEST_F( + SetGlobalPropertiesRequestTest, + Run_NoMaskInputCharactersInRequestButPresentInSaved_SavedParamCachedAgain) { + MessageSharedPtr msg = CreateMsgParams(); + + ON_CALL(app_mngr_, application(kConnectionKey)) + .WillByDefault(Return(mock_app_)); + auto saved_keyboard_props = SmartObject(smart_objects::SmartType_Map); + saved_keyboard_props[am::hmi_request::mask_input_characters] = + hmi_apis::Common_KeyboardInputMask::USER_CHOICE_INPUT_KEY_MASK; + EXPECT_CALL(*mock_app_, keyboard_props()) + .WillRepeatedly(Return(&saved_keyboard_props)); + + std::shared_ptr command( + CreateCommand(msg)); + + auto cached_keyboard_props = + (*msg)[am::strings::msg_params][am::strings::keyboard_properties]; + cached_keyboard_props[am::hmi_request::mask_input_characters] = + hmi_apis::Common_KeyboardInputMask::USER_CHOICE_INPUT_KEY_MASK; + EXPECT_CALL(*mock_app_, set_keyboard_props(cached_keyboard_props)); + + command->Run(); +} + TEST_F(SetGlobalPropertiesRequestTest, Run_NoAutocompleteListInRequestButPresentInSaved_SavedArrayCachedAgain) { MessageSharedPtr msg = CreateMsgParams(); -- cgit v1.2.1