summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrii Kalinich <AKalinich@luxoft.com>2018-07-04 16:21:18 +0300
committerAndrii Kalinich <AKalinich@luxoft.com>2018-07-04 16:21:18 +0300
commit6371b7b64145971fbf31c5f0e20de83f2d5d73bb (patch)
treeb90bfce6014bcce2c13f81e78e2e59d379bf0b50
parent56b01ce0d32d1a4059125a350ad108d35c529c9f (diff)
downloadsdl_core-6371b7b64145971fbf31c5f0e20de83f2d5d73bb.tar.gz
Added expectations for affected unit tests
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_global_properties_test.cc35
-rw-r--r--src/components/application_manager/test/application_manager_impl_test.cc2
-rw-r--r--src/components/application_manager/test/resumption/resume_ctrl_test.cc3
3 files changed, 40 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 e6811e2252..f39ccf7be3 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
@@ -147,6 +147,8 @@ class SetGlobalPropertiesRequestTest
EXPECT_CALL(*mock_app_, help_prompt_manager())
.WillRepeatedly(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, false));
command->Run();
}
@@ -178,6 +180,8 @@ class SetGlobalPropertiesRequestTest
EXPECT_CALL(*mock_app_, help_prompt_manager())
.WillRepeatedly(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, false));
command->Run();
}
@@ -307,6 +311,8 @@ TEST_F(SetGlobalPropertiesRequestTest,
EXPECT_CALL(*mock_app_, help_prompt_manager())
.WillRepeatedly(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, false)).Times(2);
EXPECT_CALL(
mock_message_helper_,
@@ -327,6 +333,9 @@ TEST_F(SetGlobalPropertiesRequestTest,
event_vr.set_smart_object(*msg_vr);
command->Run();
+
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, true));
command->on_event(event_vr);
MessageSharedPtr ui_command_result;
@@ -334,6 +343,8 @@ TEST_F(SetGlobalPropertiesRequestTest,
mock_rpc_service_,
ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
.WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, true));
command->on_event(event);
@@ -357,6 +368,8 @@ TEST_F(SetGlobalPropertiesRequestTest, OnEvent_SUCCESS_Expect_MessageNotSend) {
EXPECT_CALL(*mock_app, help_prompt_manager())
.WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, true));
EXPECT_CALL(
mock_rpc_service_,
@@ -396,6 +409,9 @@ TEST_F(SetGlobalPropertiesRequestTest,
.WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
command->Run();
+
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, true)).Times(2);
command->on_event(event_ui);
command->on_event(event_tts);
@@ -465,6 +481,8 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_VRWithMenuAndKeyboard_SUCCESS) {
EXPECT_CALL(*mock_app_, help_prompt_manager())
.WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, false));
SharedPtr<SetGlobalPropertiesRequest> command(
CreateCommand<SetGlobalPropertiesRequest>(msg));
@@ -720,6 +738,8 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_TTSHelpAndTimeout_SUCCESS) {
EXPECT_CALL(*mock_app_, help_prompt_manager())
.WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, false));
SharedPtr<SetGlobalPropertiesRequest> command(
CreateCommand<SetGlobalPropertiesRequest>(msg));
@@ -753,6 +773,8 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_TTSOnlyHelp_SUCCESS) {
.WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
EXPECT_CALL(*mock_app_, help_prompt_manager())
.WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, false));
SharedPtr<SetGlobalPropertiesRequest> command(
CreateCommand<SetGlobalPropertiesRequest>(msg));
@@ -785,6 +807,8 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_TTSOnlyTimeout_SUCCESS) {
.WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
EXPECT_CALL(*mock_app_, help_prompt_manager())
.WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, false));
SharedPtr<SetGlobalPropertiesRequest> command(
CreateCommand<SetGlobalPropertiesRequest>(msg));
@@ -978,6 +1002,8 @@ TEST_F(SetGlobalPropertiesRequestTest, OnEvent_PendingRequest_UNSUCCESS) {
EXPECT_CALL(*mock_app_, help_prompt_manager())
.WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, true));
command->on_event(event);
}
@@ -1006,6 +1032,9 @@ TEST_F(SetGlobalPropertiesRequestTest, OnEvent_UIAndSuccessResultCode_SUCCESS) {
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, true));
+
EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
.WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
EXPECT_CALL(mock_rpc_service_,
@@ -1038,6 +1067,8 @@ TEST_F(SetGlobalPropertiesRequestTest, OnEvent_UIAndWarningResultCode_SUCCESS) {
Event event(hmi_apis::FunctionID::UI_SetGlobalProperties);
event.set_smart_object(*msg);
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, true));
EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
.WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
EXPECT_CALL(mock_rpc_service_,
@@ -1114,6 +1145,8 @@ TEST_F(SetGlobalPropertiesRequestTest,
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(_, am::commands::Command::SOURCE_SDL))
.WillOnce(Return(true));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, true));
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(mock_app_));
@@ -1156,6 +1189,8 @@ TEST_F(SetGlobalPropertiesRequestTest,
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, true));
Event event(hmi_apis::FunctionID::TTS_SetGlobalProperties);
event.set_smart_object(*msg);
diff --git a/src/components/application_manager/test/application_manager_impl_test.cc b/src/components/application_manager/test/application_manager_impl_test.cc
index 276c6bb0d5..7c373476de 100644
--- a/src/components/application_manager/test/application_manager_impl_test.cc
+++ b/src/components/application_manager/test/application_manager_impl_test.cc
@@ -813,6 +813,7 @@ TEST_F(ApplicationManagerImplTest,
EXPECT_CALL(*switching_app_ptr, help_prompt_manager())
.WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_, OnAppUnregistered());
app_manager_impl_->OnDeviceSwitchingFinish(switching_device_id);
EXPECT_FALSE(
@@ -960,6 +961,7 @@ TEST_F(ApplicationManagerImplTest, UnregisterAnotherAppDuringAudioPassThru) {
EXPECT_CALL(*mock_app_1, help_prompt_manager())
.WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_, OnAppUnregistered());
// while running APT, app 1 is unregistered
app_manager_impl_->UnregisterApplication(
diff --git a/src/components/application_manager/test/resumption/resume_ctrl_test.cc b/src/components/application_manager/test/resumption/resume_ctrl_test.cc
index 15cee975da..9320bb4fdb 100644
--- a/src/components/application_manager/test/resumption/resume_ctrl_test.cc
+++ b/src/components/application_manager/test/resumption/resume_ctrl_test.cc
@@ -577,6 +577,7 @@ TEST_F(ResumeCtrlTest, StartAppHmiStateResumption_AppInFull) {
.WillByDefault(Return(policy::kDeviceAllowed));
EXPECT_CALL(*mock_app_, help_prompt_manager())
.WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_, OnAppActivated(true));
res_ctrl_->StartAppHmiStateResumption(mock_app_);
}
@@ -628,6 +629,7 @@ TEST_F(ResumeCtrlTest, RestoreAppHMIState_RestoreHMILevelFull) {
EXPECT_CALL(*mock_app_, set_is_resuming(true));
EXPECT_CALL(*mock_app_, help_prompt_manager())
.WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_, OnAppActivated(true));
const bool res = res_ctrl_->RestoreAppHMIState(mock_app_);
EXPECT_TRUE(res);
@@ -687,6 +689,7 @@ TEST_F(ResumeCtrlTest, ApplicationResumptiOnTimer_AppInFull) {
.WillByDefault(Return(policy::kDeviceAllowed));
EXPECT_CALL(*mock_app_, help_prompt_manager())
.WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_, OnAppActivated(true));
res_ctrl_->StartAppHmiStateResumption(mock_app_);
}