diff options
author | jacobkeeler <jacob.keeler@livioradio.com> | 2021-02-17 15:12:43 -0500 |
---|---|---|
committer | jacobkeeler <jacob.keeler@livioradio.com> | 2021-02-17 15:12:43 -0500 |
commit | 72f2215d04e4d3725916decda1b5285326856365 (patch) | |
tree | 112799302c24f8c1dce11027c8d5778d23b2d29b | |
parent | a1ad3c74c56c722a0e5958d6c70a0709b4808e8d (diff) | |
download | sdl_core-fix/reset_keyboard_properties.tar.gz |
Update Unit Testsfix/reset_keyboard_properties
-rw-r--r-- | src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_global_properties_test.cc | 41 |
1 files changed, 41 insertions, 0 deletions
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 @@ -1523,6 +1523,47 @@ TEST_F(SetGlobalPropertiesRequestTest, } 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<SetGlobalPropertiesRequest> command( + CreateCommand<SetGlobalPropertiesRequest>(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<SetGlobalPropertiesRequest> command( + CreateCommand<SetGlobalPropertiesRequest>(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(); |