summaryrefslogtreecommitdiff
path: root/src/components/application_manager/test/commands/mobile/perform_audio_pass_thru_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/application_manager/test/commands/mobile/perform_audio_pass_thru_test.cc')
-rw-r--r--src/components/application_manager/test/commands/mobile/perform_audio_pass_thru_test.cc41
1 files changed, 29 insertions, 12 deletions
diff --git a/src/components/application_manager/test/commands/mobile/perform_audio_pass_thru_test.cc b/src/components/application_manager/test/commands/mobile/perform_audio_pass_thru_test.cc
index 6c35a5372a..a27bac970c 100644
--- a/src/components/application_manager/test/commands/mobile/perform_audio_pass_thru_test.cc
+++ b/src/components/application_manager/test/commands/mobile/perform_audio_pass_thru_test.cc
@@ -128,6 +128,8 @@ class PerformAudioPassThruRequestTest
ON_CALL(app_mngr_, application(kConnectionKey))
.WillByDefault(Return(mock_app_));
ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
command_sptr_ =
CreateCommand<am::commands::PerformAudioPassThruRequest>(message_);
@@ -160,10 +162,15 @@ TEST_F(PerformAudioPassThruRequestTest, OnTimeout_GENERIC_ERROR) {
am::mobile_api::Result::GENERIC_ERROR;
(*msg_ui)[am::strings::msg_params][am::strings::success] = false;
+ MessageSharedPtr message =
+ utils::MakeShared<SmartObject>(::smart_objects::SmartType_Map);
+ (*message)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+
utils::SharedPtr<PerformAudioPassThruRequest> command =
- CreateCommand<PerformAudioPassThruRequest>();
+ CreateCommand<PerformAudioPassThruRequest>(message);
- EXPECT_CALL(app_mngr_, EndAudioPassThrough()).WillOnce(Return(true));
+ uint32_t app_id = kConnectionKey;
+ EXPECT_CALL(app_mngr_, EndAudioPassThru(app_id)).WillOnce(Return(true));
EXPECT_CALL(app_mngr_, StopAudioPassThru(_));
EXPECT_CALL(
@@ -232,7 +239,8 @@ TEST_F(PerformAudioPassThruRequestTest,
event_ui.set_smart_object(*response_ui);
MessageSharedPtr response_to_mobile;
- EXPECT_CALL(app_mngr_, EndAudioPassThrough()).WillOnce(Return(false));
+ uint32_t app_id = kConnectionKey;
+ EXPECT_CALL(app_mngr_, EndAudioPassThru(app_id)).WillOnce(Return(false));
EXPECT_CALL(app_mngr_, ManageHMICommand(_)).WillRepeatedly(Return(true));
EXPECT_CALL(
app_mngr_,
@@ -362,7 +370,8 @@ TEST_F(PerformAudioPassThruRequestTest,
hmi_apis::Common_Result::GENERIC_ERROR;
event.set_smart_object(*message_);
- EXPECT_CALL(app_mngr_, EndAudioPassThrough()).WillOnce(Return(false));
+ uint32_t app_id = kConnectionKey;
+ EXPECT_CALL(app_mngr_, EndAudioPassThru(app_id)).WillOnce(Return(false));
ON_CALL(app_mngr_, GetNextHMICorrelationID())
.WillByDefault(Return(kCorrelationId));
@@ -536,7 +545,8 @@ TEST_F(
}
// Start microphone recording cals
- EXPECT_CALL(app_mngr_, BeginAudioPassThrough());
+ uint32_t app_id = kConnectionKey;
+ EXPECT_CALL(app_mngr_, BeginAudioPassThru(app_id));
EXPECT_CALL(app_mngr_, StartAudioPassThruThread(_, _, _, _, _, _));
CallRun caller(*command_sptr_);
@@ -581,7 +591,8 @@ TEST_F(PerformAudioPassThruRequestTest,
EXPECT_CALL(app_mngr_, ManageHMICommand(_)).WillOnce(Return(true));
// Start microphone recording cals
- EXPECT_CALL(app_mngr_, BeginAudioPassThrough());
+ uint32_t app_id = kConnectionKey;
+ EXPECT_CALL(app_mngr_, BeginAudioPassThru(app_id));
EXPECT_CALL(app_mngr_, StartAudioPassThruThread(_, _, _, _, _, _));
EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _));
@@ -617,7 +628,8 @@ TEST_F(PerformAudioPassThruRequestTest,
caller_speak();
// Second call for test correct behavior of UI_PerformAudioPassThru event
- EXPECT_CALL(app_mngr_, EndAudioPassThrough()).WillOnce(Return(false));
+ uint32_t app_id = kConnectionKey;
+ EXPECT_CALL(app_mngr_, EndAudioPassThru(app_id)).WillOnce(Return(false));
EXPECT_CALL(app_mngr_, StopAudioPassThru(_)).Times(0);
ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
.WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
@@ -641,7 +653,8 @@ TEST_F(PerformAudioPassThruRequestTest,
EXPECT_CALL(app_mngr_, ManageHMICommand(_)).WillOnce(Return(true));
- EXPECT_CALL(app_mngr_, BeginAudioPassThrough()).WillOnce(Return(true));
+ uint32_t app_id = kConnectionKey;
+ EXPECT_CALL(app_mngr_, BeginAudioPassThru(app_id)).WillOnce(Return(true));
EXPECT_CALL(
app_mngr_,
@@ -664,8 +677,9 @@ TEST_F(PerformAudioPassThruRequestTest,
msg_params_[am::strings::connection_key] = kConnectionKey;
msg_params_[am::strings::function_id] = kFunctionId;
+ uint32_t app_id = kConnectionKey;
EXPECT_CALL(app_mngr_, ManageHMICommand(_)).WillOnce(Return(true));
- EXPECT_CALL(app_mngr_, BeginAudioPassThrough()).WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_, BeginAudioPassThru(app_id)).WillOnce(Return(true));
EXPECT_CALL(
app_mngr_,
@@ -683,8 +697,9 @@ TEST_F(PerformAudioPassThruRequestTest,
TEST_F(PerformAudioPassThruRequestTest, OnEvent_DefaultCase) {
am::event_engine::Event event(hmi_apis::FunctionID::INVALID_ENUM);
+ uint32_t app_id = kConnectionKey;
EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0);
- EXPECT_CALL(app_mngr_, EndAudioPassThrough()).Times(0);
+ EXPECT_CALL(app_mngr_, EndAudioPassThru(app_id)).Times(0);
CallOnEvent caller(*command_sptr_, event);
caller();
@@ -703,7 +718,8 @@ TEST_F(PerformAudioPassThruRequestTest, Init_CorrectTimeout) {
TEST_F(PerformAudioPassThruRequestTest,
onTimeOut_ttsSpeakNotActive_DontSendHMIReqeust) {
- EXPECT_CALL(app_mngr_, EndAudioPassThrough()).WillOnce(Return(true));
+ uint32_t app_id = kConnectionKey;
+ EXPECT_CALL(app_mngr_, EndAudioPassThru(app_id)).WillOnce(Return(true));
EXPECT_CALL(app_mngr_, StopAudioPassThru(_));
// For setting current_state_ -> kCompleted
@@ -717,7 +733,8 @@ TEST_F(PerformAudioPassThruRequestTest,
TEST_F(PerformAudioPassThruRequestTest,
DISABLED_onTimeOut_ttsSpeakActive_SendHMIReqeust) {
- EXPECT_CALL(app_mngr_, EndAudioPassThrough()).WillOnce(Return(true));
+ uint32_t app_id = kConnectionKey;
+ EXPECT_CALL(app_mngr_, EndAudioPassThru(app_id)).WillOnce(Return(true));
EXPECT_CALL(app_mngr_, StopAudioPassThru(_));
EXPECT_CALL(*application_sptr_, hmi_level())