summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJackLivio <jack@livio.io>2019-03-17 14:33:13 -0400
committerJackLivio <jack@livio.io>2019-03-17 14:33:13 -0400
commit73d3df9661b5ccf5a19f785a5f72472cd51dcdde (patch)
treed85191f6f507cafc141ed485680267962279b2fb
parent1a0e1fd9daa392a2b68bf71e43ba89563c2f225b (diff)
parent499cc74f2b633ed5a070507d81413af3432a0279 (diff)
downloadsdl_core-73d3df9661b5ccf5a19f785a5f72472cd51dcdde.tar.gz
Merge remote-tracking branch 'origin/develop' into tests/app_service_command_tests
# Conflicts: # src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/CMakeLists.txt
-rw-r--r--.github/ISSUE_TEMPLATE.md4
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request.cc5
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/CMakeLists.txt78
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc151
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc135
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc16
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc30
-rw-r--r--src/components/application_manager/src/application_manager_impl.cc18
-rw-r--r--src/components/application_manager/test/app_service_manager_test.cc17
-rw-r--r--src/components/interfaces/HMI_API.xml2
-rw-r--r--src/components/interfaces/MOBILE_API.xml2
-rw-r--r--src/components/transport_manager/src/cloud/websocket_client_connection.cc3
12 files changed, 372 insertions, 89 deletions
diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md
index 1b58b20e86..d62fd997a0 100644
--- a/.github/ISSUE_TEMPLATE.md
+++ b/.github/ISSUE_TEMPLATE.md
@@ -1,4 +1,4 @@
-[Delete any non-applicable sections, but we may ask for more information.]
+[Delete any non-applicable sections, but we may ask for more information. Please reference the [SmartDeviceLink GitHub Best Practices](https://d83tozu1c8tt6.cloudfront.net/media/resources/SDL_GitHub_BestPractices.pdf) for further instructions on how to enter an issue.]
### Bug Report
[Summary]
@@ -20,4 +20,4 @@
* Testing Against: [What you tested with to observe this behavior. Proxy, App, HMI etc.]
##### Test Case, Sample Code, and / or Example App
-[Paste a link to a PR, gist, or other code that exemplifies this behavior] \ No newline at end of file
+[Paste a link to a PR, gist, or other code that exemplifies this behavior]
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request.cc
index 7b29160692..7c2e62abe2 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request.cc
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request.cc
@@ -68,11 +68,10 @@ void GetAppServiceDataRequest::Run() {
void GetAppServiceDataRequest::HandleSubscribe() {
std::string service_type =
(*message_)[strings::msg_params][strings::service_type].asString();
- if ((*message_)[strings::msg_params].keyExists(strings::subscribe)) {
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+ if (app && (*message_)[strings::msg_params].keyExists(strings::subscribe)) {
bool subscribe =
(*message_)[strings::msg_params][strings::subscribe].asBool();
- ApplicationSharedPtr app =
- application_manager_.application(connection_key());
auto& ext = AppServiceAppExtension::ExtractASExtension(*app);
if (subscribe) {
ext.SubscribeToAppService(service_type);
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/CMakeLists.txt b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/CMakeLists.txt
index 02fb4fe4ec..0b56ddb7e9 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/CMakeLists.txt
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/CMakeLists.txt
@@ -1,72 +1,40 @@
-# Copyright (c) 2019, Livio
-# 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 copyright holders nor the names of their 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.
-
include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
-include_directories (
+include_directories(
${GMOCK_INCLUDE_DIRECTORY}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${COMPONENTS_DIR}/application_manager/test/include
- ${COMPONENTS_DIR}/include/test/application_manager/
+ ${COMPONENTS_DIR}/application_manager/rpc_plugins/app_service_rpc_plugin/include
+ ${COMPONENTS_DIR}/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/
+ ${COMPONENTS_DIR}/application_manager/test/include/
+ ${POLICY_MOCK_INCLUDE_PATH}/
+ ${CMAKE_SOURCE_DIR}/src
${COMPONENTS_DIR}/resumption/include
- )
+)
-set(APP_SERVICE_COMMANDS_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}/commands)
+
+set(COMMANDS_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}/commands)
file(GLOB SOURCES
${COMPONENTS_DIR}/application_manager/test/mock_message_helper.cc
- ${APP_SERVICE_COMMANDS_TEST_DIR}/*
- ${APP_SERVICE_COMMANDS_TEST_DIR}/mobile/*
+ ${COMPONENTS_DIR}/application_manager/test/mock_application_helper.cc
+ ${COMPONENTS_DIR}/application_manager/src/smart_object_keys.cc
+ ${COMMANDS_TEST_DIR}/hmi/*
+ ${COMMANDS_TEST_DIR}/mobile/*
+ ${COMPONENTS_DIR}/application_manager/src/message.cc
+ ${COMPONENTS_DIR}/application_manager/src/event_engine/*
)
set(LIBRARIES
- AppServiceRpcPluginStaticLib
- ApplicationManager
- connectionHandler
+ gmock
+ Utils
SmartObjects
- ProtocolHandler
- MessageHelper
+ HMI_API
+ MOBILE_API
connectionHandler
- Utils
+ app_service_rpc_plugin
+ sdl_rpc_plugin
jsoncpp
- gmock_main
- dl
+ Policy
Resumption
)
-if(ENABLE_LOG)
- list(APPEND LIBRARIES log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
- list(APPEND LIBRARIES apr-1 -L${APR_LIBS_DIRECTORY})
- list(APPEND LIBRARIES aprutil-1 -L${APR_UTIL_LIBS_DIRECTORY})
- list(APPEND LIBRARIES expat -L${EXPAT_LIBS_DIRECTORY})
-endif()
-
-create_test("app_service_commands_test" "${SOURCES}" "${LIBRARIES}" )
-
+create_cotired_test("app_services_commands_test" "${SOURCES}" "${LIBRARIES}" )
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc
new file mode 100644
index 0000000000..8ef87b6de9
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc
@@ -0,0 +1,151 @@
+/*
+ * 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.
+ */
+
+#include "application_manager/commands/command_request_test.h"
+
+#include <stdint.h>
+#include <string>
+#include <vector>
+#include "gtest/gtest.h"
+
+#include "hmi/as_app_service_activation_request.h"
+#include "hmi/as_app_service_activation_response.h"
+#include "hmi/as_get_active_service_consent_request.h"
+#include "hmi/as_get_active_service_consent_response.h"
+#include "hmi/as_get_app_service_data_request_from_hmi.h"
+#include "hmi/as_get_app_service_data_request_to_hmi.h"
+#include "hmi/as_get_app_service_data_response_from_hmi.h"
+#include "hmi/as_get_app_service_data_response_to_hmi.h"
+#include "hmi/as_get_app_service_records_request.h"
+#include "hmi/as_get_app_service_records_response.h"
+#include "hmi/as_perform_app_service_interaction_request_from_hmi.h"
+#include "hmi/as_perform_app_service_interaction_request_to_hmi.h"
+#include "hmi/as_perform_app_service_interaction_response_from_hmi.h"
+#include "hmi/as_perform_app_service_interaction_response_to_hmi.h"
+#include "hmi/as_publish_app_service_request.h"
+#include "hmi/as_publish_app_service_response.h"
+#include "hmi/on_as_app_service_data_notification.h"
+#include "hmi/on_as_app_service_data_notification_from_hmi.h"
+
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application_manager_settings.h"
+#include "application_manager/mock_event_dispatcher.h"
+
+namespace am = application_manager;
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace dummy_hmi_commands_test {
+
+namespace commands = app_service_rpc_plugin::commands;
+
+using ::testing::_;
+using ::testing::NotNull;
+using ::testing::Types;
+using application_manager::commands::MessageSharedPtr;
+using ::test::components::event_engine_test::MockEventDispatcher;
+using ::test::components::application_manager_test::MockApplicationManager;
+using ::test::components::application_manager_test::
+ MockApplicationManagerSettings;
+using ::application_manager::ApplicationSharedPtr;
+using ::test::components::application_manager_test::MockApplication;
+
+template <class Command>
+class HMICommandsTest : public components::commands_test::CommandRequestTest<
+ CommandsTestMocks::kIsNice> {
+ public:
+ typedef Command CommandType;
+
+ void InitCommand(const uint32_t& timeout) OVERRIDE {
+ stream_retry_.first = 0;
+ stream_retry_.second = 0;
+ EXPECT_CALL(app_mngr_settings_, default_timeout())
+ .WillOnce(ReturnRef(timeout));
+ ON_CALL(app_mngr_, event_dispatcher())
+ .WillByDefault(ReturnRef(event_dispatcher_));
+ ON_CALL(app_mngr_, get_settings())
+ .WillByDefault(ReturnRef(app_mngr_settings_));
+ ON_CALL(app_mngr_settings_, start_stream_retry_amount())
+ .WillByDefault(ReturnRef(stream_retry_));
+ }
+
+ protected:
+ std::pair<uint32_t, int32_t> stream_retry_;
+};
+
+template <class Command>
+class HMICommandsTestFirst : public HMICommandsTest<Command> {
+ public:
+ using typename HMICommandsTest<Command>::CommandType;
+};
+
+/* macro TYPED_TEST_CASE takes max 50 args. That is why there are few
+ * TYPED_TEST_CASE for HMI and mobile commands
+ */
+
+typedef Types<commands::ASAppServiceActivationRequest,
+ commands::ASAppServiceActivationResponse,
+ commands::ASGetActiveServiceConsentRequest,
+ commands::ASGetActiveServiceConsentResponse,
+ commands::ASPerformAppServiceInteractionRequestFromHMI,
+ commands::ASGetAppServiceDataRequestToHMI,
+ commands::ASGetAppServiceDataResponseFromHMI,
+ commands::ASGetAppServiceDataResponseToHMI,
+ commands::ASGetAppServiceRecordsRequest,
+ commands::ASGetAppServiceRecordsResponse,
+ commands::ASPerformAppServiceInteractionRequestFromHMI,
+ commands::ASPerformAppServiceInteractionRequestToHMI,
+ commands::ASPerformAppServiceInteractionResponseFromHMI,
+ commands::ASPerformAppServiceInteractionResponseToHMI,
+ commands::ASPublishAppServiceRequest,
+ commands::ASPublishAppServiceResponse,
+ commands::OnASAppServiceDataNotification,
+ commands::OnASAppServiceDataNotificationFromHMI>
+ HMICommandsListFirst;
+
+TYPED_TEST_CASE(HMICommandsTestFirst, HMICommandsListFirst);
+
+TYPED_TEST(HMICommandsTestFirst, CtorAndDtorCall) {
+ std::shared_ptr<typename TestFixture::CommandType> command =
+ this->template CreateCommand<typename TestFixture::CommandType>();
+ EXPECT_NE(command.use_count(), 0);
+}
+
+} // namespace dummy_hmi_commands_test
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc
new file mode 100644
index 0000000000..3c8a780128
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc
@@ -0,0 +1,135 @@
+/*
+ * 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.
+ */
+
+#include "application_manager/commands/command_request_test.h"
+
+#include <stdint.h>
+#include <string>
+#include <vector>
+#include "gtest/gtest.h"
+
+#include "mobile/get_app_service_data_request.h"
+#include "mobile/get_app_service_data_request_to_mobile.h"
+#include "mobile/get_app_service_data_response.h"
+#include "mobile/get_app_service_data_response_from_mobile.h"
+#include "mobile/on_app_service_data_notification.h"
+#include "mobile/on_app_service_data_notification_from_mobile.h"
+#include "mobile/perform_app_service_interaction_request.h"
+#include "mobile/perform_app_service_interaction_request_to_mobile.h"
+#include "mobile/perform_app_service_interaction_response.h"
+#include "mobile/perform_app_service_interaction_response_from_mobile.h"
+#include "mobile/publish_app_service_request.h"
+#include "mobile/publish_app_service_response.h"
+
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "test/application_manager/mock_application_manager_settings.h"
+#include "application_manager/mock_event_dispatcher.h"
+
+namespace am = application_manager;
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace dummy_mobile_commands_test {
+
+namespace commands = app_service_rpc_plugin::commands;
+using ::testing::_;
+using ::testing::NotNull;
+using ::testing::Types;
+using am::commands::MessageSharedPtr;
+using ::test::components::event_engine_test::MockEventDispatcher;
+using ::test::components::application_manager_test::MockApplicationManager;
+using ::test::components::application_manager_test::
+ MockApplicationManagerSettings;
+using ::application_manager::ApplicationSharedPtr;
+using ::test::components::application_manager_test::MockApplication;
+
+namespace {
+const std::string kEmptyString_ = "";
+} // namespace
+
+template <class Command>
+class MobileCommandsTest : public components::commands_test::CommandRequestTest<
+ CommandsTestMocks::kIsNice> {
+ public:
+ typedef Command CommandType;
+
+ void InitCommand(const uint32_t& timeout) OVERRIDE {
+ EXPECT_CALL(app_mngr_settings_, default_timeout())
+ .WillOnce(ReturnRef(timeout));
+ ON_CALL(app_mngr_, event_dispatcher())
+ .WillByDefault(ReturnRef(event_dispatcher_));
+ ON_CALL(app_mngr_, get_settings())
+ .WillByDefault(ReturnRef(app_mngr_settings_));
+ ON_CALL(app_mngr_settings_, app_icons_folder())
+ .WillByDefault(ReturnRef(kEmptyString_));
+ }
+};
+
+template <class Command>
+class MobileCommandsTestFirst : public MobileCommandsTest<Command> {
+ public:
+ using typename MobileCommandsTest<Command>::CommandType;
+};
+
+/* macro TYPED_TEST_CASE takes max 50 args. That is why there are few
+ * TYPED_TEST_CASE for HMI and mobile commands
+ */
+
+typedef Types<commands::GetAppServiceDataRequest,
+ commands::GetAppServiceDataRequestToMobile,
+ commands::GetAppServiceDataResponse,
+ commands::GetAppServiceDataResponseFromMobile,
+ commands::OnAppServiceDataNotification,
+ commands::OnAppServiceDataNotificationFromMobile,
+ commands::PerformAppServiceInteractionRequest,
+ commands::PerformAppServiceInteractionRequestToMobile,
+ commands::PerformAppServiceInteractionResponse,
+ commands::PerformAppServiceInteractionResponseFromMobile,
+ commands::PublishAppServiceRequest,
+ commands::PublishAppServiceResponse> MobileCommandsListFirst;
+
+TYPED_TEST_CASE(MobileCommandsTestFirst, MobileCommandsListFirst);
+
+TYPED_TEST(MobileCommandsTestFirst, CtorAndDtorCall) {
+ std::shared_ptr<typename TestFixture::CommandType> command =
+ this->template CreateCommand<typename TestFixture::CommandType>();
+ EXPECT_NE(command.use_count(), 0);
+}
+
+} // namespace dummy_mobile_commands_test
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc
index a6497ca6e1..874d27b4b0 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc
@@ -223,6 +223,8 @@
#include "hmi/on_tts_reset_timeout_notification.h"
#include "hmi/dial_number_request.h"
#include "hmi/dial_number_response.h"
+#include "hmi/bc_get_file_path_request.h"
+#include "hmi/bc_get_file_path_response.h"
#include "application_manager/commands/commands_test.h"
#include "application_manager/mock_application.h"
@@ -496,7 +498,9 @@ typedef Types<commands::hmi::OnButtonEventNotification,
typedef Types<commands::AllowAllAppsRequest,
commands::AllowAllAppsResponse,
commands::AllowAppRequest,
- commands::AllowAppResponse> HMICommandsListFifth;
+ commands::AllowAppResponse,
+ commands::BCGetFilePathRequest,
+ commands::BCGetFilePathResponse> HMICommandsListFifth;
TYPED_TEST_CASE(HMICommandsTestFirst, HMICommandsListFirst);
TYPED_TEST_CASE(HMICommandsTestSecond, HMICommandsListSecond);
@@ -507,30 +511,30 @@ TYPED_TEST_CASE(HMICommandsTestFifth, HMICommandsListFifth);
TYPED_TEST(HMICommandsTestFirst, CtorAndDtorCall) {
std::shared_ptr<typename TestFixture::CommandType> command =
this->template CreateCommand<typename TestFixture::CommandType>();
- UNUSED(command);
+ EXPECT_NE(command.use_count(), 0);
}
TYPED_TEST(HMICommandsTestSecond, CtorAndDtorCall) {
std::shared_ptr<typename TestFixture::CommandType> command =
this->template CreateCommand<typename TestFixture::CommandType>();
- UNUSED(command);
+ EXPECT_NE(command.use_count(), 0);
}
TYPED_TEST(HMICommandsTestThird, CtorAndDtorCall) {
std::shared_ptr<typename TestFixture::CommandType> command =
this->template CreateCommand<typename TestFixture::CommandType>();
- UNUSED(command);
+ EXPECT_NE(command.use_count(), 0);
}
TYPED_TEST(HMICommandsTestFourth, CtorAndDtorCall) {
std::shared_ptr<typename TestFixture::CommandType> command =
this->template CreateCommand<typename TestFixture::CommandType>();
- UNUSED(command);
+ EXPECT_NE(command.use_count(), 0);
}
TYPED_TEST(HMICommandsTestFifth, CtorAndDtorCall) {
std::shared_ptr<typename TestFixture::CommandType> command =
this->template CreateCommand<typename TestFixture::CommandType>();
- UNUSED(command);
+ EXPECT_NE(command.use_count(), 0);
}
} // namespace dummy_hmi_commands_test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc
index 8589cbb6be..9c20143c39 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc
@@ -62,6 +62,8 @@
#include "mobile/end_audio_pass_thru_request.h"
#include "mobile/end_audio_pass_thru_response.h"
#include "mobile/generic_response.h"
+#include "mobile/get_file_request.h"
+#include "mobile/get_file_response.h"
#include "mobile/get_way_points_request.h"
#include "mobile/get_way_points_response.h"
#include "mobile/list_files_request.h"
@@ -78,6 +80,7 @@
#include "mobile/on_keyboard_input_notification.h"
#include "mobile/on_language_change_notification.h"
#include "mobile/on_permissions_change_notification.h"
+#include "mobile/on_system_capability_updated_notification.h"
#include "mobile/on_system_request_notification.h"
#include "mobile/on_tbt_client_state_notification.h"
#include "mobile/on_touch_event_notification.h"
@@ -220,6 +223,8 @@ typedef Types<commands::AddCommandRequest,
commands::EndAudioPassThruRequest,
commands::EndAudioPassThruResponse,
commands::GenericResponse,
+ commands::GetFileRequest,
+ commands::GetFileResponse,
commands::GetWayPointsRequest,
commands::GetWayPointsResponse,
commands::ListFilesRequest,
@@ -236,12 +241,13 @@ typedef Types<commands::AddCommandRequest,
commands::mobile::OnKeyBoardInputNotification,
commands::OnLanguageChangeNotification,
commands::OnPermissionsChangeNotification,
- commands::mobile::OnSystemRequestNotification,
- commands::OnTBTClientStateNotification,
- commands::mobile::OnTouchEventNotification>
+ commands::mobile::OnSystemCapabilityUpdatedNotification>
MobileCommandsListFirst;
-typedef Types<commands::OnWayPointChangeNotification,
+typedef Types<commands::mobile::OnSystemRequestNotification,
+ commands::OnTBTClientStateNotification,
+ commands::mobile::OnTouchEventNotification,
+ commands::OnWayPointChangeNotification,
commands::PerformAudioPassThruRequest,
commands::PerformAudioPassThruResponse,
commands::PerformInteractionRequest,
@@ -277,12 +283,12 @@ typedef Types<commands::OnWayPointChangeNotification,
commands::SubscribeWayPointsRequest,
commands::SubscribeWayPointsResponse,
commands::SystemResponse,
- commands::UnregisterAppInterfaceRequest,
- commands::UnregisterAppInterfaceResponse,
- commands::UnsubscribeButtonRequest,
- commands::UnsubscribeButtonResponse> MobileCommandsListSecond;
+ commands::UnregisterAppInterfaceRequest> MobileCommandsListSecond;
-typedef Types<commands::UnsubscribeWayPointsRequest,
+typedef Types<commands::UnregisterAppInterfaceResponse,
+ commands::UnsubscribeButtonRequest,
+ commands::UnsubscribeButtonResponse,
+ commands::UnsubscribeWayPointsRequest,
commands::UnsubscribeWayPointsResponse,
commands::UpdateTurnListRequest,
commands::UpdateTurnListResponse> MobileCommandsListThird;
@@ -294,18 +300,18 @@ TYPED_TEST_CASE(MobileCommandsTestThird, MobileCommandsListThird);
TYPED_TEST(MobileCommandsTestFirst, CtorAndDtorCall) {
std::shared_ptr<typename TestFixture::CommandType> command =
this->template CreateCommand<typename TestFixture::CommandType>();
- UNUSED(command);
+ EXPECT_NE(command.use_count(), 0);
}
TYPED_TEST(MobileCommandsTestSecond, CtorAndDtorCall) {
std::shared_ptr<typename TestFixture::CommandType> command =
this->template CreateCommand<typename TestFixture::CommandType>();
- UNUSED(command);
+ EXPECT_NE(command.use_count(), 0);
}
TYPED_TEST(MobileCommandsTestThird, CtorAndDtorCall) {
std::shared_ptr<typename TestFixture::CommandType> command =
this->template CreateCommand<typename TestFixture::CommandType>();
- UNUSED(command);
+ EXPECT_NE(command.use_count(), 0);
}
} // namespace dummy_mobile_commands_test
diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc
index 701bb339a1..b4a0d442f0 100644
--- a/src/components/application_manager/src/application_manager_impl.cc
+++ b/src/components/application_manager/src/application_manager_impl.cc
@@ -933,6 +933,9 @@ void ApplicationManagerImpl::DisconnectCloudApp(ApplicationSharedPtr app) {
void ApplicationManagerImpl::RefreshCloudAppInformation() {
LOG4CXX_AUTO_TRACE(logger_);
+ if (is_stopping()) {
+ return;
+ }
std::vector<std::string> enabled_apps;
GetPolicyHandler().GetEnabledCloudApps(enabled_apps);
std::vector<std::string>::iterator enabled_it = enabled_apps.begin();
@@ -2824,6 +2827,21 @@ void ApplicationManagerImpl::UnregisterAllApplications() {
it = accessor.GetData().begin();
}
}
+
+ bool send_pending_update_app_list = false;
+ {
+ sync_primitives::AutoLock auto_lock(apps_to_register_list_lock_ptr_);
+ if (!apps_to_register_.empty()) {
+ send_pending_update_app_list = true;
+ apps_to_register_.clear();
+ }
+ }
+
+ // Only send update app list if pending apps were removed.
+ if (send_pending_update_app_list) {
+ SendUpdateAppList();
+ }
+
if (is_ignition_off) {
resume_controller().OnIgnitionOff();
}
diff --git a/src/components/application_manager/test/app_service_manager_test.cc b/src/components/application_manager/test/app_service_manager_test.cc
index 406f6fe0ce..960e8e31f6 100644
--- a/src/components/application_manager/test/app_service_manager_test.cc
+++ b/src/components/application_manager/test/app_service_manager_test.cc
@@ -197,7 +197,6 @@ TEST_F(AppServiceManagerTest, PublishAppService_Mobile_SUCCESS) {
smart_objects::SmartObject manifest = GenerateMediaManifest(true);
Json::Value empty_json;
- // dict[kAppServiceSection][kDefaults][kServiceType] = kPolicyAppId;
EXPECT_CALL(mock_last_state_, get_dictionary())
.WillOnce(ReturnRef(empty_json));
@@ -221,8 +220,8 @@ TEST_F(AppServiceManagerTest, PublishAppService_Mobile_SUCCESS) {
// Check final record
std::string service_id = record[am::strings::service_id].asString();
EXPECT_EQ(manifest, record[am::strings::service_manifest]);
- EXPECT_EQ(true, record[am::strings::service_published].asBool());
- EXPECT_EQ(true, record[am::strings::service_active].asBool());
+ EXPECT_TRUE(record[am::strings::service_published].asBool());
+ EXPECT_TRUE(record[am::strings::service_active].asBool());
// Check first capability update
CheckCapabilityUpdate(syscap_update_published,
@@ -267,8 +266,8 @@ TEST_F(AppServiceManagerTest, PublishAppService_HMI_SUCCESS) {
// Check final record
std::string service_id = record[am::strings::service_id].asString();
EXPECT_EQ(manifest, record[am::strings::service_manifest]);
- EXPECT_EQ(true, record[am::strings::service_published].asBool());
- EXPECT_EQ(true, record[am::strings::service_active].asBool());
+ EXPECT_TRUE(record[am::strings::service_published].asBool());
+ EXPECT_TRUE(record[am::strings::service_active].asBool());
// Check first capability update
CheckCapabilityUpdate(syscap_update_published,
@@ -390,7 +389,7 @@ TEST_F(AppServiceManagerTest, ActiveServiceForType_SUCCESS) {
ASSERT_FALSE(service == NULL);
EXPECT_EQ(record, service->record);
EXPECT_EQ(kConnectionKey, service->connection_key);
- EXPECT_EQ(true, service->mobile_service);
+ EXPECT_TRUE(service->mobile_service);
}
TEST_F(AppServiceManagerTest, EmbeddedServiceForType_SUCCESS) {
@@ -400,7 +399,7 @@ TEST_F(AppServiceManagerTest, EmbeddedServiceForType_SUCCESS) {
ASSERT_FALSE(service == NULL);
EXPECT_EQ(record, service->record);
- EXPECT_EQ(false, service->mobile_service);
+ EXPECT_FALSE(service->mobile_service);
}
TEST_F(AppServiceManagerTest, FindServiceByID_SUCCESS) {
@@ -412,7 +411,7 @@ TEST_F(AppServiceManagerTest, FindServiceByID_SUCCESS) {
ASSERT_FALSE(service == NULL);
EXPECT_EQ(record, service->record);
EXPECT_EQ(kConnectionKey, service->connection_key);
- EXPECT_EQ(true, service->mobile_service);
+ EXPECT_TRUE(service->mobile_service);
}
TEST_F(AppServiceManagerTest, GetAllServiceRecords_OneService_SUCCESS) {
@@ -432,7 +431,7 @@ TEST_F(AppServiceManagerTest, GetActiveServices_OneService_SUCCESS) {
ASSERT_EQ(1u, services.size());
EXPECT_EQ(record, services[0].record);
EXPECT_EQ(kConnectionKey, services[0].connection_key);
- EXPECT_EQ(true, services[0].mobile_service);
+ EXPECT_TRUE(services[0].mobile_service);
}
} // namespace application_manager_test
diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml
index bbb173044a..e0ca4d6d18 100644
--- a/src/components/interfaces/HMI_API.xml
+++ b/src/components/interfaces/HMI_API.xml
@@ -3555,7 +3555,7 @@
<description> In km </description>
</param>
- <param name="weatherIconImageName" type="String" mandatory="false"/>
+ <param name="weatherIcon" type="Common.Image" mandatory="false"/>
</struct>
<struct name="WeatherServiceData">
diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml
index 3b9614ab76..a0345ada29 100644
--- a/src/components/interfaces/MOBILE_API.xml
+++ b/src/components/interfaces/MOBILE_API.xml
@@ -3899,7 +3899,7 @@
<description> In km </description>
</param>
- <param name="weatherIconImageName" type="String" mandatory="false"/>
+ <param name="weatherIcon" type="Image" mandatory="false"/>
</struct>
<struct name="WeatherServiceData" since="5.1">
diff --git a/src/components/transport_manager/src/cloud/websocket_client_connection.cc b/src/components/transport_manager/src/cloud/websocket_client_connection.cc
index 5c9553a970..057e3d7208 100644
--- a/src/components/transport_manager/src/cloud/websocket_client_connection.cc
+++ b/src/components/transport_manager/src/cloud/websocket_client_connection.cc
@@ -267,6 +267,9 @@ void WebsocketClientConnection::Shutdown() {
thread_delegate_->SetShutdown();
write_thread_->join();
delete thread_delegate_;
+ thread_delegate_ = NULL;
+ threads::DeleteThread(write_thread_);
+ write_thread_ = NULL;
}
if (buffer_.size()) {
buffer_.consume(buffer_.size());