diff options
author | Jacob Keeler <jacob.keeler@livioradio.com> | 2019-02-23 12:35:11 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-23 12:35:11 -0500 |
commit | 2a26de5bc0f3a357e28e6a83c9a7d439d2673431 (patch) | |
tree | 21475ca531caf403cc20102ab31fdcdb32c4ae1c /src/components/application_manager/test/application_manager_impl_test.cc | |
parent | a4011490d9aa4606d6d835690bc8703c4375526b (diff) | |
download | sdl_core-2a26de5bc0f3a357e28e6a83c9a7d439d2673431.tar.gz |
App Service Activation Logic (#2809)
* Add AS.AppServiceActivation and AS.GetAppServiceRecords RPCs
* Initialize AppServiceManager in Application manager tests
* Moved create notification functions to message helper class
* Fix style
* Removed setServiceActive function
* Add OnSystemCapabilityUpdated triggers to AppServiceManager
Includes refactoring of OnSystemCapabilityUpdated notification classes.
* Remove servicesSupported parameter
* Update SystemCapability structs with new revisions
* Include additional cases for activation
1. Services are activated if their publishing app is in the foreground.
2. If a service is deactivated without another being activated, the embedded service becomes active if available.
* Fixed error from previous commit and addressed style comments
* Addressed review comments
* Address review comments
* Fix LastState usage in app service manager
* Addressed review comments and removed extra debug statements
* Fix style
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.cc | 12 |
1 files changed, 8 insertions, 4 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 0b24fa8032..389f092e50 100644 --- a/src/components/application_manager/test/application_manager_impl_test.cc +++ b/src/components/application_manager/test/application_manager_impl_test.cc @@ -36,25 +36,26 @@ #include <vector> #include <bson_object.h> -#include "gtest/gtest.h" #include "application_manager/application.h" #include "application_manager/application_impl.h" #include "application_manager/application_manager_impl.h" #include "application_manager/mock_application.h" #include "application_manager/mock_application_manager_settings.h" #include "application_manager/mock_resumption_data.h" -#include "application_manager/mock_rpc_service.h" #include "application_manager/mock_rpc_plugin_manager.h" +#include "application_manager/mock_rpc_service.h" #include "application_manager/resumption/resume_ctrl_impl.h" #include "application_manager/test/include/application_manager/mock_message_helper.h" #include "connection_handler/mock_connection_handler.h" +#include "gtest/gtest.h" #include "hmi_message_handler/mock_hmi_message_handler.h" #include "media_manager/mock_media_manager.h" #include "policy/mock_policy_settings.h" #include "policy/usage_statistics/mock_statistics_manager.h" #include "protocol/bson_object_keys.h" -#include "protocol_handler/mock_session_observer.h" #include "protocol_handler/mock_protocol_handler.h" +#include "protocol_handler/mock_session_observer.h" +#include "resumption/mock_last_state.h" #include "utils/custom_string.h" #include "utils/file_system.h" #include "utils/lock.h" @@ -138,8 +139,10 @@ class ApplicationManagerImplTest : public ::testing::Test { app_manager_impl_->resume_controller().set_resumption_storage( mock_storage_); app_manager_impl_->set_connection_handler(&mock_connection_handler_); + Json::Value empty; + ON_CALL(mock_last_state_, get_dictionary()).WillByDefault(ReturnRef(empty)); std::unique_ptr<AppServiceManager> app_service_manager_ptr( - new AppServiceManager(*app_manager_impl_)); + new AppServiceManager(*app_manager_impl_, mock_last_state_)); app_manager_impl_->SetAppServiceManager(app_service_manager_ptr); } @@ -212,6 +215,7 @@ class ApplicationManagerImplTest : public ::testing::Test { std::shared_ptr<NiceMock<resumption_test::MockResumptionData> > mock_storage_; MockRPCService* mock_rpc_service_; + resumption_test::MockLastState mock_last_state_; NiceMock<con_test::MockConnectionHandler> mock_connection_handler_; NiceMock<protocol_handler_test::MockSessionObserver> mock_session_observer_; NiceMock<MockApplicationManagerSettings> mock_application_manager_settings_; |