diff options
Diffstat (limited to 'src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc')
-rw-r--r-- | src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc index 5487da51a3..bb5008654a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc @@ -61,6 +61,7 @@ #include "sdl_rpc_plugin/commands/hmi/on_ready_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_received_policy_update.h" #include "sdl_rpc_plugin/commands/hmi/on_record_start_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_reset_timeout_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_resume_audio_source_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_sdl_close_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_sdl_consent_needed_notification.h" @@ -72,13 +73,11 @@ #include "sdl_rpc_plugin/commands/hmi/on_system_info_changed_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_system_request_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_tts_language_change_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_tts_reset_timeout_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_tts_started_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_tts_stopped_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_ui_command_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_ui_keyboard_input_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_ui_language_change_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_ui_reset_timeout_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_ui_subtle_alert_pressed_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_ui_touch_event_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_video_data_streaming_notification.h" @@ -257,13 +256,9 @@ class HMICommandsNotificationsTest MockAppServiceManager mock_app_service_manager_; void InitCommand(const uint32_t& default_timeout) OVERRIDE { + CommandsTest<kIsNice>::InitCommand(default_timeout); + app_ = ConfigureApp(&app_ptr_, kAppId_, NOT_MEDIA, NOT_NAVI, NOT_VC); - EXPECT_CALL(app_mngr_, get_settings()) - .WillOnce(ReturnRef(app_mngr_settings_)); - EXPECT_CALL(app_mngr_settings_, default_timeout()) - .WillOnce(ReturnRef(default_timeout)); - ON_CALL(app_mngr_, event_dispatcher()) - .WillByDefault(ReturnRef(mock_event_dispatcher_)); ON_CALL(app_mngr_, application_by_hmi_app(_)).WillByDefault(Return(app_)); ON_CALL(*app_ptr_, app_id()).WillByDefault(Return(kAppId_)); ON_CALL(app_mngr_, application(kConnectionKey)).WillByDefault(Return(app_)); @@ -362,12 +357,10 @@ typedef Types< hmi_apis::FunctionID::BasicCommunication_OnAppDeactivated>, CommandPair<OnEventChangedNotification, hmi_apis::FunctionID::BasicCommunication_OnEventChanged>, - CommandPair<hmi::OnTTSResetTimeoutNotification, - hmi_apis::FunctionID::TTS_OnResetTimeout>, + CommandPair<hmi::OnResetTimeoutNotification, + hmi_apis::FunctionID::BasicCommunication_OnResetTimeout>, CommandPair<OnTTSStartedNotification, hmi_apis::FunctionID::TTS_Started>, CommandPair<OnTTSStoppedNotification, hmi_apis::FunctionID::TTS_Stopped>, - CommandPair<hmi::OnUIResetTimeoutNotification, - hmi_apis::FunctionID::UI_OnResetTimeout>, CommandPair<OnVRStartedNotification, hmi_apis::FunctionID::VR_Started>, CommandPair<OnVRStoppedNotification, hmi_apis::FunctionID::VR_Stopped> > HMIOnNotificationsEventDispatcherTypes; @@ -517,7 +510,8 @@ TEST_F(HMICommandsNotificationsTest, std::shared_ptr<Command> command = CreateCommand<OnAppRegisteredNotification>(message); EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(_)); - EXPECT_CALL(app_mngr_, event_dispatcher()); + EXPECT_CALL(app_mngr_, event_dispatcher()) + .WillOnce(ReturnRef(mock_event_dispatcher_)); EXPECT_CALL(mock_event_dispatcher_, raise_event(_)) .WillOnce(GetEventId(&event_id)); command->Run(); @@ -539,7 +533,8 @@ TEST_F(HMICommandsNotificationsTest, std::shared_ptr<Command> command = CreateCommand<OnAppUnregisteredNotification>(message); EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(_)); - EXPECT_CALL(app_mngr_, event_dispatcher()); + EXPECT_CALL(app_mngr_, event_dispatcher()) + .WillOnce(ReturnRef(mock_event_dispatcher_)); EXPECT_CALL(mock_event_dispatcher_, raise_event(_)) .WillOnce(GetEventId(&event_id)); command->Run(); @@ -561,7 +556,8 @@ TEST_F(HMICommandsNotificationsTest, OnButtonPressNotificationEventDispatcher) { CreateCommand<hmi::OnButtonPressNotification>(message); EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL)); - EXPECT_CALL(app_mngr_, event_dispatcher()); + EXPECT_CALL(app_mngr_, event_dispatcher()) + .WillOnce(ReturnRef(mock_event_dispatcher_)); EXPECT_CALL(mock_event_dispatcher_, raise_event(_)) .WillOnce(GetEventId(&event_id)); command->Run(); @@ -578,7 +574,8 @@ TEST_F(HMICommandsNotificationsTest, OnReadyNotificationEventDispatcher) { CreateCommand<OnReadyNotification>(message); EXPECT_CALL(app_mngr_, OnHMIReady()); - EXPECT_CALL(app_mngr_, event_dispatcher()); + EXPECT_CALL(app_mngr_, event_dispatcher()) + .WillOnce(ReturnRef(mock_event_dispatcher_)); EXPECT_CALL(mock_event_dispatcher_, raise_event(_)) .WillOnce(GetEventId(&event_id)); command->Run(); @@ -1298,11 +1295,10 @@ TEST_F(HMICommandsNotificationsTest, EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app_)); EXPECT_CALL(app_mngr_settings_, max_cmd_id()).WillOnce(ReturnRef(kMaxCmdId)); - EXPECT_CALL(app_mngr_, get_settings()) - .WillOnce(ReturnRef(app_mngr_settings_)); EXPECT_CALL(*app_ptr_, is_perform_interaction_active()) .WillOnce(Return(kIsPerformInteractionActive)); - EXPECT_CALL(app_mngr_, event_dispatcher()); + EXPECT_CALL(app_mngr_, event_dispatcher()) + .WillOnce(ReturnRef(mock_event_dispatcher_)); EXPECT_CALL(mock_event_dispatcher_, raise_event(_)) .WillOnce(GetEventId(&event_id)); EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0); |