summaryrefslogtreecommitdiff
path: root/src/components/application_manager/test/application_manager_impl_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/application_manager/test/application_manager_impl_test.cc')
-rw-r--r--src/components/application_manager/test/application_manager_impl_test.cc66
1 files changed, 52 insertions, 14 deletions
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 aa82c6b86b..a70015c9ed 100644
--- a/src/components/application_manager/test/application_manager_impl_test.cc
+++ b/src/components/application_manager/test/application_manager_impl_test.cc
@@ -531,10 +531,16 @@ TEST_F(ApplicationManagerImplTest, OnServiceStartedCallback_VideoServiceStart) {
const protocol_handler::ServiceType service_type =
protocol_handler::ServiceType::kMobileNav;
const int32_t session_key = 123;
+ HmiStatePtr hmi_state(std::make_shared<HmiState>(
+ mock_app_ptr_, mock_app_mngr_, HmiState::STATE_ID_REGULAR));
+ hmi_state->set_video_streaming_state(
+ mobile_apis::VideoStreamingState::eType::STREAMABLE);
+ hmi_state->set_hmi_level(mobile_apis::HMILevel::HMI_FULL);
+
+ EXPECT_CALL(*mock_app_ptr_, CurrentHmiState(_))
+ .WillRepeatedly(Return(hmi_state));
EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key));
EXPECT_CALL(*mock_app_ptr_, is_navi()).WillRepeatedly(Return(true));
- EXPECT_CALL(*mock_app_ptr_, hmi_level(kDefaultWindowId))
- .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
bool result = false;
std::vector<std::string> rejected_params;
@@ -595,8 +601,14 @@ TEST_F(ApplicationManagerImplTest,
EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key));
EXPECT_CALL(*mock_app_ptr_, is_navi()).WillRepeatedly(Return(true));
// HMI level is not FULL nor LIMITED
- EXPECT_CALL(*mock_app_ptr_, hmi_level(kDefaultWindowId))
- .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_BACKGROUND));
+ HmiStatePtr hmi_state(std::make_shared<HmiState>(
+ mock_app_ptr_, mock_app_mngr_, HmiState::STATE_ID_REGULAR));
+ hmi_state->set_video_streaming_state(
+ mobile_apis::VideoStreamingState::eType::STREAMABLE);
+ hmi_state->set_hmi_level(mobile_apis::HMILevel::HMI_BACKGROUND);
+
+ EXPECT_CALL(*mock_app_ptr_, CurrentHmiState(_))
+ .WillRepeatedly(Return(hmi_state));
bool result = false;
std::vector<std::string> rejected_params;
@@ -625,8 +637,14 @@ TEST_F(ApplicationManagerImplTest,
const int32_t session_key = 123;
EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key));
EXPECT_CALL(*mock_app_ptr_, is_navi()).WillRepeatedly(Return(true));
- EXPECT_CALL(*mock_app_ptr_, hmi_level(kDefaultWindowId))
- .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_LIMITED));
+ HmiStatePtr hmi_state(std::make_shared<HmiState>(
+ mock_app_ptr_, mock_app_mngr_, HmiState::STATE_ID_REGULAR));
+ hmi_state->set_video_streaming_state(
+ mobile_apis::VideoStreamingState::eType::STREAMABLE);
+ hmi_state->set_hmi_level(mobile_apis::HMILevel::HMI_LIMITED);
+
+ EXPECT_CALL(*mock_app_ptr_, CurrentHmiState(_))
+ .WillRepeatedly(Return(hmi_state));
bool result = false;
std::vector<std::string> rejected_params;
@@ -709,8 +727,13 @@ TEST_F(ApplicationManagerImplTest,
const int32_t session_key = 123;
EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key));
EXPECT_CALL(*mock_app_ptr_, is_navi()).WillRepeatedly(Return(true));
- EXPECT_CALL(*mock_app_ptr_, hmi_level(kDefaultWindowId))
- .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
+ HmiStatePtr hmi_state(std::make_shared<HmiState>(
+ mock_app_ptr_, mock_app_mngr_, HmiState::STATE_ID_REGULAR));
+ hmi_state->set_video_streaming_state(
+ mobile_apis::VideoStreamingState::eType::STREAMABLE);
+ hmi_state->set_hmi_level(mobile_apis::HMILevel::HMI_FULL);
+ EXPECT_CALL(*mock_app_ptr_, CurrentHmiState(_))
+ .WillRepeatedly(Return(hmi_state));
bool result = false;
std::vector<std::string> rejected_params;
@@ -783,8 +806,13 @@ TEST_F(ApplicationManagerImplTest,
const int32_t session_key = 123;
EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key));
EXPECT_CALL(*mock_app_ptr_, is_navi()).WillRepeatedly(Return(true));
- EXPECT_CALL(*mock_app_ptr_, hmi_level(kDefaultWindowId))
- .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
+ HmiStatePtr hmi_state(std::make_shared<HmiState>(
+ mock_app_ptr_, mock_app_mngr_, HmiState::STATE_ID_REGULAR));
+ hmi_state->set_video_streaming_state(
+ mobile_apis::VideoStreamingState::eType::STREAMABLE);
+ hmi_state->set_hmi_level(mobile_apis::HMILevel::HMI_FULL);
+ EXPECT_CALL(*mock_app_ptr_, CurrentHmiState(_))
+ .WillRepeatedly(Return(hmi_state));
bool result = false;
std::vector<std::string> rejected_params;
@@ -818,8 +846,13 @@ TEST_F(ApplicationManagerImplTest, OnServiceStartedCallback_AudioServiceStart) {
const int32_t session_key = 123;
EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key));
EXPECT_CALL(*mock_app_ptr_, is_navi()).WillRepeatedly(Return(true));
- EXPECT_CALL(*mock_app_ptr_, hmi_level(kDefaultWindowId))
- .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
+ HmiStatePtr hmi_state(std::make_shared<HmiState>(
+ mock_app_ptr_, mock_app_mngr_, HmiState::STATE_ID_REGULAR));
+ hmi_state->set_video_streaming_state(
+ mobile_apis::VideoStreamingState::eType::STREAMABLE);
+ hmi_state->set_hmi_level(mobile_apis::HMILevel::HMI_FULL);
+ EXPECT_CALL(*mock_app_ptr_, CurrentHmiState(_))
+ .WillRepeatedly(Return(hmi_state));
bool result = false;
std::vector<std::string> rejected_params;
@@ -848,8 +881,13 @@ TEST_F(ApplicationManagerImplTest,
const int32_t session_key = 123;
EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key));
EXPECT_CALL(*mock_app_ptr_, is_navi()).WillRepeatedly(Return(true));
- EXPECT_CALL(*mock_app_ptr_, hmi_level(kDefaultWindowId))
- .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
+ HmiStatePtr hmi_state(std::make_shared<HmiState>(
+ mock_app_ptr_, mock_app_mngr_, HmiState::STATE_ID_REGULAR));
+ hmi_state->set_video_streaming_state(
+ mobile_apis::VideoStreamingState::eType::STREAMABLE);
+ hmi_state->set_hmi_level(mobile_apis::HMILevel::HMI_FULL);
+ EXPECT_CALL(*mock_app_ptr_, CurrentHmiState(_))
+ .WillRepeatedly(Return(hmi_state));
bool result = false;
std::vector<std::string> rejected_params;