diff options
author | Sho Amano <samano@xevo.com> | 2018-04-12 10:31:19 +0900 |
---|---|---|
committer | Sho Amano <samano@xevo.com> | 2018-04-12 10:31:19 +0900 |
commit | df177018a0081f82cf747f239153a386e2ba114f (patch) | |
tree | 3b373481280254271d597e200f36f223c1b480b3 /src/components/application_manager/test/application_impl_test.cc | |
parent | f9d0a8c9d9117b91deda42c9c9148bd5917e6dd2 (diff) | |
parent | 194d725d51eb2db4bd5cac28c58d78a9a1b4bf74 (diff) | |
download | sdl_core-df177018a0081f82cf747f239153a386e2ba114f.tar.gz |
Merge remote-tracking branch 't-yoshii/fix/do-not-allow-streaming-state-change-after-lost-approval' into feat/mt_transport_changes
Diffstat (limited to 'src/components/application_manager/test/application_impl_test.cc')
-rw-r--r-- | src/components/application_manager/test/application_impl_test.cc | 62 |
1 files changed, 58 insertions, 4 deletions
diff --git a/src/components/application_manager/test/application_impl_test.cc b/src/components/application_manager/test/application_impl_test.cc index 6b7f78b8f7..751376cddc 100644 --- a/src/components/application_manager/test/application_impl_test.cc +++ b/src/components/application_manager/test/application_impl_test.cc @@ -731,7 +731,8 @@ TEST_F(ApplicationImplTest, StartStreaming_StreamingApproved) { app_impl->StartStreaming(protocol_handler::ServiceType::kAudio); } -TEST_F(ApplicationImplTest, SuspendNaviStreaming) { +TEST_F(ApplicationImplTest, SuspendNaviStreaming_StreamingApproved) { + app_impl->set_video_streaming_approved(true); protocol_handler::ServiceType type = protocol_handler::ServiceType::kMobileNav; EXPECT_CALL(mock_application_manager_, OnAppStreaming(app_id, type, false)); @@ -740,7 +741,8 @@ TEST_F(ApplicationImplTest, SuspendNaviStreaming) { app_impl->SuspendStreaming(type); } -TEST_F(ApplicationImplTest, SuspendAudioStreaming) { +TEST_F(ApplicationImplTest, SuspendAudioStreaming_StreamingApproved) { + app_impl->set_audio_streaming_approved(true); protocol_handler::ServiceType type = protocol_handler::ServiceType::kAudio; EXPECT_CALL(mock_application_manager_, OnAppStreaming(app_id, type, false)); EXPECT_CALL(*MockMessageHelper::message_helper_mock(), @@ -748,8 +750,28 @@ TEST_F(ApplicationImplTest, SuspendAudioStreaming) { app_impl->SuspendStreaming(type); } +TEST_F(ApplicationImplTest, SuspendNaviStreaming_StreamingNotApproved) { + app_impl->set_video_streaming_approved(false); + protocol_handler::ServiceType type = + protocol_handler::ServiceType::kMobileNav; + EXPECT_CALL(mock_application_manager_, OnAppStreaming(app_id, type, false)); + EXPECT_CALL(*MockMessageHelper::message_helper_mock(), + SendOnDataStreaming(type, false, _)).Times(0); + app_impl->SuspendStreaming(type); +} + +TEST_F(ApplicationImplTest, SuspendAudioStreaming_StreamingNotApproved) { + app_impl->set_audio_streaming_approved(false); + protocol_handler::ServiceType type = protocol_handler::ServiceType::kAudio; + EXPECT_CALL(mock_application_manager_, OnAppStreaming(app_id, type, false)); + EXPECT_CALL(*MockMessageHelper::message_helper_mock(), + SendOnDataStreaming(type, false, _)).Times(0); + app_impl->SuspendStreaming(type); +} + // TODO {AKozoriz} : Fix tests with streaming (APPLINK-19289) -TEST_F(ApplicationImplTest, DISABLED_Suspend_WakeUpAudioStreaming) { +TEST_F(ApplicationImplTest, Suspend_WakeUpAudioStreaming_StreamingApproved) { + app_impl->set_audio_streaming_approved(true); protocol_handler::ServiceType type = protocol_handler::ServiceType::kAudio; EXPECT_CALL(mock_application_manager_, OnAppStreaming(app_id, type, false)); EXPECT_CALL(*MockMessageHelper::message_helper_mock(), @@ -762,7 +784,8 @@ TEST_F(ApplicationImplTest, DISABLED_Suspend_WakeUpAudioStreaming) { app_impl->WakeUpStreaming(type); } -TEST_F(ApplicationImplTest, DISABLED_Suspend_WakeUpNaviStreaming) { +TEST_F(ApplicationImplTest, Suspend_WakeUpNaviStreaming_StreamingApproved) { + app_impl->set_video_streaming_approved(true); protocol_handler::ServiceType type = protocol_handler::ServiceType::kMobileNav; EXPECT_CALL(mock_application_manager_, OnAppStreaming(app_id, type, false)); @@ -776,6 +799,37 @@ TEST_F(ApplicationImplTest, DISABLED_Suspend_WakeUpNaviStreaming) { app_impl->WakeUpStreaming(type); } +TEST_F(ApplicationImplTest, Suspend_WakeUpAudioStreaming_StreamingNotApproved) { + app_impl->set_audio_streaming_approved(false); + protocol_handler::ServiceType type = protocol_handler::ServiceType::kAudio; + EXPECT_CALL(mock_application_manager_, OnAppStreaming(app_id, type, false)); + EXPECT_CALL(*MockMessageHelper::message_helper_mock(), + SendOnDataStreaming(type, false, _)).Times(0); + app_impl->SuspendStreaming(type); + + EXPECT_CALL(mock_application_manager_, + OnAppStreaming(app_id, type, true)).Times(0); + EXPECT_CALL(*MockMessageHelper::message_helper_mock(), + SendOnDataStreaming(type, true, _)).Times(0); + app_impl->WakeUpStreaming(type); +} + +TEST_F(ApplicationImplTest, Suspend_WakeUpNaviStreaming_StreamingNotApproved) { + app_impl->set_video_streaming_approved(false); + protocol_handler::ServiceType type = + protocol_handler::ServiceType::kMobileNav; + EXPECT_CALL(mock_application_manager_, OnAppStreaming(app_id, type, false)); + EXPECT_CALL(*MockMessageHelper::message_helper_mock(), + SendOnDataStreaming(type, false, _)).Times(0); + app_impl->SuspendStreaming(type); + + EXPECT_CALL(mock_application_manager_, + OnAppStreaming(app_id, type, true)).Times(0); + EXPECT_CALL(*MockMessageHelper::message_helper_mock(), + SendOnDataStreaming(type, true, _)).Times(0); + app_impl->WakeUpStreaming(type); +} + TEST_F(ApplicationImplTest, StopStreaming_StreamingApproved) { // Stop navigation streaming protocol_handler::ServiceType type = |