From 8af8e7142f33b00fb29f35e30f0811c519460e03 Mon Sep 17 00:00:00 2001 From: Frank Ronneburg Date: Thu, 5 Apr 2018 03:21:41 +0900 Subject: Merge pull request #229 in NAR/sdl-core from feat/disable_resumption_before_secondary_transport_2 to feature/Ford-WiFi * commit 'bfe8579a831b873c8d0c1f950d46498ed3939a90': Enable retrying resumption after secondary transport is established Disable or limit resumption based on availability of high-bandwidth transport Add TransportRequiredForResumption and LowBandwidthTransportResumptionLevel sections in .ini file Update ReadStringContainer() Add required DeviceType enums Conflicts: src/components/include/test/application_manager/mock_application_manager.h src/components/include/transport_manager/transport_adapter/transport_adapter.h src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc --- .../include/test/application_manager/mock_application_manager.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/components/include/test') diff --git a/src/components/include/test/application_manager/mock_application_manager.h b/src/components/include/test/application_manager/mock_application_manager.h index 452a1e6c39..3d97279b39 100644 --- a/src/components/include/test/application_manager/mock_application_manager.h +++ b/src/components/include/test/application_manager/mock_application_manager.h @@ -143,6 +143,8 @@ class MockApplicationManager : public application_manager::ApplicationManager { MOCK_METHOD0(hmi_capabilities, application_manager::HMICapabilities&()); MOCK_CONST_METHOD0(hmi_capabilities, const application_manager::HMICapabilities&()); + MOCK_CONST_METHOD1(CheckResumptionRequiredTransportAvailable, + bool(ApplicationConstSharedPtr application)); MOCK_METHOD2(ProcessQueryApp, void(const smart_objects::SmartObject& sm_object, const uint32_t connection_key)); -- cgit v1.2.1 From 546cd986780759dd5eee64998f99bc66099a3b32 Mon Sep 17 00:00:00 2001 From: Andriy Byzhynar Date: Fri, 23 Feb 2018 17:54:43 +0200 Subject: Implement fully functional GetSystemTime feature Implemented fully working GetSystemTime feature Fixed UT in the security manager due to code changes Disable randomly failed test --- .../policy_regular/policy/mock_cache_manager.h | 2 +- .../test/protocol_handler/mock_protocol_handler.h | 1 + .../test/security_manager/mock_crypto_manager.h | 4 +- .../test/security_manager/mock_security_manager.h | 10 +++- .../mock_security_manager_listener.h | 1 + .../test/security_manager/mock_ssl_context.h | 2 + .../include/test/utils/mock_system_time_handler.h | 69 ++++++++++++++++++++++ 7 files changed, 84 insertions(+), 5 deletions(-) create mode 100644 src/components/include/test/utils/mock_system_time_handler.h (limited to 'src/components/include/test') diff --git a/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h b/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h index ed3a5088c1..c9f53b8606 100644 --- a/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h +++ b/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h @@ -206,7 +206,7 @@ class MockCacheManagerInterface : public CacheManagerInterface { MOCK_METHOD1(GetHMITypes, const policy_table::AppHMITypes*(const std::string& app_id)); MOCK_CONST_METHOD0(GetCertificate, std::string()); - MOCK_METHOD1(SetDecryptedCertificate, void(const std::string&)); + MOCK_CONST_METHOD1(SetDecryptedCertificate, void(const std::string&)); MOCK_METHOD1(GetGroups, const policy_table::Strings&(const PTString& app_id)); MOCK_CONST_METHOD2(AppHasHMIType, bool(const std::string& application_id, diff --git a/src/components/include/test/protocol_handler/mock_protocol_handler.h b/src/components/include/test/protocol_handler/mock_protocol_handler.h index 79c2188cdf..e667911944 100644 --- a/src/components/include/test/protocol_handler/mock_protocol_handler.h +++ b/src/components/include/test/protocol_handler/mock_protocol_handler.h @@ -72,6 +72,7 @@ class MockProtocolHandler : public ::protocol_handler::ProtocolHandler { MOCK_METHOD2(NotifySessionStarted, void(const ::protocol_handler::SessionContext& context, std::vector& rejected_params)); + MOCK_METHOD0(NotifyOnFailedHandshake, void()); }; } // namespace protocol_handler_test } // namespace components diff --git a/src/components/include/test/security_manager/mock_crypto_manager.h b/src/components/include/test/security_manager/mock_crypto_manager.h index 55c364bd89..61ec5183e4 100644 --- a/src/components/include/test/security_manager/mock_crypto_manager.h +++ b/src/components/include/test/security_manager/mock_crypto_manager.h @@ -52,7 +52,9 @@ class MockCryptoManager : public ::security_manager::CryptoManager { MOCK_METHOD0(CreateSSLContext, ::security_manager::SSLContext*()); MOCK_METHOD1(ReleaseSSLContext, void(::security_manager::SSLContext*)); MOCK_CONST_METHOD0(LastError, std::string()); - MOCK_CONST_METHOD0(IsCertificateUpdateRequired, bool()); + MOCK_CONST_METHOD2(IsCertificateUpdateRequired, + bool(const time_t system_time, + const time_t certificates_time)); }; } // namespace security_manager_test } // namespace components diff --git a/src/components/include/test/security_manager/mock_security_manager.h b/src/components/include/test/security_manager/mock_security_manager.h index 11890cb071..153ce85422 100644 --- a/src/components/include/test/security_manager/mock_security_manager.h +++ b/src/components/include/test/security_manager/mock_security_manager.h @@ -54,8 +54,9 @@ class MockSecurityManager : public ::security_manager::SecurityManager { MOCK_METHOD4( SendInternalError, void(const uint32_t, const uint8_t&, const std::string&, const uint32_t)); - MOCK_METHOD1(CreateSSLContext, - ::security_manager::SSLContext*(const uint32_t&)); + MOCK_METHOD2(CreateSSLContext, + ::security_manager::SSLContext*(const uint32_t&, + ContextCreationStrategy)); MOCK_METHOD1(StartHandshake, void(uint32_t)); MOCK_METHOD1(AddListener, void(::security_manager::SecurityManagerListener*)); MOCK_METHOD1(RemoveListener, @@ -65,9 +66,12 @@ class MockSecurityManager : public ::security_manager::SecurityManager { void(const ::protocol_handler::RawMessagePtr)); MOCK_METHOD1(OnMobileMessageSent, void(const ::protocol_handler::RawMessagePtr)); - MOCK_METHOD0(IsCertificateUpdateRequired, bool()); + MOCK_METHOD1(IsCertificateUpdateRequired, bool(const uint32_t)); MOCK_METHOD0(NotifyOnCertificateUpdateRequired, void()); MOCK_METHOD0(IsPolicyCertificateDataEmpty, bool()); + MOCK_METHOD1(OnCertificateUpdated, bool(const std::string&)); + MOCK_METHOD1(PostponeHandshake, void(const uint32_t)); + MOCK_CONST_METHOD0(IsSystemTimeProviderReady, bool()); }; /* diff --git a/src/components/include/test/security_manager/mock_security_manager_listener.h b/src/components/include/test/security_manager/mock_security_manager_listener.h index a06762a09d..76273b244d 100644 --- a/src/components/include/test/security_manager/mock_security_manager_listener.h +++ b/src/components/include/test/security_manager/mock_security_manager_listener.h @@ -49,6 +49,7 @@ class MockSecurityManagerListener ::security_manager::SSLContext::HandshakeResult result)); MOCK_METHOD0(OnCertificateUpdateRequired, void()); MOCK_CONST_METHOD1(GetPolicyCertificateData, bool(std::string& data)); + MOCK_METHOD0(OnHandshakeFailed, void()); }; } // namespace security_manager_test } // namespace components diff --git a/src/components/include/test/security_manager/mock_ssl_context.h b/src/components/include/test/security_manager/mock_ssl_context.h index 6b6a26a226..02198d1d22 100644 --- a/src/components/include/test/security_manager/mock_ssl_context.h +++ b/src/components/include/test/security_manager/mock_ssl_context.h @@ -68,6 +68,8 @@ class MockSSLContext : public ::security_manager::SSLContext { MOCK_CONST_METHOD0(LastError, std::string()); MOCK_METHOD0(ResetConnection, void()); MOCK_METHOD1(SetHandshakeContext, void(const HandshakeContext& hsh_ctx)); + MOCK_CONST_METHOD0(HasCertificate, bool()); + MOCK_CONST_METHOD1(GetCertificateDueDate, bool(time_t& due_date)); }; } // namespace security_manager_test } // namespace components diff --git a/src/components/include/test/utils/mock_system_time_handler.h b/src/components/include/test/utils/mock_system_time_handler.h new file mode 100644 index 0000000000..ef80e698f5 --- /dev/null +++ b/src/components/include/test/utils/mock_system_time_handler.h @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2018, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_INCLUDE_TEST_SECURITY_MANAGER_MOCK_SYSTEM_TIME_HANDLER_H +#define SRC_COMPONENTS_INCLUDE_TEST_SECURITY_MANAGER_MOCK_SYSTEM_TIME_HANDLER_H + +#include "gmock/gmock.h" +#include "utils/system_time_handler.h" + +namespace test { +namespace components { +namespace security_manager_test { + +class MockSystemTimeHandler : public ::utils::SystemTimeHandler { + public: + MockSystemTimeHandler() {} + MOCK_METHOD0(QuerySystemTime, void()); + MOCK_METHOD1(SubscribeOnSystemTime, + void(utils::SystemTimeListener* listener)); + MOCK_METHOD1(UnSubscribeFromSystemTime, + void(utils::SystemTimeListener* listener)); + MOCK_METHOD0(GetUTCTime, time_t()); + MOCK_CONST_METHOD0(system_time_can_be_received, bool()); + ~MockSystemTimeHandler() {} + + private: + void DoSubscribe(utils::SystemTimeListener*) {} + void DoSystemTimeQuery() {} + void DoUnsubscribe(utils::SystemTimeListener* listener) {} + bool utc_time_can_be_received() const { + return true; + } + time_t FetchSystemTime() { + return 0; + } +}; +} // namespace security_manager_test +} // namespace components +} // namespace test +#endif // SRC_COMPONENTS_INCLUDE_TEST_SECURITY_MANAGER_MOCK_SYSTEM_TIME_HANDLER_H -- cgit v1.2.1 From e0caccd349cd66a21508c00bcfab8f288d688d86 Mon Sep 17 00:00:00 2001 From: Frank Ronneburg Date: Thu, 12 Apr 2018 07:36:02 +0900 Subject: Merge pull request #236 in NAR/sdl-core from fix/build_errors_in_tests to feature/Ford-WiFi * commit 'd529b059e47f170c77137ac1edf10c0696a7bb6b': fallout from other changes in the Ford-WiFi branch revert device_type hacks revert device_type hacks UT: support newly added Application::deferred_resumption_hmi_level() UT: support newly added ApplicationManager::CheckResumptionRequiredTransportAvailable() UT: update test cases to support new protocol frames UT: fix CheckStringContainer() test case UT: fix test case TcpClientListenerTest IsInitialised UT: support newly added TransportAdapter::GetDeviceType() UT: support newly added transport_manager_tcp_adapter_network_interface() method Remove invalid test cases Add/fix mock methods for testing Update test code to add new arg in Connection::AddNewSession() and AddNewService() Update test code related to SessionContext struct Update test codes related to SendEndService() Update DeviceInfo struct in test codes Add mock methods for testing --- .../application_manager/mock_application_manager.h | 5 +++-- .../mock_application_manager_settings.h | 5 +++++ .../test/connection_handler/mock_connection_handler.h | 19 +++++++++++++++++++ .../mock_connection_handler_observer.h | 5 +++++ .../test/protocol_handler/mock_protocol_handler.h | 9 +++++++-- .../protocol_handler/mock_protocol_handler_settings.h | 11 +++++++++++ .../test/protocol_handler/mock_session_observer.h | 4 ++++ .../mock_transport_manager_listener.h | 2 ++ .../mock_transport_manager_settings.h | 2 ++ .../transport_adapter/mock_transport_adapter.h | 2 ++ 10 files changed, 60 insertions(+), 4 deletions(-) (limited to 'src/components/include/test') diff --git a/src/components/include/test/application_manager/mock_application_manager.h b/src/components/include/test/application_manager/mock_application_manager.h index 3d97279b39..9ce2b3d5cb 100644 --- a/src/components/include/test/application_manager/mock_application_manager.h +++ b/src/components/include/test/application_manager/mock_application_manager.h @@ -143,8 +143,9 @@ class MockApplicationManager : public application_manager::ApplicationManager { MOCK_METHOD0(hmi_capabilities, application_manager::HMICapabilities&()); MOCK_CONST_METHOD0(hmi_capabilities, const application_manager::HMICapabilities&()); - MOCK_CONST_METHOD1(CheckResumptionRequiredTransportAvailable, - bool(ApplicationConstSharedPtr application)); + MOCK_CONST_METHOD1( + CheckResumptionRequiredTransportAvailable, + bool(application_manager::ApplicationConstSharedPtr application)); MOCK_METHOD2(ProcessQueryApp, void(const smart_objects::SmartObject& sm_object, const uint32_t connection_key)); diff --git a/src/components/include/test/application_manager/mock_application_manager_settings.h b/src/components/include/test/application_manager/mock_application_manager_settings.h index 25cf994566..825beff8bb 100644 --- a/src/components/include/test/application_manager/mock_application_manager_settings.h +++ b/src/components/include/test/application_manager/mock_application_manager_settings.h @@ -95,6 +95,11 @@ class MockApplicationManagerSettings MOCK_CONST_METHOD0(app_resuming_timeout, const uint32_t&()); MOCK_CONST_METHOD0(attempts_to_open_resumption_db, uint16_t()); MOCK_CONST_METHOD0(open_attempt_timeout_ms_resumption_db, uint16_t()); + MOCK_CONST_METHOD0(transport_required_for_resumption_map, + std::map >&()); + MOCK_CONST_METHOD0(navigation_lowbandwidth_resumption_level, std::string&()); + MOCK_CONST_METHOD0(projection_lowbandwidth_resumption_level, std::string&()); + MOCK_CONST_METHOD0(mediaapp_lowbandwidth_resumption_level, std::string&()); MOCK_METHOD1(set_config_file_name, void(const std::string& fileName)); // The following line won't really compile, as the return // type has multiple template arguments. To fix it, use a diff --git a/src/components/include/test/connection_handler/mock_connection_handler.h b/src/components/include/test/connection_handler/mock_connection_handler.h index f1416c999e..003c06457c 100644 --- a/src/components/include/test/connection_handler/mock_connection_handler.h +++ b/src/components/include/test/connection_handler/mock_connection_handler.h @@ -51,6 +51,7 @@ using connection_handler::ConnectionHandle; using connection_handler::DeviceHandle; using connection_handler::CloseSessionReason; using connection_handler::DevicesDiscoveryStarter; +using connection_handler::SessionTransports; class MockConnectionHandler : public connection_handler::ConnectionHandler { public: @@ -103,10 +104,28 @@ class MockConnectionHandler : public connection_handler::ConnectionHandler { MOCK_METHOD0(get_device_discovery_starter, DevicesDiscoveryStarter&()); MOCK_CONST_METHOD1(GetConnectedDevicesMAC, void(std::vector& macs)); + MOCK_METHOD0( + session_connection_map, + NonConstDataAccessor()); + MOCK_METHOD2(SetSecondaryTransportID, + SessionTransports( + uint8_t session_id, + transport_manager::ConnectionUID secondary_transport_id)); + MOCK_CONST_METHOD1(GetSessionTransports, + const SessionTransports(uint8_t session_id)); MOCK_METHOD3(NotifyServiceStartedResult, void(uint32_t session_key, bool result, std::vector& rejected_params)); + MOCK_METHOD3( + OnSecondaryTransportStarted, + bool(transport_manager::ConnectionUID& primary_connection_handle, + const transport_manager::ConnectionUID secondary_connection_handle, + const uint8_t session_id)); + MOCK_METHOD2( + OnSecondaryTransportEnded, + void(const transport_manager::ConnectionUID primary_connection_handle, + const transport_manager::ConnectionUID secondary_connection_handle)); }; } // namespace connection_handler_test diff --git a/src/components/include/test/connection_handler/mock_connection_handler_observer.h b/src/components/include/test/connection_handler/mock_connection_handler_observer.h index a96498028d..ede08a9a4a 100644 --- a/src/components/include/test/connection_handler/mock_connection_handler_observer.h +++ b/src/components/include/test/connection_handler/mock_connection_handler_observer.h @@ -74,6 +74,11 @@ class MockConnectionHandlerObserver const connection_handler::Device& device_to)); MOCK_METHOD1(OnDeviceSwitchingFinish, void(const std::string& device_uid)); MOCK_CONST_METHOD1(CheckAppIsNavi, bool(const uint32_t app_id)); + MOCK_METHOD2(OnSecondaryTransportStartedCallback, + void(const connection_handler::DeviceHandle device_handle, + const int32_t session_key)); + MOCK_METHOD1(OnSecondaryTransportEndedCallback, + void(const int32_t session_key)); }; } // namespace connection_handler_test diff --git a/src/components/include/test/protocol_handler/mock_protocol_handler.h b/src/components/include/test/protocol_handler/mock_protocol_handler.h index 79c2188cdf..06ebc3a448 100644 --- a/src/components/include/test/protocol_handler/mock_protocol_handler.h +++ b/src/components/include/test/protocol_handler/mock_protocol_handler.h @@ -55,10 +55,15 @@ class MockProtocolHandler : public ::protocol_handler::ProtocolHandler { void(uint32_t connection_key, int32_t number_of_frames)); MOCK_METHOD2(SendHeartBeat, void(int32_t connection_id, uint8_t session_id)); MOCK_METHOD2(SendEndSession, void(int32_t connection_id, uint8_t session_id)); - MOCK_METHOD3(SendEndService, - void(int32_t connection_id, + MOCK_METHOD4(SendEndService, + void(int32_t primary_connection_id, + int32_t connection_id, uint8_t session_id, uint8_t service_type)); + DEPRECATED MOCK_METHOD3(SendEndService, + void(int32_t connection_id, + uint8_t session_id, + uint8_t service_type)); MOCK_CONST_METHOD0(get_settings, const ::protocol_handler::ProtocolHandlerSettings&()); MOCK_METHOD0(get_session_observer, protocol_handler::SessionObserver&()); diff --git a/src/components/include/test/protocol_handler/mock_protocol_handler_settings.h b/src/components/include/test/protocol_handler/mock_protocol_handler_settings.h index 8ddeded889..2ed9c47e9d 100644 --- a/src/components/include/test/protocol_handler/mock_protocol_handler_settings.h +++ b/src/components/include/test/protocol_handler/mock_protocol_handler_settings.h @@ -60,6 +60,17 @@ class MockProtocolHandlerSettings MOCK_CONST_METHOD0(force_protected_service, const std::vector&()); MOCK_CONST_METHOD0(force_unprotected_service, const std::vector&()); #endif + MOCK_CONST_METHOD0(multiple_transports_enabled, const bool()); + MOCK_CONST_METHOD0(secondary_transports_for_bluetooth, + const std::vector&()); + MOCK_CONST_METHOD0(secondary_transports_for_usb, + const std::vector&()); + MOCK_CONST_METHOD0(secondary_transports_for_wifi, + const std::vector&()); + MOCK_CONST_METHOD0(audio_service_transports, + const std::vector&()); + MOCK_CONST_METHOD0(video_service_transports, + const std::vector&()); }; } // namespace protocol_handler_test diff --git a/src/components/include/test/protocol_handler/mock_session_observer.h b/src/components/include/test/protocol_handler/mock_session_observer.h index ae32f35948..74e6d79c96 100644 --- a/src/components/include/test/protocol_handler/mock_session_observer.h +++ b/src/components/include/test/protocol_handler/mock_session_observer.h @@ -76,6 +76,10 @@ class MockSessionObserver : public ::protocol_handler::SessionObserver { void(const uint32_t& connection_key)); MOCK_METHOD1(OnMalformedMessageCallback, void(const uint32_t& connection_key)); + MOCK_CONST_METHOD1(connection_type, + std::string( + transport_manager::ConnectionUID connection_handle)); + MOCK_CONST_METHOD2( KeyFromPair, uint32_t(transport_manager::ConnectionUID connection_handle, diff --git a/src/components/include/test/transport_manager/mock_transport_manager_listener.h b/src/components/include/test/transport_manager/mock_transport_manager_listener.h index f4c4fdcf68..133dabe732 100644 --- a/src/components/include/test/transport_manager/mock_transport_manager_listener.h +++ b/src/components/include/test/transport_manager/mock_transport_manager_listener.h @@ -85,6 +85,8 @@ class MockTransportManagerListener : public TransportManagerListener { void(const DeviceUID& device_uid_from, const DeviceUID& device_uid_to)); MOCK_METHOD1(OnDeviceSwitchingFinish, void(const DeviceUID& device_uid)); + MOCK_METHOD1(OnTransportConfigUpdated, + void(const std::map& configs)); }; } // namespace transport_manager_test diff --git a/src/components/include/test/transport_manager/mock_transport_manager_settings.h b/src/components/include/test/transport_manager/mock_transport_manager_settings.h index 88112df003..3e7c8f36f7 100644 --- a/src/components/include/test/transport_manager/mock_transport_manager_settings.h +++ b/src/components/include/test/transport_manager/mock_transport_manager_settings.h @@ -61,6 +61,8 @@ class MockTransportManagerSettings MOCK_CONST_METHOD0(iap_hub_connection_wait_timeout, uint32_t()); MOCK_CONST_METHOD0(app_transport_change_timer, uint32_t()); MOCK_CONST_METHOD0(app_transport_change_timer_addition, uint32_t()); + MOCK_CONST_METHOD0(transport_manager_tcp_adapter_network_interface, + std::string&()); }; } // namespace transport_manager_test diff --git a/src/components/include/test/transport_manager/transport_adapter/mock_transport_adapter.h b/src/components/include/test/transport_manager/transport_adapter/mock_transport_adapter.h index c37c41d4f8..eff0abdcd3 100644 --- a/src/components/include/test/transport_manager/transport_adapter/mock_transport_adapter.h +++ b/src/components/include/test/transport_manager/transport_adapter/mock_transport_adapter.h @@ -103,6 +103,8 @@ class MockTransportAdapter void(const ::transport_manager::DeviceUID& device_handle)); MOCK_CONST_METHOD0(GetSwitchableDevices, transport_manager::SwitchableDevices()); + MOCK_CONST_METHOD0(GetTransportConfiguration, + transport_manager::transport_adapter::TransportConfig()); #ifdef TELEMETRY_MONITOR MOCK_METHOD0(GetTelemetryObserver, ::transport_manager::TMTelemetryObserver*()); -- cgit v1.2.1 From 2136f56aeaaa3fa2b70ae3dad834d8961c77f538 Mon Sep 17 00:00:00 2001 From: fronneburg Date: Thu, 12 Apr 2018 10:37:46 -0700 Subject: Merge branch 'feat/application_unit_tests' of ssh://autobitbucket.corp.xevo.com:7999/nar/sdl-core into feature/Ford-WiFi --- .../test/application_manager/mock_application_manager_settings.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/components/include/test') diff --git a/src/components/include/test/application_manager/mock_application_manager_settings.h b/src/components/include/test/application_manager/mock_application_manager_settings.h index 825beff8bb..d91243ad41 100644 --- a/src/components/include/test/application_manager/mock_application_manager_settings.h +++ b/src/components/include/test/application_manager/mock_application_manager_settings.h @@ -97,9 +97,12 @@ class MockApplicationManagerSettings MOCK_CONST_METHOD0(open_attempt_timeout_ms_resumption_db, uint16_t()); MOCK_CONST_METHOD0(transport_required_for_resumption_map, std::map >&()); - MOCK_CONST_METHOD0(navigation_lowbandwidth_resumption_level, std::string&()); - MOCK_CONST_METHOD0(projection_lowbandwidth_resumption_level, std::string&()); - MOCK_CONST_METHOD0(mediaapp_lowbandwidth_resumption_level, std::string&()); + MOCK_CONST_METHOD0(navigation_lowbandwidth_resumption_level, + const std::string&()); + MOCK_CONST_METHOD0(projection_lowbandwidth_resumption_level, + const std::string&()); + MOCK_CONST_METHOD0(mediaapp_lowbandwidth_resumption_level, + const std::string&()); MOCK_METHOD1(set_config_file_name, void(const std::string& fileName)); // The following line won't really compile, as the return // type has multiple template arguments. To fix it, use a -- cgit v1.2.1 From 7fdf0dc10e38be1c7f7ad623a97e2a1461f2a4e7 Mon Sep 17 00:00:00 2001 From: fronneburg Date: Fri, 13 Apr 2018 10:44:37 -0700 Subject: fix build --- .../include/test/connection_handler/mock_connection_handler.h | 3 +++ src/components/include/test/protocol_handler/mock_session_observer.h | 2 ++ 2 files changed, 5 insertions(+) (limited to 'src/components/include/test') diff --git a/src/components/include/test/connection_handler/mock_connection_handler.h b/src/components/include/test/connection_handler/mock_connection_handler.h index 003c06457c..6b9d36dffa 100644 --- a/src/components/include/test/connection_handler/mock_connection_handler.h +++ b/src/components/include/test/connection_handler/mock_connection_handler.h @@ -86,12 +86,15 @@ class MockConnectionHandler : public connection_handler::ConnectionHandler { MOCK_METHOD2(BindProtocolVersionWithSession, void(uint32_t connection_key, uint8_t protocol_version)); +#if __SIZEOF_SIZE_T__ != 4 // DEPRECATED MOCK_CONST_METHOD4(GetDataOnSessionKey, int32_t(uint32_t key, uint32_t* app_id, std::list* sessions_list, uint32_t* device_id)); +#endif + MOCK_CONST_METHOD4(GetDataOnSessionKey, int32_t(uint32_t key, uint32_t* app_id, diff --git a/src/components/include/test/protocol_handler/mock_session_observer.h b/src/components/include/test/protocol_handler/mock_session_observer.h index 74e6d79c96..b6638ae437 100644 --- a/src/components/include/test/protocol_handler/mock_session_observer.h +++ b/src/components/include/test/protocol_handler/mock_session_observer.h @@ -93,11 +93,13 @@ class MockSessionObserver : public ::protocol_handler::SessionObserver { uint32_t* app_id, std::list* sessions_list, transport_manager::DeviceHandle* device_id)); +#if __SIZEOF_SIZE_T__ != 4 DEPRECATED MOCK_CONST_METHOD4(GetDataOnSessionKey, int32_t(uint32_t key, uint32_t* app_id, std::list* sessions_list, uint32_t* device_id)); +#endif MOCK_CONST_METHOD5(GetDataOnDeviceID, int32_t(transport_manager::DeviceHandle device_handle, -- cgit v1.2.1 From 0ed5e9cdd0f8f60fe4a7197956b4c723e04b338a Mon Sep 17 00:00:00 2001 From: Frank Ronneburg Date: Sat, 14 Apr 2018 04:17:34 +0900 Subject: Merge pull request #252 in NAR/sdl-core from fix/minor_unit_test_fix to feature/Ford-WiFi * commit '22c10e8af09be7e6ecfde11226017ab94742ee18': minor unit test fix --- .../include/test/connection_handler/mock_connection_handler_observer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/components/include/test') diff --git a/src/components/include/test/connection_handler/mock_connection_handler_observer.h b/src/components/include/test/connection_handler/mock_connection_handler_observer.h index ede08a9a4a..a3ee497ded 100644 --- a/src/components/include/test/connection_handler/mock_connection_handler_observer.h +++ b/src/components/include/test/connection_handler/mock_connection_handler_observer.h @@ -64,6 +64,7 @@ class MockConnectionHandlerObserver const protocol_handler::ServiceType& type, const connection_handler::CloseSessionReason& close_reason)); #ifdef ENABLE_SECURITY + MOCK_CONST_METHOD1(CheckAppIsNavi, bool(const uint32_t app_id)); MOCK_CONST_METHOD1( GetHandshakeContext, security_manager::SSLContext::HandshakeContext(uint32_t key)); @@ -73,7 +74,6 @@ class MockConnectionHandlerObserver void(const connection_handler::Device& device_from, const connection_handler::Device& device_to)); MOCK_METHOD1(OnDeviceSwitchingFinish, void(const std::string& device_uid)); - MOCK_CONST_METHOD1(CheckAppIsNavi, bool(const uint32_t app_id)); MOCK_METHOD2(OnSecondaryTransportStartedCallback, void(const connection_handler::DeviceHandle device_handle, const int32_t session_key)); -- cgit v1.2.1 From 87cd3ea8aa30d9a5635b5fa2aea11696bdd75016 Mon Sep 17 00:00:00 2001 From: fronneburg Date: Wed, 18 Apr 2018 14:30:41 -0700 Subject: alignment and style check --- .../include/test/connection_handler/mock_connection_handler.h | 2 +- .../include/test/protocol_handler/mock_session_observer.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/components/include/test') diff --git a/src/components/include/test/connection_handler/mock_connection_handler.h b/src/components/include/test/connection_handler/mock_connection_handler.h index 6b9d36dffa..b535441369 100644 --- a/src/components/include/test/connection_handler/mock_connection_handler.h +++ b/src/components/include/test/connection_handler/mock_connection_handler.h @@ -114,7 +114,7 @@ class MockConnectionHandler : public connection_handler::ConnectionHandler { SessionTransports( uint8_t session_id, transport_manager::ConnectionUID secondary_transport_id)); - MOCK_CONST_METHOD1(GetSessionTransports, + MOCK_CONST_METHOD1(GetSessionTransports, const SessionTransports(uint8_t session_id)); MOCK_METHOD3(NotifyServiceStartedResult, void(uint32_t session_key, diff --git a/src/components/include/test/protocol_handler/mock_session_observer.h b/src/components/include/test/protocol_handler/mock_session_observer.h index b6638ae437..8a4015268b 100644 --- a/src/components/include/test/protocol_handler/mock_session_observer.h +++ b/src/components/include/test/protocol_handler/mock_session_observer.h @@ -76,9 +76,9 @@ class MockSessionObserver : public ::protocol_handler::SessionObserver { void(const uint32_t& connection_key)); MOCK_METHOD1(OnMalformedMessageCallback, void(const uint32_t& connection_key)); - MOCK_CONST_METHOD1(connection_type, - std::string( - transport_manager::ConnectionUID connection_handle)); + MOCK_CONST_METHOD1( + connection_type, + std::string(transport_manager::ConnectionUID connection_handle)); MOCK_CONST_METHOD2( KeyFromPair, -- cgit v1.2.1 From 511bfb0b25e8e1090a79a56c5e72f2c95d477450 Mon Sep 17 00:00:00 2001 From: Frank Ronneburg Date: Fri, 27 Apr 2018 09:33:52 +0900 Subject: Merge pull request #258 in NAR/sdl-core from bugfix/SDL-2547 to feature/Ford-WiFi * commit '0a8e19079c936a1f77e2929b658ba5dbf7f20abb': use ProfileString transport types instead of connection types for StartSessionAck (and other places --- .../include/test/protocol_handler/mock_session_observer.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/components/include/test') diff --git a/src/components/include/test/protocol_handler/mock_session_observer.h b/src/components/include/test/protocol_handler/mock_session_observer.h index 8a4015268b..40defaa46e 100644 --- a/src/components/include/test/protocol_handler/mock_session_observer.h +++ b/src/components/include/test/protocol_handler/mock_session_observer.h @@ -77,9 +77,11 @@ class MockSessionObserver : public ::protocol_handler::SessionObserver { MOCK_METHOD1(OnMalformedMessageCallback, void(const uint32_t& connection_key)); MOCK_CONST_METHOD1( - connection_type, - std::string(transport_manager::ConnectionUID connection_handle)); - + TransportTypeProfileStringFromConnHandle, + const std::string(transport_manager::ConnectionUID connection_handle)); + MOCK_CONST_METHOD1( + TransportTypeProfileStringFromDeviceHandle, + const std::string(transport_manager::DeviceHandle device_handle)); MOCK_CONST_METHOD2( KeyFromPair, uint32_t(transport_manager::ConnectionUID connection_handle, -- cgit v1.2.1 From 9ca6d28bdf22eb1c4db71d417f503568d00d5869 Mon Sep 17 00:00:00 2001 From: AKalinich-Luxoft Date: Fri, 25 May 2018 20:30:11 +0300 Subject: Fix affected UT and mocks --- src/components/include/test/security_manager/mock_security_manager.h | 1 + .../include/test/security_manager/mock_security_manager_listener.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src/components/include/test') diff --git a/src/components/include/test/security_manager/mock_security_manager.h b/src/components/include/test/security_manager/mock_security_manager.h index 153ce85422..b2c2e3bf17 100644 --- a/src/components/include/test/security_manager/mock_security_manager.h +++ b/src/components/include/test/security_manager/mock_security_manager.h @@ -68,6 +68,7 @@ class MockSecurityManager : public ::security_manager::SecurityManager { void(const ::protocol_handler::RawMessagePtr)); MOCK_METHOD1(IsCertificateUpdateRequired, bool(const uint32_t)); MOCK_METHOD0(NotifyOnCertificateUpdateRequired, void()); + MOCK_METHOD0(NotifyListenersOnHandshakeFailed, void()); MOCK_METHOD0(IsPolicyCertificateDataEmpty, bool()); MOCK_METHOD1(OnCertificateUpdated, bool(const std::string&)); MOCK_METHOD1(PostponeHandshake, void(const uint32_t)); diff --git a/src/components/include/test/security_manager/mock_security_manager_listener.h b/src/components/include/test/security_manager/mock_security_manager_listener.h index 76273b244d..7a7714d299 100644 --- a/src/components/include/test/security_manager/mock_security_manager_listener.h +++ b/src/components/include/test/security_manager/mock_security_manager_listener.h @@ -49,7 +49,7 @@ class MockSecurityManagerListener ::security_manager::SSLContext::HandshakeResult result)); MOCK_METHOD0(OnCertificateUpdateRequired, void()); MOCK_CONST_METHOD1(GetPolicyCertificateData, bool(std::string& data)); - MOCK_METHOD0(OnHandshakeFailed, void()); + MOCK_METHOD0(OnHandshakeFailed, bool()); }; } // namespace security_manager_test } // namespace components -- cgit v1.2.1 From a194d35bcc39560ef47f39a5dd95cd75cfd193ba Mon Sep 17 00:00:00 2001 From: Andrii Kalinich Date: Tue, 12 Jun 2018 14:34:31 +0300 Subject: Updates after Livio review --- src/components/include/test/utils/mock_system_time_handler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/components/include/test') diff --git a/src/components/include/test/utils/mock_system_time_handler.h b/src/components/include/test/utils/mock_system_time_handler.h index ef80e698f5..7bb2a7f0a5 100644 --- a/src/components/include/test/utils/mock_system_time_handler.h +++ b/src/components/include/test/utils/mock_system_time_handler.h @@ -46,7 +46,7 @@ class MockSystemTimeHandler : public ::utils::SystemTimeHandler { MOCK_METHOD0(QuerySystemTime, void()); MOCK_METHOD1(SubscribeOnSystemTime, void(utils::SystemTimeListener* listener)); - MOCK_METHOD1(UnSubscribeFromSystemTime, + MOCK_METHOD1(UnsubscribeFromSystemTime, void(utils::SystemTimeListener* listener)); MOCK_METHOD0(GetUTCTime, time_t()); MOCK_CONST_METHOD0(system_time_can_be_received, bool()); -- cgit v1.2.1 From d99d7f2fa71205a5f1a69d07b1abb75ef2c1fc7f Mon Sep 17 00:00:00 2001 From: AKalinich-Luxoft Date: Fri, 15 Jun 2018 12:53:28 +0300 Subject: Removed unused code in regular policies --- .../include/test/policy/policy_regular/policy/mock_cache_manager.h | 1 - .../include/test/policy/policy_regular/policy/mock_policy_manager.h | 1 - 2 files changed, 2 deletions(-) (limited to 'src/components/include/test') diff --git a/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h b/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h index c9f53b8606..2b8dc809a6 100644 --- a/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h +++ b/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h @@ -206,7 +206,6 @@ class MockCacheManagerInterface : public CacheManagerInterface { MOCK_METHOD1(GetHMITypes, const policy_table::AppHMITypes*(const std::string& app_id)); MOCK_CONST_METHOD0(GetCertificate, std::string()); - MOCK_CONST_METHOD1(SetDecryptedCertificate, void(const std::string&)); MOCK_METHOD1(GetGroups, const policy_table::Strings&(const PTString& app_id)); MOCK_CONST_METHOD2(AppHasHMIType, bool(const std::string& application_id, diff --git a/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h b/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h index 82012b83c7..53b29cabe7 100644 --- a/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h +++ b/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h @@ -186,7 +186,6 @@ class MockPolicyManager : public PolicyManager { MOCK_CONST_METHOD0(GetMetaInfo, const policy::MetaInfo()); MOCK_CONST_METHOD0(RetrieveCertificate, std::string()); MOCK_CONST_METHOD0(HasCertificate, bool()); - MOCK_METHOD1(SetDecryptedCertificate, void(const std::string&)); MOCK_METHOD0(ExceededIgnitionCycles, bool()); MOCK_METHOD0(ExceededDays, bool()); MOCK_METHOD0(StartPTExchange, void()); -- cgit v1.2.1 From 6669b25d21d326fd0b6a0e470b80374e1da2d0b6 Mon Sep 17 00:00:00 2001 From: Andriy Byzhynar Date: Wed, 14 Feb 2018 16:39:22 +0200 Subject: Add handling of wrong force protection settings in ini file --- .../include/test/security_manager/mock_security_manager_settings.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/components/include/test') diff --git a/src/components/include/test/security_manager/mock_security_manager_settings.h b/src/components/include/test/security_manager/mock_security_manager_settings.h index 6ac194ced4..961b5e2ff8 100644 --- a/src/components/include/test/security_manager/mock_security_manager_settings.h +++ b/src/components/include/test/security_manager/mock_security_manager_settings.h @@ -52,6 +52,8 @@ class MockCryptoManagerSettings MOCK_CONST_METHOD0(ca_cert_path, const std::string&()); MOCK_CONST_METHOD0(update_before_hours, size_t()); MOCK_CONST_METHOD0(maximum_payload_size, size_t()); + MOCK_CONST_METHOD0(force_protected_service, const std::vector&()); + MOCK_CONST_METHOD0(force_unprotected_service, const std::vector&()); }; } // namespace security_manager_test -- cgit v1.2.1 From fb10b983d2f831c948ce4290170d6fa155dfe5bc Mon Sep 17 00:00:00 2001 From: AKalinich-Luxoft Date: Fri, 25 May 2018 13:24:52 +0300 Subject: Fixed affected mocks and UT's Added new expectations for a security tests due to some changes in the security flow --- .../include/test/security_manager/mock_security_manager_settings.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/components/include/test') diff --git a/src/components/include/test/security_manager/mock_security_manager_settings.h b/src/components/include/test/security_manager/mock_security_manager_settings.h index 961b5e2ff8..b1c869cd1b 100644 --- a/src/components/include/test/security_manager/mock_security_manager_settings.h +++ b/src/components/include/test/security_manager/mock_security_manager_settings.h @@ -50,6 +50,8 @@ class MockCryptoManagerSettings MOCK_CONST_METHOD0(certificate_data, const std::string&()); MOCK_CONST_METHOD0(ciphers_list, const std::string&()); MOCK_CONST_METHOD0(ca_cert_path, const std::string&()); + MOCK_CONST_METHOD0(module_cert_path, const std::string&()); + MOCK_CONST_METHOD0(module_key_path, const std::string&()); MOCK_CONST_METHOD0(update_before_hours, size_t()); MOCK_CONST_METHOD0(maximum_payload_size, size_t()); MOCK_CONST_METHOD0(force_protected_service, const std::vector&()); -- cgit v1.2.1 From d34665c35bc4d959296511dd27e77ba2d5f709d5 Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Tue, 26 Jun 2018 17:27:55 +0900 Subject: Rename some variables and function Reflecting review comments. --- .../test/application_manager/mock_application_manager_settings.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/components/include/test') diff --git a/src/components/include/test/application_manager/mock_application_manager_settings.h b/src/components/include/test/application_manager/mock_application_manager_settings.h index d91243ad41..735539156a 100644 --- a/src/components/include/test/application_manager/mock_application_manager_settings.h +++ b/src/components/include/test/application_manager/mock_application_manager_settings.h @@ -101,8 +101,7 @@ class MockApplicationManagerSettings const std::string&()); MOCK_CONST_METHOD0(projection_lowbandwidth_resumption_level, const std::string&()); - MOCK_CONST_METHOD0(mediaapp_lowbandwidth_resumption_level, - const std::string&()); + MOCK_CONST_METHOD0(media_lowbandwidth_resumption_level, const std::string&()); MOCK_METHOD1(set_config_file_name, void(const std::string& fileName)); // The following line won't really compile, as the return // type has multiple template arguments. To fix it, use a -- cgit v1.2.1 From f83d4759add793398b24cca0ae1dd157d03f648c Mon Sep 17 00:00:00 2001 From: Ira Lytvynenko Date: Fri, 26 Jan 2018 13:29:38 +0200 Subject: RPCService implementation Fix commands UTs --- .../application_manager/mock_application_manager.h | 21 +++---------- .../test/application_manager/mock_rpc_service.h | 36 ++++++++++++++++++++++ 2 files changed, 41 insertions(+), 16 deletions(-) create mode 100644 src/components/include/test/application_manager/mock_rpc_service.h (limited to 'src/components/include/test') diff --git a/src/components/include/test/application_manager/mock_application_manager.h b/src/components/include/test/application_manager/mock_application_manager.h index bc1c0d08d2..759e106a56 100644 --- a/src/components/include/test/application_manager/mock_application_manager.h +++ b/src/components/include/test/application_manager/mock_application_manager.h @@ -85,10 +85,6 @@ class MockApplicationManager : public application_manager::ApplicationManager { MOCK_METHOD0(GetPluginManager, functional_modules::PluginManager&()); MOCK_CONST_METHOD1( devices, std::vector(const std::string& policy_app_id)); - MOCK_METHOD1(SendPostMessageToMobile, - void(const application_manager::MessagePtr& message)); - MOCK_METHOD1(SendPostMessageToHMI, - void(const application_manager::MessagePtr& message)); #endif // SDL_REMOTE_CONTROL MOCK_CONST_METHOD1( @@ -122,20 +118,8 @@ class MockApplicationManager : public application_manager::ApplicationManager { MOCK_METHOD1( SendHMIStatusNotification, void(const utils::SharedPtr app)); - MOCK_METHOD2(SendMessageToMobile, - void(application_manager::commands::MessageSharedPtr, bool)); - MOCK_METHOD1( - SendMessageToHMI, - void(const application_manager::commands::MessageSharedPtr message)); MOCK_METHOD1(RemoveHMIFakeParameters, void(application_manager::MessagePtr& message)); - MOCK_METHOD1( - ManageHMICommand, - bool(const application_manager::commands::MessageSharedPtr message)); - MOCK_METHOD2( - ManageMobileCommand, - bool(const application_manager::commands::MessageSharedPtr message, - application_manager::commands::Command::CommandOrigin origin)); MOCK_CONST_METHOD1( GetDefaultHmiLevel, mobile_apis::HMILevel::eType( @@ -158,6 +142,8 @@ class MockApplicationManager : public application_manager::ApplicationManager { MOCK_CONST_METHOD0(protocol_handler, protocol_handler::ProtocolHandler&()); MOCK_METHOD0(GetPolicyHandler, policy::PolicyHandlerInterface&()); MOCK_CONST_METHOD0(GetPolicyHandler, const policy::PolicyHandlerInterface&()); + MOCK_CONST_METHOD0(GetRPCService, + application_manager::rpc_service::RPCService&()); MOCK_METHOD0(GetNextHMICorrelationID, uint32_t()); MOCK_METHOD0(GenerateNewHMIAppID, uint32_t()); MOCK_METHOD1(EndNaviServices, void(uint32_t app_id)); @@ -182,6 +168,7 @@ class MockApplicationManager : public application_manager::ApplicationManager { MOCK_CONST_METHOD1(IsAppsQueriedFrom, bool(const connection_handler::DeviceHandle handle)); MOCK_CONST_METHOD0(IsStopping, bool()); + MOCK_METHOD0(IsLowVoltage, bool()); MOCK_METHOD1(RemoveAppFromTTSGlobalPropertiesList, void(const uint32_t app_id)); MOCK_METHOD4( @@ -234,6 +221,8 @@ class MockApplicationManager : public application_manager::ApplicationManager { MOCK_METHOD0(resume_controller, resumption::ResumeCtrl&()); MOCK_METHOD0(hmi_interfaces, application_manager::HmiInterfaces&()); MOCK_METHOD0(app_launch_ctrl, app_launch::AppLaunchCtrl&()); + MOCK_CONST_METHOD0(SupportedSDLVersion, + protocol_handler::MajorProtocolVersion()); MOCK_METHOD1( GetDeviceTransportType, hmi_apis::Common_TransportType::eType(const std::string& transport_type)); diff --git a/src/components/include/test/application_manager/mock_rpc_service.h b/src/components/include/test/application_manager/mock_rpc_service.h new file mode 100644 index 0000000000..98ed57d77e --- /dev/null +++ b/src/components/include/test/application_manager/mock_rpc_service.h @@ -0,0 +1,36 @@ +#ifndef MOCK_RPC_SERVICE_H +#define MOCK_RPC_SERVICE_H + +#include "gmock/gmock.h" +#include "application_manager/rpc_service.h" + +namespace test { +namespace components { +namespace application_manager_test { + +class MockRPCService : public application_manager::rpc_service::RPCService { + public: + MOCK_METHOD1( + ManageHMICommand, + bool(const application_manager::commands::MessageSharedPtr message)); + MOCK_METHOD2( + ManageMobileCommand, + bool(const application_manager::commands::MessageSharedPtr message, + application_manager::commands::Command::CommandOrigin origin)); + MOCK_METHOD2(SendMessageToMobile, + void(application_manager::commands::MessageSharedPtr, bool)); + MOCK_METHOD1( + SendMessageToHMI, + void(const application_manager::commands::MessageSharedPtr message)); +#ifdef SDL_REMOTE_CONTROL + MOCK_METHOD1(SendPostMessageToMobile, + void(const application_manager::MessagePtr& message)); + MOCK_METHOD1(SendPostMessageToHMI, + void(const application_manager::MessagePtr& message)); +#endif // SDL_REMOTE_CONTROL +}; +} +} +} + +#endif // MOCK_RPC_SERVICE_H -- cgit v1.2.1 From d7c0131acbf1af7b8d1d13029c8dadbd4ebe4f63 Mon Sep 17 00:00:00 2001 From: Ira Lytvynenko Date: Fri, 2 Feb 2018 18:49:10 +0200 Subject: RPCHandler implementation Fix tests Fix due to rebase Fix unit tests in mobile commands Fixed unit tests in next commands: - delete_command_request_test.cc - delete_sub_menu_test.cc - perform_audio_pass_thru_test.cc - reset_global_properties_test.cc - send_location_request_test.cc - set_global_properties_test.cc --- .../include/test/application_manager/mock_application_manager.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/components/include/test') diff --git a/src/components/include/test/application_manager/mock_application_manager.h b/src/components/include/test/application_manager/mock_application_manager.h index 759e106a56..3a9afbfbdf 100644 --- a/src/components/include/test/application_manager/mock_application_manager.h +++ b/src/components/include/test/application_manager/mock_application_manager.h @@ -144,6 +144,9 @@ class MockApplicationManager : public application_manager::ApplicationManager { MOCK_CONST_METHOD0(GetPolicyHandler, const policy::PolicyHandlerInterface&()); MOCK_CONST_METHOD0(GetRPCService, application_manager::rpc_service::RPCService&()); + MOCK_CONST_METHOD0(GetRPCHandler, + application_manager::rpc_handler::RPCHandler&()); + MOCK_CONST_METHOD0(is_stopping, bool()); MOCK_METHOD0(GetNextHMICorrelationID, uint32_t()); MOCK_METHOD0(GenerateNewHMIAppID, uint32_t()); MOCK_METHOD1(EndNaviServices, void(uint32_t app_id)); -- cgit v1.2.1 From 210c3fa42d65f59c295816b23d8c33fdab005acb Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Tue, 6 Feb 2018 16:18:29 +0200 Subject: Plugin manager and plugin interface creation add Optional type Fix compile warnings and use optional for returning plugin Add descriptions to optional Fix review issues Fix header guards Fix build with unit tests after commands factory refactoring - Change enum name from command origin to command source - Create Mock for command factory class - Fix mock_app_manager after refactoring - Fix failed unit test --- .../include/test/application_manager/mock_application_manager.h | 2 ++ src/components/include/test/application_manager/mock_rpc_service.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src/components/include/test') diff --git a/src/components/include/test/application_manager/mock_application_manager.h b/src/components/include/test/application_manager/mock_application_manager.h index 3a9afbfbdf..4caa9393f6 100644 --- a/src/components/include/test/application_manager/mock_application_manager.h +++ b/src/components/include/test/application_manager/mock_application_manager.h @@ -127,6 +127,8 @@ class MockApplicationManager : public application_manager::ApplicationManager { MOCK_METHOD0(hmi_capabilities, application_manager::HMICapabilities&()); MOCK_CONST_METHOD0(hmi_capabilities, const application_manager::HMICapabilities&()); + MOCK_CONST_METHOD0(GetCommandFactory, application_manager::CommandFactory&()); + MOCK_CONST_METHOD0(is_audio_pass_thru_active, bool()); MOCK_METHOD2(ProcessQueryApp, void(const smart_objects::SmartObject& sm_object, const uint32_t connection_key)); diff --git a/src/components/include/test/application_manager/mock_rpc_service.h b/src/components/include/test/application_manager/mock_rpc_service.h index 98ed57d77e..983e969b0a 100644 --- a/src/components/include/test/application_manager/mock_rpc_service.h +++ b/src/components/include/test/application_manager/mock_rpc_service.h @@ -16,7 +16,7 @@ class MockRPCService : public application_manager::rpc_service::RPCService { MOCK_METHOD2( ManageMobileCommand, bool(const application_manager::commands::MessageSharedPtr message, - application_manager::commands::Command::CommandOrigin origin)); + application_manager::commands::Command::CommandSource origin)); MOCK_METHOD2(SendMessageToMobile, void(application_manager::commands::MessageSharedPtr, bool)); MOCK_METHOD1( -- cgit v1.2.1 From 0e7b196dd678ce3dbb8886633f2f918e3c0068bf Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Wed, 7 Feb 2018 16:51:39 +0200 Subject: Remove all remote controll Remove commands includes Remove commands includes --- .../include/test/application_manager/mock_application_manager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/components/include/test') diff --git a/src/components/include/test/application_manager/mock_application_manager.h b/src/components/include/test/application_manager/mock_application_manager.h index 4caa9393f6..cbb8048b53 100644 --- a/src/components/include/test/application_manager/mock_application_manager.h +++ b/src/components/include/test/application_manager/mock_application_manager.h @@ -82,7 +82,7 @@ class MockApplicationManager : public application_manager::ApplicationManager { const std::string& policy_app_id)); MOCK_METHOD2(ChangeAppsHMILevel, void(uint32_t app_id, mobile_apis::HMILevel::eType level)); - MOCK_METHOD0(GetPluginManager, functional_modules::PluginManager&()); + MOCK_METHOD0(GetPluginManager, plugin_manager::RPCPluginManager&()); MOCK_CONST_METHOD1( devices, std::vector(const std::string& policy_app_id)); #endif // SDL_REMOTE_CONTROL -- cgit v1.2.1 From 2294f0ba776c8dbb9a903ff567d53e91a059b906 Mon Sep 17 00:00:00 2001 From: BSolonenko Date: Mon, 12 Feb 2018 16:42:25 +0200 Subject: Replaced all usages of passed parameters in implementation. Replaced all usages of passed parameters in implementation from application manager proxy to indirect call Add missed factories Remove commands includes --- .../include/test/application_manager/mock_application_manager.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/components/include/test') diff --git a/src/components/include/test/application_manager/mock_application_manager.h b/src/components/include/test/application_manager/mock_application_manager.h index cbb8048b53..e74d2569ab 100644 --- a/src/components/include/test/application_manager/mock_application_manager.h +++ b/src/components/include/test/application_manager/mock_application_manager.h @@ -127,8 +127,6 @@ class MockApplicationManager : public application_manager::ApplicationManager { MOCK_METHOD0(hmi_capabilities, application_manager::HMICapabilities&()); MOCK_CONST_METHOD0(hmi_capabilities, const application_manager::HMICapabilities&()); - MOCK_CONST_METHOD0(GetCommandFactory, application_manager::CommandFactory&()); - MOCK_CONST_METHOD0(is_audio_pass_thru_active, bool()); MOCK_METHOD2(ProcessQueryApp, void(const smart_objects::SmartObject& sm_object, const uint32_t connection_key)); -- cgit v1.2.1 From 376c972ba76aa042fbd17f36cce9518d57d7b52d Mon Sep 17 00:00:00 2001 From: Valerii Date: Wed, 7 Feb 2018 16:42:01 +0200 Subject: Fix build with unit tests after commands factory refactoring - Change enum name from command origin to command source - Create Mock for command factory class - Fix mock_app_manager after refactoring - Fix failed unit test Fix unit test in progress Add asser in plugin manager getter Fixed UT Application manager impl -Add method "SetRPCService" into the class ApplicationManagerImpl Fixed UT Application manager impl -Add method "SetRPCService" into the class ApplicationManagerImpl Fixed UT Application manager impl -Add method "SetRPCService" into the class ApplicationManagerImpl Fixed UTs for hmi and mobile commands. --- .../include/test/application_manager/mock_application_manager.h | 7 ++++++- .../include/test/application_manager/mock_rpc_service.h | 4 ++++ .../test/policy/policy_external/policy/mock_policy_manager.h | 9 ++++----- 3 files changed, 14 insertions(+), 6 deletions(-) (limited to 'src/components/include/test') diff --git a/src/components/include/test/application_manager/mock_application_manager.h b/src/components/include/test/application_manager/mock_application_manager.h index e74d2569ab..da227c7b60 100644 --- a/src/components/include/test/application_manager/mock_application_manager.h +++ b/src/components/include/test/application_manager/mock_application_manager.h @@ -51,6 +51,8 @@ #include "application_manager/event_engine/event_dispatcher.h" #include "application_manager/state_controller.h" #include "smart_objects/smart_object.h" +#include "application_manager/plugin_manager/rpc_plugin_manager.h" +#include "application_manager/command_factory.h" namespace test { namespace components { @@ -82,7 +84,8 @@ class MockApplicationManager : public application_manager::ApplicationManager { const std::string& policy_app_id)); MOCK_METHOD2(ChangeAppsHMILevel, void(uint32_t app_id, mobile_apis::HMILevel::eType level)); - MOCK_METHOD0(GetPluginManager, plugin_manager::RPCPluginManager&()); + MOCK_METHOD0(GetPluginManager, + application_manager::plugin_manager::RPCPluginManager&()); MOCK_CONST_METHOD1( devices, std::vector(const std::string& policy_app_id)); #endif // SDL_REMOTE_CONTROL @@ -311,6 +314,8 @@ class MockApplicationManager : public application_manager::ApplicationManager { const uint32_t connection_key)); MOCK_CONST_METHOD1(IsAppInReconnectMode, bool(const std::string& policy_app_id)); + MOCK_CONST_METHOD0(GetCommandFactory, application_manager::CommandFactory&()); + MOCK_CONST_METHOD0(is_audio_pass_thru_active, bool()); }; } // namespace application_manager_test diff --git a/src/components/include/test/application_manager/mock_rpc_service.h b/src/components/include/test/application_manager/mock_rpc_service.h index 983e969b0a..360faae3ec 100644 --- a/src/components/include/test/application_manager/mock_rpc_service.h +++ b/src/components/include/test/application_manager/mock_rpc_service.h @@ -27,6 +27,10 @@ class MockRPCService : public application_manager::rpc_service::RPCService { void(const application_manager::MessagePtr& message)); MOCK_METHOD1(SendPostMessageToHMI, void(const application_manager::MessagePtr& message)); + MOCK_METHOD1(set_protocol_handler, + void(protocol_handler::ProtocolHandler* handler)); + MOCK_METHOD1(set_hmi_message_handler, + void(hmi_message_handler::HMIMessageHandler* handler)); #endif // SDL_REMOTE_CONTROL }; } diff --git a/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h b/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h index 96e484acae..b48ebb59de 100644 --- a/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h +++ b/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h @@ -67,7 +67,7 @@ class MockPolicyManager : public PolicyManager { MOCK_METHOD2(GetUpdateUrls, void(const std::string& service_type, EndpointUrls& out_end_points)); - MOCK_METHOD0(RequestPTUpdate, void()); + MOCK_METHOD0(RequestPTUpdate, bool()); MOCK_METHOD5(CheckPermissions, void(const PTString& app_id, const PTString& hmi_level, @@ -81,7 +81,7 @@ class MockPolicyManager : public PolicyManager { MOCK_METHOD0(ForcePTExchange, std::string()); MOCK_METHOD0(ForcePTExchangeAtUserRequest, std::string()); MOCK_METHOD0(ResetRetrySequence, void()); - MOCK_METHOD0(NextRetryTimeout, int()); + MOCK_METHOD0(NextRetryTimeout, uint32_t()); MOCK_METHOD0(TimeoutExchangeMSec, uint32_t()); MOCK_METHOD0(RetrySequenceDelaysSeconds, const std::vector()); MOCK_METHOD0(OnExceededTimeout, void()); @@ -110,9 +110,8 @@ class MockPolicyManager : public PolicyManager { MOCK_METHOD2(SetDeviceInfo, void(const std::string& device_id, const policy::DeviceInfo& device_info)); - MOCK_METHOD2(SetUserConsentForApp, - void(const policy::PermissionConsent& permissions, - const NotificationMode mode)); + MOCK_METHOD1(SetUserConsentForApp, + void(const policy::PermissionConsent& permissions)); MOCK_CONST_METHOD2(GetDefaultHmi, bool(const std::string& policy_app_id, std::string* default_hmi)); -- cgit v1.2.1 From 20cfb81a16fe9569ad21be03108223610d913126 Mon Sep 17 00:00:00 2001 From: BSolonenko Date: Fri, 16 Feb 2018 13:35:10 +0200 Subject: Refactoring sdl rpc plugin's factories --- .../include/test/application_manager/mock_application_manager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/components/include/test') diff --git a/src/components/include/test/application_manager/mock_application_manager.h b/src/components/include/test/application_manager/mock_application_manager.h index da227c7b60..be806288b5 100644 --- a/src/components/include/test/application_manager/mock_application_manager.h +++ b/src/components/include/test/application_manager/mock_application_manager.h @@ -122,7 +122,7 @@ class MockApplicationManager : public application_manager::ApplicationManager { SendHMIStatusNotification, void(const utils::SharedPtr app)); MOCK_METHOD1(RemoveHMIFakeParameters, - void(application_manager::MessagePtr& message)); + void(smart_objects::SmartObjectSPtr& message)); MOCK_CONST_METHOD1( GetDefaultHmiLevel, mobile_apis::HMILevel::eType( -- cgit v1.2.1 From a07dc2b3df6324d8d238f08c266251214e2cb683 Mon Sep 17 00:00:00 2001 From: "Ira Lytvynenko (GitHub)" Date: Tue, 15 May 2018 13:42:31 +0300 Subject: Fix build with UTs --- .../include/test/application_manager/mock_application_manager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/components/include/test') diff --git a/src/components/include/test/application_manager/mock_application_manager.h b/src/components/include/test/application_manager/mock_application_manager.h index be806288b5..da227c7b60 100644 --- a/src/components/include/test/application_manager/mock_application_manager.h +++ b/src/components/include/test/application_manager/mock_application_manager.h @@ -122,7 +122,7 @@ class MockApplicationManager : public application_manager::ApplicationManager { SendHMIStatusNotification, void(const utils::SharedPtr app)); MOCK_METHOD1(RemoveHMIFakeParameters, - void(smart_objects::SmartObjectSPtr& message)); + void(application_manager::MessagePtr& message)); MOCK_CONST_METHOD1( GetDefaultHmiLevel, mobile_apis::HMILevel::eType( -- cgit v1.2.1 From 0f058ffca2685c2630b8b31561b2b77f799b7cf5 Mon Sep 17 00:00:00 2001 From: Ira Lytvynenko Date: Sun, 18 Feb 2018 18:32:17 +0200 Subject: Fix UTs Fixed application_manager_mock_hmi_test (SEGFAULT) Added mock_rpc_plugin.h & mock_rpc_plugin_manager.h Changed application_manager_impl.h, application_manager.h & mock_application_manager.h Fixed application_manager_impl.cc, rpc_plugin_manager.h application_manager_impl_mock_hmi_test.cc --- .../application_manager/mock_application_manager.h | 8 ++++-- .../test/application_manager/mock_rpc_plugin.h | 31 ++++++++++++++++++++++ .../application_manager/mock_rpc_plugin_manager.h | 24 +++++++++++++++++ 3 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 src/components/include/test/application_manager/mock_rpc_plugin.h create mode 100644 src/components/include/test/application_manager/mock_rpc_plugin_manager.h (limited to 'src/components/include/test') diff --git a/src/components/include/test/application_manager/mock_application_manager.h b/src/components/include/test/application_manager/mock_application_manager.h index da227c7b60..22d0b2288b 100644 --- a/src/components/include/test/application_manager/mock_application_manager.h +++ b/src/components/include/test/application_manager/mock_application_manager.h @@ -35,6 +35,7 @@ #include #include +#include #include "gmock/gmock.h" @@ -57,6 +58,7 @@ namespace test { namespace components { namespace application_manager_test { +using application_manager::plugin_manager::RPCPluginManager; class MockApplicationManager : public application_manager::ApplicationManager { public: @@ -84,11 +86,13 @@ class MockApplicationManager : public application_manager::ApplicationManager { const std::string& policy_app_id)); MOCK_METHOD2(ChangeAppsHMILevel, void(uint32_t app_id, mobile_apis::HMILevel::eType level)); - MOCK_METHOD0(GetPluginManager, - application_manager::plugin_manager::RPCPluginManager&()); MOCK_CONST_METHOD1( devices, std::vector(const std::string& policy_app_id)); #endif // SDL_REMOTE_CONTROL + MOCK_METHOD0(GetPluginManager, RPCPluginManager&()); + + MOCK_METHOD1(SetPluginManager, + void(std::unique_ptr& plugin_manager)); MOCK_CONST_METHOD1( application_by_hmi_app, diff --git a/src/components/include/test/application_manager/mock_rpc_plugin.h b/src/components/include/test/application_manager/mock_rpc_plugin.h new file mode 100644 index 0000000000..4059132b50 --- /dev/null +++ b/src/components/include/test/application_manager/mock_rpc_plugin.h @@ -0,0 +1,31 @@ +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_MOCK_RPC_PLUGIN_H +#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_MOCK_RPC_PLUGIN_H + +#include "gmock/gmock.h" +#include "application_manager/plugin_manager/rpc_plugin.h" + +namespace application_manager { +class CommandFactory; +namespace plugin_manager { + +namespace plugin_manager {} +class MockRPCPlugin : public RPCPlugin { + public: + MOCK_METHOD4(Init, + bool(ApplicationManager& app_manager, + rpc_service::RPCService& rpc_service, + HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler)); + MOCK_METHOD2(IsAbleToProcess, + bool(const int32_t function_id, + const commands::Command::CommandSource message_source)); + MOCK_METHOD0(PluginName, std::string()); + MOCK_METHOD0(GetCommandFactory, CommandFactory&()); + MOCK_METHOD1(OnPolicyEvent, void(PolicyEvent event)); + MOCK_METHOD2(OnApplicationEvent, + void(ApplicationEvent event, + application_manager::ApplicationSharedPtr application)); +}; +} // namespace plugin_manager +} // namespace application_manager +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_MOCK_RPC_PLUGIN_H diff --git a/src/components/include/test/application_manager/mock_rpc_plugin_manager.h b/src/components/include/test/application_manager/mock_rpc_plugin_manager.h new file mode 100644 index 0000000000..74763f00d6 --- /dev/null +++ b/src/components/include/test/application_manager/mock_rpc_plugin_manager.h @@ -0,0 +1,24 @@ +#ifndef SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_RPC_PLUGIN_MANAGER_H_ +#define SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_RPC_PLUGIN_MANAGER_H_ +#include + +#include "gmock/gmock.h" +#include "application_manager/plugin_manager/rpc_plugin_manager.h" + +namespace application_manager { +namespace plugin_manager { + +class MockRPCPluginManager : public RPCPluginManager { + public: + MOCK_METHOD1(LoadPlugins, uint32_t(const std::string& plugins_path)); + MOCK_METHOD0(GetPlugins, std::vector&()); + MOCK_METHOD2(FindPluginToProcess, + utils::Optional( + const int32_t function_id, + const commands::Command::CommandSource message_source)); + MOCK_METHOD1(ForEachPlugin, void(std::function functor)); +}; + +} // namespace plugin_manager +} // namespace application_manager +#endif // SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_RPC_PLUGIN_MANAGER_H_ -- cgit v1.2.1 From bdeb1e49ec25d0a459c8344b56659b23875a8028 Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Mon, 12 Feb 2018 13:01:51 +0200 Subject: Add Resource allocation manager stub Implementation of resource allocaiton manager Resource allocation manager tests Fix unit test fo RA Add logger in unit test target to have ability analyze unit tests run without debug Init logger in tests --- .../include/test/application_manager/mock_application_manager.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/components/include/test') diff --git a/src/components/include/test/application_manager/mock_application_manager.h b/src/components/include/test/application_manager/mock_application_manager.h index 22d0b2288b..86789b24bc 100644 --- a/src/components/include/test/application_manager/mock_application_manager.h +++ b/src/components/include/test/application_manager/mock_application_manager.h @@ -154,6 +154,7 @@ class MockApplicationManager : public application_manager::ApplicationManager { MOCK_CONST_METHOD0(GetRPCHandler, application_manager::rpc_handler::RPCHandler&()); MOCK_CONST_METHOD0(is_stopping, bool()); + MOCK_CONST_METHOD0(is_audio_pass_thru_active, bool()); MOCK_METHOD0(GetNextHMICorrelationID, uint32_t()); MOCK_METHOD0(GenerateNewHMIAppID, uint32_t()); MOCK_METHOD1(EndNaviServices, void(uint32_t app_id)); -- cgit v1.2.1 From 6fe8d9e3a7a29bf060fe20d42d0aae3662393432 Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Thu, 15 Feb 2018 13:02:42 +0200 Subject: Add supported functions of RC plugin Fix compiling RC and SDL plugins Remove commands includes Add bson target to avoid cmake warnings --- .../include/test/application_manager/mock_application_manager.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/components/include/test') diff --git a/src/components/include/test/application_manager/mock_application_manager.h b/src/components/include/test/application_manager/mock_application_manager.h index 86789b24bc..dd2d604d3b 100644 --- a/src/components/include/test/application_manager/mock_application_manager.h +++ b/src/components/include/test/application_manager/mock_application_manager.h @@ -320,7 +320,6 @@ class MockApplicationManager : public application_manager::ApplicationManager { MOCK_CONST_METHOD1(IsAppInReconnectMode, bool(const std::string& policy_app_id)); MOCK_CONST_METHOD0(GetCommandFactory, application_manager::CommandFactory&()); - MOCK_CONST_METHOD0(is_audio_pass_thru_active, bool()); }; } // namespace application_manager_test -- cgit v1.2.1 From c8c46e8a07a7817db63b8cfed6c8834f43296715 Mon Sep 17 00:00:00 2001 From: Litvinenko Ira Date: Thu, 15 Feb 2018 13:35:10 +0000 Subject: SetInteriorVehicleData implementation and some fixes Remove unused code --- .../include/test/application_manager/mock_application_manager.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/components/include/test') diff --git a/src/components/include/test/application_manager/mock_application_manager.h b/src/components/include/test/application_manager/mock_application_manager.h index dd2d604d3b..c771c48b40 100644 --- a/src/components/include/test/application_manager/mock_application_manager.h +++ b/src/components/include/test/application_manager/mock_application_manager.h @@ -311,9 +311,6 @@ class MockApplicationManager : public application_manager::ApplicationManager { protocol_handler::ServiceType service_type, bool result, std::vector& rejected_params)); - MOCK_METHOD1(ValidateMessageBySchema, - application_manager::MessageValidationResult( - const application_manager::Message& message)); MOCK_METHOD2(ProcessReconnection, void(application_manager::ApplicationSharedPtr application, const uint32_t connection_key)); -- cgit v1.2.1 From 9fc8889ca79de0b7b8a1bc0d4e6dd6a10a0d22f2 Mon Sep 17 00:00:00 2001 From: BSolonenko Date: Fri, 16 Feb 2018 16:43:15 +0200 Subject: Refactoring rc rpc plugin's factory --- .../include/test/application_manager/mock_application_manager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/components/include/test') diff --git a/src/components/include/test/application_manager/mock_application_manager.h b/src/components/include/test/application_manager/mock_application_manager.h index c771c48b40..1db09ed18f 100644 --- a/src/components/include/test/application_manager/mock_application_manager.h +++ b/src/components/include/test/application_manager/mock_application_manager.h @@ -126,7 +126,7 @@ class MockApplicationManager : public application_manager::ApplicationManager { SendHMIStatusNotification, void(const utils::SharedPtr app)); MOCK_METHOD1(RemoveHMIFakeParameters, - void(application_manager::MessagePtr& message)); + void(smart_objects::SmartObjectSPtr& message)); MOCK_CONST_METHOD1( GetDefaultHmiLevel, mobile_apis::HMILevel::eType( -- cgit v1.2.1 From 4453774c786f847c3a533a73f58439dc8ca64a55 Mon Sep 17 00:00:00 2001 From: Ira Lytvynenko Date: Sun, 18 Feb 2018 18:32:17 +0200 Subject: UTS for ButtonPress Fix UT of the rc commands -Get interior vehicle data request test Fix UTs Fixed application_manager_mock_hmi_test (SEGFAULT) Added mock_rpc_plugin.h & mock_rpc_plugin_manager.h Changed application_manager_impl.h, application_manager.h & mock_application_manager.h Fixed application_manager_impl.cc, rpc_plugin_manager.h application_manager_impl_mock_hmi_test.cc --- .../include/test/application_manager/mock_application_manager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/components/include/test') diff --git a/src/components/include/test/application_manager/mock_application_manager.h b/src/components/include/test/application_manager/mock_application_manager.h index 1db09ed18f..007df9e482 100644 --- a/src/components/include/test/application_manager/mock_application_manager.h +++ b/src/components/include/test/application_manager/mock_application_manager.h @@ -126,7 +126,7 @@ class MockApplicationManager : public application_manager::ApplicationManager { SendHMIStatusNotification, void(const utils::SharedPtr app)); MOCK_METHOD1(RemoveHMIFakeParameters, - void(smart_objects::SmartObjectSPtr& message)); + void(application_manager::commands::MessageSharedPtr& message)); MOCK_CONST_METHOD1( GetDefaultHmiLevel, mobile_apis::HMILevel::eType( -- cgit v1.2.1 From 73e756b65d60a606253e8a24a2f1a0c909882158 Mon Sep 17 00:00:00 2001 From: "Ira Lytvynenko (GitHub)" Date: Tue, 29 May 2018 14:05:34 +0300 Subject: Remove remote control flag --- .../test/application_manager/mock_application_manager.h | 3 --- .../include/test/application_manager/mock_rpc_service.h | 6 ------ .../policies/mock_policy_handler_interface.h | 2 -- .../test/policy/policy_external/policy/mock_policy_listener.h | 2 -- .../test/policy/policy_external/policy/mock_policy_manager.h | 11 +++++------ .../test/policy/policy_regular/policy/mock_policy_listener.h | 2 -- .../test/policy/policy_regular/policy/mock_policy_manager.h | 2 -- 7 files changed, 5 insertions(+), 23 deletions(-) (limited to 'src/components/include/test') diff --git a/src/components/include/test/application_manager/mock_application_manager.h b/src/components/include/test/application_manager/mock_application_manager.h index 007df9e482..fb3578c2f0 100644 --- a/src/components/include/test/application_manager/mock_application_manager.h +++ b/src/components/include/test/application_manager/mock_application_manager.h @@ -78,8 +78,6 @@ class MockApplicationManager : public application_manager::ApplicationManager { application, application_manager::ApplicationSharedPtr(uint32_t app_id)); MOCK_CONST_METHOD0(active_application, application_manager::ApplicationSharedPtr()); - -#ifdef SDL_REMOTE_CONTROL MOCK_CONST_METHOD2(application, application_manager::ApplicationSharedPtr( const std::string& device_id, @@ -88,7 +86,6 @@ class MockApplicationManager : public application_manager::ApplicationManager { void(uint32_t app_id, mobile_apis::HMILevel::eType level)); MOCK_CONST_METHOD1( devices, std::vector(const std::string& policy_app_id)); -#endif // SDL_REMOTE_CONTROL MOCK_METHOD0(GetPluginManager, RPCPluginManager&()); MOCK_METHOD1(SetPluginManager, diff --git a/src/components/include/test/application_manager/mock_rpc_service.h b/src/components/include/test/application_manager/mock_rpc_service.h index 360faae3ec..4eddbbe257 100644 --- a/src/components/include/test/application_manager/mock_rpc_service.h +++ b/src/components/include/test/application_manager/mock_rpc_service.h @@ -22,16 +22,10 @@ class MockRPCService : public application_manager::rpc_service::RPCService { MOCK_METHOD1( SendMessageToHMI, void(const application_manager::commands::MessageSharedPtr message)); -#ifdef SDL_REMOTE_CONTROL - MOCK_METHOD1(SendPostMessageToMobile, - void(const application_manager::MessagePtr& message)); - MOCK_METHOD1(SendPostMessageToHMI, - void(const application_manager::MessagePtr& message)); MOCK_METHOD1(set_protocol_handler, void(protocol_handler::ProtocolHandler* handler)); MOCK_METHOD1(set_hmi_message_handler, void(hmi_message_handler::HMIMessageHandler* handler)); -#endif // SDL_REMOTE_CONTROL }; } } diff --git a/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h b/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h index dfd537c678..ffa9222c8e 100644 --- a/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h +++ b/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h @@ -239,7 +239,6 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface { void(const std::string& service_type, policy::EndpointUrls& end_points)); -#ifdef SDL_REMOTE_CONTROL MOCK_METHOD3(OnUpdateHMILevel, void(const std::string& device_id, const std::string& policy_app_id, @@ -270,7 +269,6 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface { MOCK_METHOD2(OnDeviceSwitching, void(const std::string& device_id_from, const std::string& device_id_to)); -#endif // SDL_REMOTE_CONTROL private: #ifdef EXTERNAL_PROPRIETARY_MODE diff --git a/src/components/include/test/policy/policy_external/policy/mock_policy_listener.h b/src/components/include/test/policy/policy_external/policy/mock_policy_listener.h index ad2f1fd56c..1f570d8699 100644 --- a/src/components/include/test/policy/policy_external/policy/mock_policy_listener.h +++ b/src/components/include/test/policy/policy_external/policy/mock_policy_listener.h @@ -92,7 +92,6 @@ class MockPolicyListener : public ::policy::PolicyListener { const std::string& hmi_level)); MOCK_CONST_METHOD1(GetRegisteredLinks, void(std::map&)); -#ifdef SDL_REMOTE_CONTROL MOCK_METHOD1(OnRemoteAllowedChanged, void(bool new_consent)); MOCK_METHOD2(OnRemoteAppPermissionsChanged, void(const std::string& device_id, @@ -101,7 +100,6 @@ class MockPolicyListener : public ::policy::PolicyListener { void(const std::string& device_id, const std::string& policy_app_id, const std::string& hmi_level)); -#endif // SDL_REMOTE_CONTROL }; } // namespace policy_test diff --git a/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h b/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h index b48ebb59de..ea259fc916 100644 --- a/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h +++ b/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h @@ -67,7 +67,7 @@ class MockPolicyManager : public PolicyManager { MOCK_METHOD2(GetUpdateUrls, void(const std::string& service_type, EndpointUrls& out_end_points)); - MOCK_METHOD0(RequestPTUpdate, bool()); + MOCK_METHOD0(RequestPTUpdate, void()); MOCK_METHOD5(CheckPermissions, void(const PTString& app_id, const PTString& hmi_level, @@ -81,7 +81,7 @@ class MockPolicyManager : public PolicyManager { MOCK_METHOD0(ForcePTExchange, std::string()); MOCK_METHOD0(ForcePTExchangeAtUserRequest, std::string()); MOCK_METHOD0(ResetRetrySequence, void()); - MOCK_METHOD0(NextRetryTimeout, uint32_t()); + MOCK_METHOD0(NextRetryTimeout, int()); MOCK_METHOD0(TimeoutExchangeMSec, uint32_t()); MOCK_METHOD0(RetrySequenceDelaysSeconds, const std::vector()); MOCK_METHOD0(OnExceededTimeout, void()); @@ -110,8 +110,9 @@ class MockPolicyManager : public PolicyManager { MOCK_METHOD2(SetDeviceInfo, void(const std::string& device_id, const policy::DeviceInfo& device_info)); - MOCK_METHOD1(SetUserConsentForApp, - void(const policy::PermissionConsent& permissions)); + MOCK_METHOD2(SetUserConsentForApp, + void(const policy::PermissionConsent& permissions, + const policy::PolicyManager::NotificationMode mode)); MOCK_CONST_METHOD2(GetDefaultHmi, bool(const std::string& policy_app_id, std::string* default_hmi)); @@ -147,7 +148,6 @@ class MockPolicyManager : public PolicyManager { StatusNotifier( const std::string& application_id, const rpc::policy_table_interface_base::AppHmiTypes& hmi_types)); -#ifdef SDL_REMOTE_CONTROL MOCK_METHOD2(SetDefaultHmiTypes, void(const std::string& application_id, const std::vector& hmi_types)); @@ -164,7 +164,6 @@ class MockPolicyManager : public PolicyManager { std::vector* modules)); MOCK_METHOD1(set_access_remote, void(utils::SharedPtr access_remote)); -#endif // SDL_REMOTE_CONTROL MOCK_METHOD0(CleanupUnpairedDevices, bool()); MOCK_CONST_METHOD1(CanAppKeepContext, bool(const std::string& app_id)); diff --git a/src/components/include/test/policy/policy_regular/policy/mock_policy_listener.h b/src/components/include/test/policy/policy_regular/policy/mock_policy_listener.h index d98a0279d7..3b0c1a925e 100644 --- a/src/components/include/test/policy/policy_regular/policy/mock_policy_listener.h +++ b/src/components/include/test/policy/policy_regular/policy/mock_policy_listener.h @@ -85,7 +85,6 @@ class MockPolicyListener : public ::policy::PolicyListener { std::vector(const std::string& policy_app_id)); MOCK_CONST_METHOD1(GetRegisteredLinks, void(std::map&)); -#ifdef SDL_REMOTE_CONTROL MOCK_METHOD1(OnRemoteAllowedChanged, void(bool new_consent)); MOCK_METHOD2(OnRemoteAppPermissionsChanged, void(const std::string& device_id, @@ -94,7 +93,6 @@ class MockPolicyListener : public ::policy::PolicyListener { void(const std::string& device_id, const std::string& policy_app_id, const std::string& hmi_level)); -#endif // SDL_REMOTE_CONTROL }; } // namespace policy_test diff --git a/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h b/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h index e0214934ee..952b264caf 100644 --- a/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h +++ b/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h @@ -147,7 +147,6 @@ class MockPolicyManager : public PolicyManager { StatusNotifier( const std::string& application_id, const rpc::policy_table_interface_base::AppHmiTypes& hmi_types)); -#ifdef SDL_REMOTE_CONTROL MOCK_METHOD2(SetDefaultHmiTypes, void(const std::string& application_id, const std::vector& hmi_types)); @@ -164,7 +163,6 @@ class MockPolicyManager : public PolicyManager { std::vector* modules)); MOCK_METHOD1(set_access_remote, void(utils::SharedPtr access_remote)); -#endif // SDL_REMOTE_CONTROL MOCK_METHOD0(CleanupUnpairedDevices, bool()); MOCK_CONST_METHOD1(CanAppKeepContext, bool(const std::string& app_id)); MOCK_CONST_METHOD1(CanAppStealFocus, bool(const std::string& app_id)); -- cgit v1.2.1 From 4752f7b32a961d8dc60019d0256424a6b93bc598 Mon Sep 17 00:00:00 2001 From: Alexander Date: Sun, 17 Jun 2018 21:13:28 +0300 Subject: Move IsSubsscrbedTo to plugin --- .../include/test/application_manager/mock_application_manager.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/components/include/test') diff --git a/src/components/include/test/application_manager/mock_application_manager.h b/src/components/include/test/application_manager/mock_application_manager.h index fb3578c2f0..09957dbde0 100644 --- a/src/components/include/test/application_manager/mock_application_manager.h +++ b/src/components/include/test/application_manager/mock_application_manager.h @@ -163,9 +163,8 @@ class MockApplicationManager : public application_manager::ApplicationManager { MOCK_METHOD0(OnHMIStartedCooperation, void()); MOCK_CONST_METHOD0(IsHMICooperating, bool()); MOCK_METHOD2(IviInfoUpdated, - std::vector( - mobile_apis::VehicleDataType::eType vehicle_info, - int value)); + void(mobile_apis::VehicleDataType::eType vehicle_info, + int value)); MOCK_METHOD1(RegisterApplication, application_manager::ApplicationSharedPtr(const utils::SharedPtr< smart_objects::SmartObject>& request_for_registration)); -- cgit v1.2.1 From e8d91bde77671b2448d041a05ef6ebbec13d8668 Mon Sep 17 00:00:00 2001 From: Andriy Byzhynar Date: Mon, 18 Jun 2018 13:04:45 +0300 Subject: Add mock for AppExtension class --- .../test/application_manager/mock_app_extension.h | 62 ++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 src/components/include/test/application_manager/mock_app_extension.h (limited to 'src/components/include/test') diff --git a/src/components/include/test/application_manager/mock_app_extension.h b/src/components/include/test/application_manager/mock_app_extension.h new file mode 100644 index 0000000000..eb8fcd51cf --- /dev/null +++ b/src/components/include/test/application_manager/mock_app_extension.h @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2018, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_APP_EXTENSION_H_ +#define SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_APP_EXTENSION_H_ + +#include "gmock/gmock.h" +#include "application_manager/app_extension.h" + +namespace test { +namespace components { +namespace application_manager_test { + +namespace { +static unsigned MockAppExtensionUID = 123; +} // namespace + +class MockAppExtension : public application_manager::AppExtension { + public: + MockAppExtension() : AppExtension(MockAppExtensionUID) {} + MOCK_METHOD1( + SaveResumptionData, + void(NsSmartDeviceLink::NsSmartObjects::SmartObject& resumption_data)); + MOCK_METHOD1(ProcessResumption, + void(const NsSmartDeviceLink::NsSmartObjects::SmartObject& + resumption_data)); +}; + +} // namespace application_manager_test +} // namespace components +} // namespace test + +#endif // SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_APP_EXTENSION_H_ -- cgit v1.2.1 From 069b2b8bc692623ee2bc87ecb118a48777b5999c Mon Sep 17 00:00:00 2001 From: Andriy Byzhynar Date: Mon, 18 Jun 2018 15:55:56 +0300 Subject: Fix unit tests Fixed the following unit tests: - resume_ctrl_test - resumption_data_json_test --- src/components/include/test/application_manager/mock_rpc_plugin.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/components/include/test') diff --git a/src/components/include/test/application_manager/mock_rpc_plugin.h b/src/components/include/test/application_manager/mock_rpc_plugin.h index 4059132b50..1f7dd8951b 100644 --- a/src/components/include/test/application_manager/mock_rpc_plugin.h +++ b/src/components/include/test/application_manager/mock_rpc_plugin.h @@ -8,7 +8,6 @@ namespace application_manager { class CommandFactory; namespace plugin_manager { -namespace plugin_manager {} class MockRPCPlugin : public RPCPlugin { public: MOCK_METHOD4(Init, -- cgit v1.2.1 From b4c6b5e040783ccd8cb74d411024d3b8a19c9c84 Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Wed, 27 Jun 2018 11:11:37 +0900 Subject: Merge pull request #290 in NAR/sdl-core from bugfix/handle_review to feature/Ford-WiFi * commit '9d4d335347fe5ccf69c99e21d2e12e9a2bcd0fd7': address review comments from OSS maintainer --- .../include/test/connection_handler/mock_connection_handler.h | 10 ---------- .../include/test/protocol_handler/mock_protocol_handler.h | 4 ---- .../include/test/protocol_handler/mock_session_observer.h | 7 ------- 3 files changed, 21 deletions(-) (limited to 'src/components/include/test') diff --git a/src/components/include/test/connection_handler/mock_connection_handler.h b/src/components/include/test/connection_handler/mock_connection_handler.h index b535441369..0dcc4f7de1 100644 --- a/src/components/include/test/connection_handler/mock_connection_handler.h +++ b/src/components/include/test/connection_handler/mock_connection_handler.h @@ -85,16 +85,6 @@ class MockConnectionHandler : public connection_handler::ConnectionHandler { void(uint32_t connection_key, uint8_t session_id)); MOCK_METHOD2(BindProtocolVersionWithSession, void(uint32_t connection_key, uint8_t protocol_version)); - -#if __SIZEOF_SIZE_T__ != 4 - // DEPRECATED - MOCK_CONST_METHOD4(GetDataOnSessionKey, - int32_t(uint32_t key, - uint32_t* app_id, - std::list* sessions_list, - uint32_t* device_id)); -#endif - MOCK_CONST_METHOD4(GetDataOnSessionKey, int32_t(uint32_t key, uint32_t* app_id, diff --git a/src/components/include/test/protocol_handler/mock_protocol_handler.h b/src/components/include/test/protocol_handler/mock_protocol_handler.h index fe4e0bfdd6..13c0264cb8 100644 --- a/src/components/include/test/protocol_handler/mock_protocol_handler.h +++ b/src/components/include/test/protocol_handler/mock_protocol_handler.h @@ -60,10 +60,6 @@ class MockProtocolHandler : public ::protocol_handler::ProtocolHandler { int32_t connection_id, uint8_t session_id, uint8_t service_type)); - DEPRECATED MOCK_METHOD3(SendEndService, - void(int32_t connection_id, - uint8_t session_id, - uint8_t service_type)); MOCK_CONST_METHOD0(get_settings, const ::protocol_handler::ProtocolHandlerSettings&()); MOCK_METHOD0(get_session_observer, protocol_handler::SessionObserver&()); diff --git a/src/components/include/test/protocol_handler/mock_session_observer.h b/src/components/include/test/protocol_handler/mock_session_observer.h index 40defaa46e..c0612ce137 100644 --- a/src/components/include/test/protocol_handler/mock_session_observer.h +++ b/src/components/include/test/protocol_handler/mock_session_observer.h @@ -95,13 +95,6 @@ class MockSessionObserver : public ::protocol_handler::SessionObserver { uint32_t* app_id, std::list* sessions_list, transport_manager::DeviceHandle* device_id)); -#if __SIZEOF_SIZE_T__ != 4 - DEPRECATED MOCK_CONST_METHOD4(GetDataOnSessionKey, - int32_t(uint32_t key, - uint32_t* app_id, - std::list* sessions_list, - uint32_t* device_id)); -#endif MOCK_CONST_METHOD5(GetDataOnDeviceID, int32_t(transport_manager::DeviceHandle device_handle, -- cgit v1.2.1 From 08acb77b6b5a43116a0008905aeaf960fd2e09f5 Mon Sep 17 00:00:00 2001 From: Frank Ronneburg Date: Thu, 5 Jul 2018 05:33:49 +0900 Subject: Merge pull request #295 in NAR/sdl-core from bugfix/remove_non_const_data_accessor to feature/Ford-WiFi * commit '5aee98d0ad298440aca8fd7da5a9725b595aa775': Update unit tests to align with new Connection Handler methods updated some comments Remove usage of NonConstDataAccessor in ConnectionHandler Conflicts: src/components/connection_handler/src/connection_handler_impl.cc src/components/connection_handler/test/connection_test.cc src/components/connection_handler/test/heart_beat_monitor_test.cc src/components/protocol_handler/test/protocol_handler_tm_test.cc --- .../include/test/connection_handler/mock_connection_handler.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/components/include/test') diff --git a/src/components/include/test/connection_handler/mock_connection_handler.h b/src/components/include/test/connection_handler/mock_connection_handler.h index 0dcc4f7de1..2de3a0f9a7 100644 --- a/src/components/include/test/connection_handler/mock_connection_handler.h +++ b/src/components/include/test/connection_handler/mock_connection_handler.h @@ -97,9 +97,12 @@ class MockConnectionHandler : public connection_handler::ConnectionHandler { MOCK_METHOD0(get_device_discovery_starter, DevicesDiscoveryStarter&()); MOCK_CONST_METHOD1(GetConnectedDevicesMAC, void(std::vector& macs)); - MOCK_METHOD0( - session_connection_map, - NonConstDataAccessor()); + MOCK_METHOD1( + AddSession, + uint32_t(const transport_manager::ConnectionUID primary_transport_id)); + MOCK_METHOD1(RemoveSession, bool(uint8_t session_id)); + MOCK_METHOD0(session_connection_map, + DataAccessor()); MOCK_METHOD2(SetSecondaryTransportID, SessionTransports( uint8_t session_id, -- cgit v1.2.1 From 87a1963cee747b72cab56634221008a6d844018d Mon Sep 17 00:00:00 2001 From: Jacob Keeler Date: Thu, 12 Jul 2018 11:14:34 -0400 Subject: Send Driver Distraction notification immediately upon registration --- .../include/test/application_manager/mock_application_manager.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/components/include/test') diff --git a/src/components/include/test/application_manager/mock_application_manager.h b/src/components/include/test/application_manager/mock_application_manager.h index 0bb759fc1f..79f601d75d 100644 --- a/src/components/include/test/application_manager/mock_application_manager.h +++ b/src/components/include/test/application_manager/mock_application_manager.h @@ -122,6 +122,8 @@ class MockApplicationManager : public application_manager::ApplicationManager { MOCK_METHOD1( SendHMIStatusNotification, void(const utils::SharedPtr app)); + MOCK_METHOD1(SendDriverDistractionState, + void(application_manager::ApplicationSharedPtr app)); MOCK_METHOD1(RemoveHMIFakeParameters, void(application_manager::commands::MessageSharedPtr& message)); MOCK_CONST_METHOD1( -- cgit v1.2.1 From 5019af50b9a2236dd75e630aae5b82e440be9620 Mon Sep 17 00:00:00 2001 From: Conlain Kelly Date: Wed, 18 Jul 2018 11:13:50 -0400 Subject: Replace utils::SharedPtr with std::shared_ptr, remove non-standard usage --- .../include/test/application_manager/mock_application_manager.h | 4 ++-- .../test/application_manager/policies/mock_policy_handler_interface.h | 2 +- .../include/test/hmi_message_handler/mock_hmi_message_observer.h | 4 ++-- .../include/test/policy/policy_external/policy/mock_cache_manager.h | 4 ++-- .../include/test/policy/policy_external/policy/mock_policy_manager.h | 2 +- .../include/test/policy/policy_regular/policy/mock_cache_manager.h | 4 ++-- .../include/test/policy/policy_regular/policy/mock_policy_manager.h | 2 +- .../include/test/protocol_handler/mock_telemetry_observer.h | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src/components/include/test') diff --git a/src/components/include/test/application_manager/mock_application_manager.h b/src/components/include/test/application_manager/mock_application_manager.h index 79f601d75d..4a86c17f39 100644 --- a/src/components/include/test/application_manager/mock_application_manager.h +++ b/src/components/include/test/application_manager/mock_application_manager.h @@ -121,7 +121,7 @@ class MockApplicationManager : public application_manager::ApplicationManager { mobile_apis::HMILevel::eType to)); MOCK_METHOD1( SendHMIStatusNotification, - void(const utils::SharedPtr app)); + void(const std::shared_ptr app)); MOCK_METHOD1(SendDriverDistractionState, void(application_manager::ApplicationSharedPtr app)); MOCK_METHOD1(RemoveHMIFakeParameters, @@ -171,7 +171,7 @@ class MockApplicationManager : public application_manager::ApplicationManager { void(mobile_apis::VehicleDataType::eType vehicle_info, int value)); MOCK_METHOD1(RegisterApplication, - application_manager::ApplicationSharedPtr(const utils::SharedPtr< + application_manager::ApplicationSharedPtr(const std::shared_ptr< smart_objects::SmartObject>& request_for_registration)); MOCK_METHOD0(SendUpdateAppList, void()); MOCK_METHOD2(MarkAppsGreyOut, diff --git a/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h b/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h index ffa9222c8e..cb47147074 100644 --- a/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h +++ b/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h @@ -112,7 +112,7 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface { MOCK_METHOD1(add_listener, void(policy::PolicyHandlerObserver* listener)); MOCK_METHOD1(remove_listener, void(policy::PolicyHandlerObserver* listener)); MOCK_CONST_METHOD0(GetStatisticManager, - utils::SharedPtr()); + std::shared_ptr()); MOCK_CONST_METHOD2(CheckSystemAction, bool(mobile_apis::SystemAction::eType system_action, const std::string& policy_app_id)); diff --git a/src/components/include/test/hmi_message_handler/mock_hmi_message_observer.h b/src/components/include/test/hmi_message_handler/mock_hmi_message_observer.h index 859d164231..17ec69ccf8 100644 --- a/src/components/include/test/hmi_message_handler/mock_hmi_message_observer.h +++ b/src/components/include/test/hmi_message_handler/mock_hmi_message_observer.h @@ -45,9 +45,9 @@ class MockHMIMessageObserver : public hmi_message_handler::HMIMessageObserver, public utils::Singleton { public: MOCK_METHOD1(OnMessageReceived, - void(utils::SharedPtr message)); + void(std::shared_ptr message)); MOCK_METHOD1(OnErrorSending, - void(utils::SharedPtr message)); + void(std::shared_ptr message)); virtual ~MockHMIMessageObserver() {} }; diff --git a/src/components/include/test/policy/policy_external/policy/mock_cache_manager.h b/src/components/include/test/policy/policy_external/policy/mock_cache_manager.h index 02931114f0..a4d50d7cc2 100644 --- a/src/components/include/test/policy/policy_external/policy/mock_cache_manager.h +++ b/src/components/include/test/policy/policy_external/policy/mock_cache_manager.h @@ -106,7 +106,7 @@ class MockCacheManagerInterface : public ::policy::CacheManagerInterface { MOCK_METHOD2(Init, bool(const std::string& file_name, const PolicySettings* settings)); - MOCK_METHOD0(GenerateSnapshot, utils::SharedPtr()); + MOCK_METHOD0(GenerateSnapshot, std::shared_ptr()); MOCK_METHOD1(ApplyUpdate, bool(const policy_table::Table& update_pt)); MOCK_METHOD1(Save, bool(const policy_table::Table& table)); MOCK_CONST_METHOD0(UpdateRequired, bool()); @@ -231,7 +231,7 @@ class MockCacheManagerInterface : public ::policy::CacheManagerInterface { bool(const std::string& device_id, const std::string& policy_app_id, policy::Permissions& permission)); - MOCK_CONST_METHOD0(GetPT, utils::SharedPtr()); + MOCK_CONST_METHOD0(GetPT, std::shared_ptr()); MOCK_CONST_METHOD0(GetMetaInfo, const MetaInfo()); MOCK_CONST_METHOD0(GetCertificate, std::string()); MOCK_METHOD1(SetDecryptedCertificate, void(const std::string&)); diff --git a/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h b/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h index ea259fc916..aeabf8fdcb 100644 --- a/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h +++ b/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h @@ -163,7 +163,7 @@ class MockPolicyManager : public PolicyManager { bool(const std::string& policy_app_id, std::vector* modules)); MOCK_METHOD1(set_access_remote, - void(utils::SharedPtr access_remote)); + void(std::shared_ptr access_remote)); MOCK_METHOD0(CleanupUnpairedDevices, bool()); MOCK_CONST_METHOD1(CanAppKeepContext, bool(const std::string& app_id)); diff --git a/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h b/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h index d216957eb0..440000dbff 100644 --- a/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h +++ b/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h @@ -84,7 +84,7 @@ class MockCacheManagerInterface : public CacheManagerInterface { MOCK_METHOD2(Init, bool(const std::string& file_name, const PolicySettings* settings)); - MOCK_METHOD0(GenerateSnapshot, utils::SharedPtr()); + MOCK_METHOD0(GenerateSnapshot, std::shared_ptr()); MOCK_METHOD1(ApplyUpdate, bool(const policy_table::Table& update_pt)); MOCK_METHOD1(Save, bool(const policy_table::Table& table)); MOCK_CONST_METHOD0(UpdateRequired, bool()); @@ -202,7 +202,7 @@ class MockCacheManagerInterface : public CacheManagerInterface { bool(const std::string& device_id, const std::string& policy_app_id, policy::Permissions& permission)); - MOCK_CONST_METHOD0(pt, utils::SharedPtr()); + MOCK_CONST_METHOD0(pt, std::shared_ptr()); MOCK_METHOD1(GetHMITypes, const policy_table::AppHMITypes*(const std::string& app_id)); MOCK_CONST_METHOD0(GetCertificate, std::string()); diff --git a/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h b/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h index 952b264caf..0e06e9c1a3 100644 --- a/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h +++ b/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h @@ -162,7 +162,7 @@ class MockPolicyManager : public PolicyManager { bool(const std::string& policy_app_id, std::vector* modules)); MOCK_METHOD1(set_access_remote, - void(utils::SharedPtr access_remote)); + void(std::shared_ptr access_remote)); MOCK_METHOD0(CleanupUnpairedDevices, bool()); MOCK_CONST_METHOD1(CanAppKeepContext, bool(const std::string& app_id)); MOCK_CONST_METHOD1(CanAppStealFocus, bool(const std::string& app_id)); diff --git a/src/components/include/test/protocol_handler/mock_telemetry_observer.h b/src/components/include/test/protocol_handler/mock_telemetry_observer.h index 1c87de4d5a..fb1141baa4 100644 --- a/src/components/include/test/protocol_handler/mock_telemetry_observer.h +++ b/src/components/include/test/protocol_handler/mock_telemetry_observer.h @@ -45,7 +45,7 @@ class MockPHTelemetryObserver : public PHTelemetryObserver { public: MOCK_METHOD2(StartMessageProcess, void(uint32_t message_id, const TimevalStruct& start_time)); - MOCK_METHOD1(EndMessageProcess, void(utils::SharedPtr m)); + MOCK_METHOD1(EndMessageProcess, void(std::shared_ptr m)); }; } // namespace protocol_handler_test -- cgit v1.2.1