diff --git a/.github/workflows/L2-tests-R4-4-1.yml b/.github/workflows/L2-tests-R4-4-1.yml index 79b6d74871..4fd80ed70c 100755 --- a/.github/workflows/L2-tests-R4-4-1.yml +++ b/.github/workflows/L2-tests-R4-4-1.yml @@ -43,7 +43,7 @@ jobs: run: > sudo apt update && - sudo apt install -y libsqlite3-dev libcurl4-openssl-dev valgrind lcov clang libsystemd-dev libboost-all-dev libwebsocketpp-dev meson libcunit1 libcunit1-dev + sudo apt install -y libsqlite3-dev libcurl4-openssl-dev valgrind lcov clang libsystemd-dev libboost-all-dev libwebsocketpp-dev meson libcunit1 libcunit1-dev protobuf-compiler protobuf-compiler-grpc libgrpc-dev libgrpc++-dev - name: Install GStreamer run: | @@ -84,11 +84,24 @@ jobs: -DEXCEPTIONS_ENABLE=ON -DCMAKE_INSTALL_PREFIX="${{github.workspace}}/install/usr" -DCMAKE_MODULE_PATH="${{github.workspace}}/install/tools/cmake" + -DGENERIC_CMAKE_MODULE_PATH="${{github.workspace}}/install/tools/cmake" && cmake --build build/ThunderTools -j8 && cmake --install build/ThunderTools + - name: Checkout rdkservices + uses: actions/checkout@v3 + with: + path: rdkservices + + - name: Checkout rdkservices + run: | + cd ${{github.workspace}}/rdkservices + patch -p1 < ${{github.workspace}}/rdkservices/Tests/L2Tests/patches/0003-R4.4.1-LocationSync-compilation-error.patch + patch -p1 < ${{github.workspace}}/rdkservices/Tests/L2Tests/patches/0003-R4.4.1-SystemAudioPlayer-compilation-error.patch + cd - + - name: Build Thunder if: steps.cache.outputs.cache-hit != 'true' run: > @@ -107,18 +120,6 @@ jobs: && cmake --install build/Thunder - - name: Checkout rdkservices - uses: actions/checkout@v3 - with: - path: rdkservices - - - name: Apply patch Rdkservices - run: | - cd ${{github.workspace}}/rdkservices - patch -p1 < files/0003-R4.4.1-LocationSync-compilation-error.patch - patch -p1 < files/0003-R4.4.1-SystemAudioPlayer-compilation-error.patch - cd - - - name: Checkout ThunderInterfaces uses: actions/checkout@v3 with: @@ -129,14 +130,13 @@ jobs: - name: Apply patch ThunderInterfaces run: | - echo "Present working directory is: $(pwd)" - echo "Listing directory is:" - ls -la cd ThunderInterfaces echo "Current branch is: $(git branch --show-current)" - git apply "${{github.workspace}}/rdkservices/files/SplitDeviceCapablities.patch" - git apply "${{github.workspace}}/rdkservices/files/0007-RDK-IDeviceInfo-Changes.patch" - git apply "${{github.workspace}}/rdkservices/files/0001-Add-TextToSpeech-Interface.patch" + patch -p1 < ${{github.workspace}}/rdkservices/Tests/L2Tests/patches/R.4.4.1-0001-Add-TextToSpeech-Interface.patch + patch -p1 < ${{github.workspace}}/rdkservices/Tests/L2Tests/patches/SplitDeviceCapablities.patch + patch -p1 < ${{github.workspace}}/rdkservices/Tests/L2Tests/patches/0007-RDK-IDeviceInfo-Changes.patch + patch -p1 < ${{github.workspace}}/rdkservices/Tests/L2Tests/patches/0001-RDK-45037-Secure-Storage-Thunder-Plugin.patch + patch -p1 < ${{github.workspace}}/rdkservices/Tests/L2Tests/patches/RDKV-48604-User-Settings-Thunder-Plugin.patch cd .. - name: Build ThunderInterfaces @@ -227,12 +227,13 @@ jobs: -DTHUNDER_VERSION=4 -DTHUNDER_VERSION_MAJOR=4 -DTHUNDER_VERSION_MINOR=4 + -DPLUGIN_PERSISTENTSTORE_PATH="/tmp/secure/persistent/rdkservicestore" + -DPLUGIN_PERSISTENTSTORE_LEGACYPATH="/tmp/persistent/rdkservicestore" -I ${{github.workspace}}/rdkservices/Tests/headers -I ${{github.workspace}}/rdkservices/Tests/headers/rdk/ds -I ${{github.workspace}}/rdkservices/Tests/headers/rdk/iarmbus -I ${{github.workspace}}/rdkservices/Tests/headers/rdk/iarmmgrs-hal -I ${{github.workspace}}/rdkservices/Tests/headers/systemservices - -I ${{github.workspace}}/rdkservices/Tests/headers/sampleplugin -I ${{github.workspace}}/rdkservices/Tests/headers/systemservices/proc -include ${{github.workspace}}/rdkservices/Tests/mocks/devicesettings.h -include ${{github.workspace}}/rdkservices/Tests/mocks/Iarm.h @@ -242,9 +243,11 @@ jobs: -include ${{github.workspace}}/rdkservices/Tests/mocks/Wraps.h -include ${{github.workspace}}/rdkservices/Tests/mocks/maintenanceMGR.h -include ${{github.workspace}}/rdkservices/Tests/mocks/pkg.h - -Wall -Wno-unused-result -Wno-deprecated-declarations -Wno-error=format= + -Werror -Wall -Wno-unused-result -Wno-deprecated-declarations -Wno-error=format= -DUSE_IARMBUS -DENABLE_THERMAL_PROTECTION" + -DPLUGIN_PERSISTENTSTORE_PATH="/tmp/secure/persistent/rdkservicestore" + -DPLUGIN_PERSISTENTSTORE_LEGACYPATH="/tmp/persistent/rdkservicestore" -DCOMCAST_CONFIG=OFF -DCMAKE_DISABLE_FIND_PACKAGE_DS=ON -DCMAKE_DISABLE_FIND_PACKAGE_IARMBus=ON @@ -257,7 +260,9 @@ jobs: -DPLUGIN_HDCPPROFILE=OFF -DPLUGIN_NETWORK=OFF -DPLUGIN_TEXTTOSPEECH=OFF - -DPLUGIN_USBACCESS=ON + -DPLUGIN_USBACCESS=OFF + -DPLUGIN_USERSETTINGS=ON + -DPLUGIN_PERSISTENTSTORE=ON -DUSE_THUNDER_R4=ON -DPLUGIN_L2Tests=ON -DRDK_SERVICE_L2_TEST=ON @@ -276,6 +281,9 @@ jobs: /opt/secure/reboot /opt/secure/persistent /opt/secure/persistent/System + /tmp/secure/persistent + /tmp/persistent + /tmp/persistent/rdkservicestore /opt/logs /lib/rdk /run/media/sda1/logs/PreviousLogs @@ -307,8 +315,9 @@ jobs: /lib/rdk/getMaintenanceStartTime.sh /tmp/opkg.conf /tmp/system_service_temp.conf + /tmp/secure/persistent/rdkservicestore && - sudo chmod 777 + sudo chmod -R 777 /opt/standbyReason.txt /opt/tmtryoptout /opt/fwdnldstatus.txt @@ -320,6 +329,8 @@ jobs: /lib/rdk/getMaintenanceStartTime.sh /tmp/opkg.conf /tmp/system_service_temp.conf + /tmp/persistent/rdkservicestore + /tmp/secure/persistent/rdkservicestore - name: Download pact_verifier_cli run: > diff --git a/Tests/L2Tests/L2TestsPlugin/CMakeLists.txt b/Tests/L2Tests/L2TestsPlugin/CMakeLists.txt index e23d256a0f..9bdc5dfb94 100755 --- a/Tests/L2Tests/L2TestsPlugin/CMakeLists.txt +++ b/Tests/L2Tests/L2TestsPlugin/CMakeLists.txt @@ -21,27 +21,33 @@ set(MODULE_NAME ${NAMESPACE}${PLUGIN_NAME}) set(THUNDER_PORT 9998) find_package(${NAMESPACE}Plugins REQUIRED) -# We are not running VerifyContracts,Warehouse_L2Test tests for Thunder R4 as -# this work is not in this scope. In future we will enable these tests for Thunder R4. -if(NOT USE_THUNDER_R4) -add_library(${MODULE_NAME} SHARED - Module.cpp - L2Tests.cpp - L2TestsMock.cpp - tests/SystemService_L2Test.cpp - tests/UsbAccess_L2Test.cpp - tests/Telemetry_L2Test.cpp - tests/Warehouse_L2Test.cpp - tests/VerifyContracts.cpp) -else() -add_library(${MODULE_NAME} SHARED - Module.cpp - L2Tests.cpp - L2TestsMock.cpp - tests/SystemService_L2Test.cpp - tests/UsbAccess_L2Test.cpp - tests/Telemetry_L2Test.cpp) -endif(NOT USE_THUNDER_R4) +set(SRC_FILES Module.cpp L2Tests.cpp L2TestsMock.cpp) + +if(PLUGIN_SYSTEMSERVICES) + set(SRC_FILES ${SRC_FILES} tests/SystemService_L2Test.cpp) +endif() + +if(PLUGIN_USBACCESS) + set(SRC_FILES ${SRC_FILES} tests/UsbAccess_L2Test.cpp) +endif() + +if(PLUGIN_TELEMETRY) + set(SRC_FILES ${SRC_FILES} tests/Telemetry_L2Test.cpp) +endif() + +if(PLUGIN_WAREHOUSE) + set(SRC_FILES ${SRC_FILES} tests/Warehouse_L2Test.cpp) +endif() + +if(PLUGIN_HDCPPROFILE) + set(SRC_FILES ${SRC_FILES} tests/VerifyContracts.cpp) +endif() + +if(PLUGIN_USERSETTINGS) + set(SRC_FILES ${SRC_FILES} tests/UserSettings_L2Test.cpp) +endif() + +add_library(${MODULE_NAME} SHARED ${SRC_FILES}) set_target_properties(${MODULE_NAME} PROPERTIES CXX_STANDARD 11 diff --git a/Tests/L2Tests/L2TestsPlugin/L2TestsMock.cpp b/Tests/L2Tests/L2TestsPlugin/L2TestsMock.cpp index b4a6fda644..b50cbdcf74 100755 --- a/Tests/L2Tests/L2TestsPlugin/L2TestsMock.cpp +++ b/Tests/L2Tests/L2TestsPlugin/L2TestsMock.cpp @@ -159,6 +159,56 @@ uint32_t L2TestMocks::InvokeServiceMethod(const char *callsign, const char *meth return status; } +/** + * @brief Invoke a service method + * + * @param[in] callsign Service callsign + * @param[in] method Method name + * @param[out] results Method results + * @return Zero (Core::ERROR_NONE) on succes or another value on error + */ +uint32_t L2TestMocks::InvokeServiceMethod(const char *callsign, const char *method, Core::JSON::Boolean &results) +{ + + JSONRPC::LinkType jsonrpc(std::string(callsign), TEST_CALLSIGN); + std::string reply; + uint32_t status = Core::ERROR_NONE; + + TEST_LOG("Invoking %s.%s \n", callsign, method); + + status = jsonrpc.Invoke(INVOKE_TIMEOUT, std::string(method), results); + + results.ToString(reply); + TEST_LOG("Status %u, results %s", status, reply.c_str()); + + return status; +} + +/** + * @brief Invoke a service method + * + * @param[in] callsign Service callsign + * @param[in] method Method name + * @param[out] results Method results + * @return Zero (Core::ERROR_NONE) on succes or another value on error + */ +uint32_t L2TestMocks::InvokeServiceMethod(const char *callsign, const char *method, Core::JSON::String &results) +{ + + JSONRPC::LinkType jsonrpc(std::string(callsign), TEST_CALLSIGN); + std::string reply; + uint32_t status = Core::ERROR_NONE; + + TEST_LOG("Invoking %s.%s \n", callsign, method); + + status = jsonrpc.Invoke(INVOKE_TIMEOUT, std::string(method), results); + + results.ToString(reply); + TEST_LOG("Status %u, results %s", status, reply.c_str()); + + return status; +} + /** * @brief Activate a service plugin * diff --git a/Tests/L2Tests/L2TestsPlugin/L2TestsMock.h b/Tests/L2Tests/L2TestsPlugin/L2TestsMock.h index 8cbcd88497..1b03c447de 100755 --- a/Tests/L2Tests/L2TestsPlugin/L2TestsMock.h +++ b/Tests/L2Tests/L2TestsPlugin/L2TestsMock.h @@ -19,7 +19,6 @@ #pragma once #include - #include #include #include "UtilsJsonRpc.h" @@ -51,7 +50,6 @@ class L2TestMocks : public ::testing::Test { VideoOutputPortMock *p_videoOutputPortMock = nullptr; RBusApiImplMock *p_rBusApiImplMock = nullptr; TelemetryApiImplMock *p_telemetryApiImplMock = nullptr ; - std::string thunder_address; L2TestMocks(); @@ -68,6 +66,27 @@ class L2TestMocks : public ::testing::Test { */ uint32_t InvokeServiceMethod(const char *callsign, const char *method, JsonObject ¶ms, JsonObject &results); + /** + * @brief Invoke a service method + * + * @param[in] callsign Service callsign + * @param[in] method Method name + * @param[out] results Method results + * @return Zero (Core::ERROR_NONE) on succes or another value on error + */ + uint32_t InvokeServiceMethod(const char *callsign, const char *method, Core::JSON::Boolean &results); + + /** + * @brief Invoke a service method + * + * @param[in] callsign Service callsign + * @param[in] method Method name + * @param[out] results Method results + * @return Zero (Core::ERROR_NONE) on succes or another value on error + */ + uint32_t InvokeServiceMethod(const char *callsign, const char *method, Core::JSON::String &results); + + /** * @brief Activate a service plugin * diff --git a/Tests/L2Tests/L2TestsPlugin/tests/UserSettings_L2Test.cpp b/Tests/L2Tests/L2TestsPlugin/tests/UserSettings_L2Test.cpp new file mode 100755 index 0000000000..cc0cbe2bb9 --- /dev/null +++ b/Tests/L2Tests/L2TestsPlugin/tests/UserSettings_L2Test.cpp @@ -0,0 +1,1038 @@ +#include +#include +#include "L2Tests.h" +#include "L2TestsMock.h" +#include +#include +#include +#include +#include + +#define TEST_LOG(x, ...) fprintf(stderr, "\033[1;32m[%s:%d](%s)" x "\n\033[0m", __FILE__, __LINE__, __FUNCTION__, getpid(), gettid(), ##__VA_ARGS__); fflush(stderr); + +#define JSON_TIMEOUT (1000) +#define USERSETTING_CALLSIGN _T("org.rdk.UserSettings") +#define USERSETTINGL2TEST_CALLSIGN _T("L2tests.1") + +using ::testing::NiceMock; +using namespace WPEFramework; +using testing::StrictMock; +using ::WPEFramework::Exchange::IStore2; +using ::WPEFramework::Exchange::IUserSettings; + +typedef enum : uint32_t { + UserSettings_OnAudioDescriptionChanged = 0x00000001, + UserSettings_OnPreferredAudioLanguagesChanged = 0x00000002, + UserSettings_OnPresentationLanguageChanged = 0x00000003, + UserSettings_OnCaptionsChanged = 0x00000004, + UserSettings_OnPreferredCaptionsLanguagesChanged = 0x00000005, + UserSettings_OnPreferredClosedCaptionServiceChanged = 0x00000006, + UserSettings_OnPrivacyModeChanged = 0x00000007, + UserSettings_StateInvalid = 0x00000000 +}UserSettingsL2test_async_events_t; + +class AsyncHandlerMock_UserSetting +{ + public: + AsyncHandlerMock_UserSetting() + { + } + MOCK_METHOD(void, OnAudioDescriptionChanged, (const bool enabled)); + MOCK_METHOD(void, OnPreferredAudioLanguagesChanged, (const string preferredLanguages)); + MOCK_METHOD(void, OnPresentationLanguageChanged, (const string presentationLanguages)); + MOCK_METHOD(void, OnCaptionsChanged, (bool enabled)); + MOCK_METHOD(void, OnPreferredCaptionsLanguagesChanged, (const string preferredLanguages)); + MOCK_METHOD(void, OnPreferredClosedCaptionServiceChanged, (const string service)); + +}; + +class NotificationHandler : public Exchange::IUserSettings::INotification { + private: + /** @brief Mutex */ + std::mutex m_mutex; + + /** @brief Condition variable */ + std::condition_variable m_condition_variable; + + /** @brief Event signalled flag */ + uint32_t m_event_signalled; + + BEGIN_INTERFACE_MAP(Notification) + INTERFACE_ENTRY(Exchange::IUserSettings::INotification) + END_INTERFACE_MAP + + public: + NotificationHandler(){} + ~NotificationHandler(){} + + void OnAudioDescriptionChanged(const bool enabled) override + { + TEST_LOG("OnAudioDescriptionChanged event triggered ***\n"); + std::unique_lock lock(m_mutex); + std::string str = enabled ? "true" : "false"; + + TEST_LOG("OnAudioDescriptionChanged received: %s\n", str.c_str()); + /* Notify the requester thread. */ + m_event_signalled |= UserSettings_OnAudioDescriptionChanged; + m_condition_variable.notify_one(); + } + + void OnPreferredAudioLanguagesChanged(const string& preferredLanguages) override + { + TEST_LOG("OnPreferredAudioLanguagesChanged event triggered ***\n"); + std::unique_lock lock(m_mutex); + + TEST_LOG("OnPreferredAudioLanguagesChanged received: %s\n", preferredLanguages.c_str()); + /* Notify the requester thread. */ + m_event_signalled |= UserSettings_OnPreferredAudioLanguagesChanged; + m_condition_variable.notify_one(); + + } + + void OnPresentationLanguageChanged(const string& presentationLanguages) override + { + TEST_LOG("OnPresentationLanguageChanged event triggered ***\n"); + std::unique_lock lock(m_mutex); + + TEST_LOG("OnPresentationLanguageChanged received: %s\n", presentationLanguages.c_str()); + /* Notify the requester thread. */ + m_event_signalled |= UserSettings_OnPresentationLanguageChanged; + m_condition_variable.notify_one(); + + } + + void OnCaptionsChanged(bool enabled) override + { + TEST_LOG("OnCaptionsChanged event triggered ***\n"); + std::unique_lock lock(m_mutex); + std::string str = enabled ? "true" : "false"; + + TEST_LOG("OnCaptionsChanged received: %s\n", str.c_str()); + /* Notify the requester thread. */ + m_event_signalled |= UserSettings_OnCaptionsChanged; + m_condition_variable.notify_one(); + + } + + void OnPreferredCaptionsLanguagesChanged(const string& preferredLanguages) override + { + TEST_LOG("OnPreferredCaptionsLanguagesChanged event triggered ***\n"); + std::unique_lock lock(m_mutex); + + TEST_LOG("OnPreferredAudioLanguagesChanged received: %s\n", preferredLanguages.c_str()); + /* Notify the requester thread. */ + m_event_signalled |= UserSettings_OnPreferredCaptionsLanguagesChanged; + m_condition_variable.notify_one(); + + } + + void OnPreferredClosedCaptionServiceChanged(const string& service) override + { + TEST_LOG("OnPreferredClosedCaptionServiceChanged event triggered ***\n"); + std::unique_lock lock(m_mutex); + + TEST_LOG("OnPreferredClosedCaptionServiceChanged received: %s\n", service.c_str()); + /* Notify the requester thread. */ + m_event_signalled |= UserSettings_OnPreferredClosedCaptionServiceChanged; + m_condition_variable.notify_one(); + + } + + void OnPrivacyModeChanged(const string& service) override + { + TEST_LOG("OnPrivacyModeChanged event triggered ***\n"); + std::unique_lock lock(m_mutex); + + TEST_LOG("OnPrivacyModeChanged received: %s\n", service.c_str()); + /* Notify the requester thread. */ + m_event_signalled |= UserSettings_OnPrivacyModeChanged; + m_condition_variable.notify_one(); + } + + uint32_t WaitForRequestStatus(uint32_t timeout_ms, UserSettingsL2test_async_events_t expected_status) + { + std::unique_lock lock(m_mutex); + auto now = std::chrono::system_clock::now(); + std::chrono::milliseconds timeout(timeout_ms); + uint32_t signalled = UserSettings_StateInvalid; + + while (!(expected_status & m_event_signalled)) + { + if (m_condition_variable.wait_until(lock, now + timeout) == std::cv_status::timeout) + { + TEST_LOG("Timeout waiting for request status event"); + break; + } + } + + signalled = m_event_signalled; + return signalled; + } + }; + +class UserSettingTest : public L2TestMocks { +protected: + virtual ~UserSettingTest() override; + + public: + UserSettingTest(); + + void OnAudioDescriptionChanged(const bool enabled); + void OnPreferredAudioLanguagesChanged(const string preferredLanguages); + void OnPresentationLanguageChanged(const string presentationLanguages); + void OnCaptionsChanged(bool enabled); + void OnPreferredCaptionsLanguagesChanged(const string preferredLanguages); + void OnPreferredClosedCaptionServiceChanged(const string service); + + uint32_t WaitForRequestStatus(uint32_t timeout_ms,UserSettingsL2test_async_events_t expected_status); + + private: + /** @brief Mutex */ + std::mutex m_mutex; + + /** @brief Condition variable */ + std::condition_variable m_condition_variable; + + /** @brief Event signalled flag */ + uint32_t m_event_signalled; +}; + +UserSettingTest:: UserSettingTest():L2TestMocks() +{ + Core::JSONRPC::Message message; + string response; + uint32_t status = Core::ERROR_GENERAL; + + /* Activate plugin in constructor */ + status = ActivateService("org.rdk.PersistentStore"); + EXPECT_EQ(Core::ERROR_NONE, status); + status = ActivateService("org.rdk.UserSettings"); + EXPECT_EQ(Core::ERROR_NONE, status); +} + +/** + * @brief Destructor for SystemServices L2 test class + */ +UserSettingTest::~UserSettingTest() +{ + uint32_t status = Core::ERROR_GENERAL; + + ON_CALL(*p_rBusApiImplMock, rbus_close(::testing::_ )) + .WillByDefault( + ::testing::Return(RBUS_ERROR_SUCCESS)); + + status = DeactivateService("org.rdk.UserSettings"); + EXPECT_EQ(Core::ERROR_NONE, status); +} + +uint32_t UserSettingTest::WaitForRequestStatus(uint32_t timeout_ms, UserSettingsL2test_async_events_t expected_status) +{ + std::unique_lock lock(m_mutex); + auto now = std::chrono::system_clock::now(); + std::chrono::milliseconds timeout(timeout_ms); + uint32_t signalled = UserSettings_StateInvalid; + + while (!(expected_status & m_event_signalled)) + { + if (m_condition_variable.wait_until(lock, now + timeout) == std::cv_status::timeout) + { + TEST_LOG("Timeout waiting for request status event"); + break; + } + } + + signalled = m_event_signalled; + return signalled; +} + +void UserSettingTest::OnAudioDescriptionChanged(const bool enabled) +{ + TEST_LOG("OnAudioDescriptionChanged event triggered ***\n"); + std::unique_lock lock(m_mutex); + + std::string str = enabled ? "true" : "false"; + TEST_LOG("OnAudioDescriptionChanged received: %s\n", str.c_str()); + + /* Notify the requester thread. */ + m_event_signalled |= UserSettings_OnAudioDescriptionChanged; + m_condition_variable.notify_one(); +} + +void UserSettingTest::OnPreferredAudioLanguagesChanged(const string preferredLanguages) +{ + TEST_LOG("OnPreferredAudioLanguagesChanged event triggered ***\n"); + std::unique_lock lock(m_mutex); + + TEST_LOG("OnPreferredAudioLanguagesChanged received: %s\n", preferredLanguages.c_str()); + + /* Notify the requester thread. */ + m_event_signalled |= UserSettings_OnPreferredAudioLanguagesChanged; + m_condition_variable.notify_one(); +} + +void UserSettingTest::OnPresentationLanguageChanged(const string presentationLanguages) +{ + TEST_LOG("OnPresentationLanguageChanged event triggered ***\n"); + std::unique_lock lock(m_mutex); + + TEST_LOG("OnPresentationLanguageChanged received: %s\n", presentationLanguages.c_str()); + + /* Notify the requester thread. */ + m_event_signalled |= UserSettings_OnPresentationLanguageChanged; + m_condition_variable.notify_one(); +} + +void UserSettingTest::OnCaptionsChanged(bool enabled) +{ + TEST_LOG("OnCaptionsChanged event triggered ***\n"); + std::unique_lock lock(m_mutex); + + std::string str = enabled ? "true" : "false"; + TEST_LOG("OnCaptionsChanged received: %s\n", str.c_str()); + + /* Notify the requester thread. */ + m_event_signalled |= UserSettings_OnCaptionsChanged; + m_condition_variable.notify_one(); +} + +void UserSettingTest::OnPreferredCaptionsLanguagesChanged(const string preferredLanguages) +{ + TEST_LOG("OnPreferredCaptionsLanguagesChanged event triggered ***\n"); + std::unique_lock lock(m_mutex); + + TEST_LOG("OnPreferredAudioLanguagesChanged received: %s\n", preferredLanguages.c_str()); + + /* Notify the requester thread. */ + m_event_signalled |= UserSettings_OnPreferredCaptionsLanguagesChanged; + m_condition_variable.notify_one(); +} + +void UserSettingTest::OnPreferredClosedCaptionServiceChanged(const string service) +{ + TEST_LOG("OnPreferredClosedCaptionServiceChanged event triggered ***\n"); + std::unique_lock lock(m_mutex); + + TEST_LOG("OnPreferredClosedCaptionServiceChanged received: %s\n", service.c_str()); + + /* Notify the requester thread. */ + m_event_signalled |= UserSettings_OnPreferredClosedCaptionServiceChanged; + m_condition_variable.notify_one(); +} + +MATCHER_P(MatchRequestStatusString, data, "") +{ + std::string actual = arg; + TEST_LOG("Expected: %s, Actual: %s", data.c_str(), actual.c_str()); + EXPECT_STREQ(data.c_str(), actual.c_str()); + return data == actual; + +} + +MATCHER_P(MatchRequestStatusBool, expected, "") +{ + bool actual = arg; + std::string expected_str = expected ? "true" : "false"; + std::string actual_str = actual ? "true" : "false"; + TEST_LOG("Expected: %s, Actual: %s", expected_str.c_str(), actual_str.c_str()); + EXPECT_STREQ(expected_str.c_str(), actual_str.c_str()); + return expected == actual; +} + +TEST_F(UserSettingTest,AudioDescriptionSuccess) +{ + JSONRPC::LinkType jsonrpc(USERSETTING_CALLSIGN, USERSETTINGL2TEST_CALLSIGN); + StrictMock async_handler; + uint32_t status = Core::ERROR_GENERAL; + JsonObject params; + JsonObject result_json; + Core::JSON::Boolean result_bool; + bool expected_enabled = true; + uint32_t signalled = UserSettings_StateInvalid; + + TEST_LOG("Testing AudioDescriptionSuccess"); + + status = jsonrpc.Subscribe(JSON_TIMEOUT, + _T("onaudiodescriptionchanged"), + [this, &async_handler](const JsonObject& parameters) { + bool enabled = parameters["enabled"].Boolean(); + async_handler.OnAudioDescriptionChanged(enabled); + }); + + EXPECT_EQ(Core::ERROR_NONE, status); + + EXPECT_CALL(async_handler, OnAudioDescriptionChanged(MatchRequestStatusBool(expected_enabled))) + .WillOnce(Invoke(this, &UserSettingTest::OnAudioDescriptionChanged)); + + params["value"] = true; + status = InvokeServiceMethod("org.rdk.UserSettings", "setaudiodescription", params, result_json); + EXPECT_EQ(status,Core::ERROR_NONE); + + signalled = WaitForRequestStatus(JSON_TIMEOUT,UserSettings_OnAudioDescriptionChanged); + EXPECT_TRUE(signalled & UserSettings_OnAudioDescriptionChanged); + + /* Unregister for events. */ + jsonrpc.Unsubscribe(JSON_TIMEOUT, _T("onaudiodescriptionchanged")); + + EXPECT_EQ(status,Core::ERROR_NONE); + if (status != Core::ERROR_NONE) { + TEST_LOG("Expected Core::ERROR_NONE (0) but got: %u", status); + } + + status = InvokeServiceMethod("org.rdk.UserSettings", "getaudiodescription", result_bool); + EXPECT_EQ(status, Core::ERROR_NONE); + + TEST_LOG("result_bool: %d", result_bool.Value()); + EXPECT_TRUE(result_bool.Value()); +} + +TEST_F(UserSettingTest,PreferredAudioLanguagesSuccess) +{ + JSONRPC::LinkType jsonrpc(USERSETTING_CALLSIGN, USERSETTINGL2TEST_CALLSIGN); + StrictMock async_handler; + uint32_t status = Core::ERROR_GENERAL; + JsonObject params; + JsonObject result_json; + Core::JSON::String result_string; + std::string preferredLanguages = "en,fr,es"; + uint32_t signalled = UserSettings_StateInvalid; + + TEST_LOG("Testing PreferredAudioLanguagesSuccess"); + + status = jsonrpc.Subscribe(JSON_TIMEOUT, + _T("onpreferredaudiolanguageschanged"), + [&async_handler](const JsonObject& parameters) { + std::string preferredLanguages = parameters["preferredlanguages"].String(); + async_handler.OnPreferredAudioLanguagesChanged(preferredLanguages); + }); + + EXPECT_EQ(Core::ERROR_NONE, status); + + EXPECT_CALL(async_handler, OnPreferredAudioLanguagesChanged(MatchRequestStatusString(preferredLanguages))) + .WillOnce(Invoke(this, &UserSettingTest::OnPreferredAudioLanguagesChanged)); + + params["value"] = preferredLanguages; + status = InvokeServiceMethod("org.rdk.UserSettings", "setpreferredaudiolanguages", params, result_json); + EXPECT_EQ(status,Core::ERROR_NONE); + + signalled = WaitForRequestStatus(JSON_TIMEOUT,UserSettings_OnPreferredAudioLanguagesChanged); + EXPECT_TRUE(signalled & UserSettings_OnPreferredAudioLanguagesChanged); + + jsonrpc.Unsubscribe(JSON_TIMEOUT, _T("onpreferredaudiolanguageschanged")); + + EXPECT_EQ(status,Core::ERROR_NONE); + if (status != Core::ERROR_NONE) { + TEST_LOG("Expected Core::ERROR_NONE (0) but got: %u", status); + } + + status = InvokeServiceMethod("org.rdk.UserSettings", "getpreferredaudiolanguages", result_string); + EXPECT_EQ(status,Core::ERROR_NONE); + + EXPECT_EQ(result_string.Value(), preferredLanguages); +} + +TEST_F(UserSettingTest,PresentationLanguageSuccess) +{ + JSONRPC::LinkType jsonrpc(USERSETTING_CALLSIGN, USERSETTINGL2TEST_CALLSIGN); + StrictMock async_handler; + uint32_t status = Core::ERROR_GENERAL; + JsonObject params; + JsonObject result_json; + Core::JSON::String result_string; + std::string presentationLanguage = "en"; + uint32_t signalled = UserSettings_StateInvalid; + + TEST_LOG("Testing PresentationLanguageSuccess"); + + status = jsonrpc.Subscribe(JSON_TIMEOUT, + _T("onpresentationlanguagechanged"), + [&async_handler](const JsonObject& parameters) { + std::string presentationLanguage = parameters["presentationlanguages"].String(); + async_handler.OnPresentationLanguageChanged(presentationLanguage); + }); + + EXPECT_EQ(Core::ERROR_NONE, status); + + EXPECT_CALL(async_handler, OnPresentationLanguageChanged(MatchRequestStatusString(presentationLanguage))) + .WillOnce(Invoke(this, &UserSettingTest::OnPresentationLanguageChanged)); + + params["value"] = "en"; + status = InvokeServiceMethod("org.rdk.UserSettings", "setpresentationlanguage", params, result_json); + EXPECT_EQ(status,Core::ERROR_NONE); + + signalled = WaitForRequestStatus(JSON_TIMEOUT,UserSettings_OnPresentationLanguageChanged); + EXPECT_TRUE(signalled & UserSettings_OnPresentationLanguageChanged); + + jsonrpc.Unsubscribe(JSON_TIMEOUT, _T("onpresentationlanguagechanged")); + + EXPECT_EQ(status,Core::ERROR_NONE); + if (status != Core::ERROR_NONE) { + TEST_LOG("Expected Core::ERROR_NONE (0) but got: %u", status); + } + + status = InvokeServiceMethod("org.rdk.UserSettings", "getpresentationlanguage", result_string); + EXPECT_EQ(status,Core::ERROR_NONE); + + EXPECT_EQ(result_string.Value(), presentationLanguage); +} + +TEST_F(UserSettingTest,SetCaptionsSuccess) +{ + JSONRPC::LinkType jsonrpc(USERSETTING_CALLSIGN, USERSETTINGL2TEST_CALLSIGN); + StrictMock async_handler; + uint32_t status = Core::ERROR_GENERAL; + JsonObject params; + JsonObject result_json; + Core::JSON::Boolean result_bool; + bool expected_enabled = true; + uint32_t signalled = UserSettings_StateInvalid; + + TEST_LOG("Testing SetCaptionsSuccess"); + + status = jsonrpc.Subscribe(JSON_TIMEOUT, + _T("oncaptionschanged"), + [this, &async_handler](const JsonObject& parameters) { + bool enabled = parameters["enabled"].Boolean(); + async_handler.OnCaptionsChanged(enabled); + }); + + EXPECT_EQ(Core::ERROR_NONE, status); + + EXPECT_CALL(async_handler, OnCaptionsChanged(MatchRequestStatusBool(expected_enabled))) + .WillOnce(Invoke(this, &UserSettingTest::OnCaptionsChanged)); + + params["value"] = true; + status = InvokeServiceMethod("org.rdk.UserSettings", "setcaptions", params, result_json); + EXPECT_EQ(status,Core::ERROR_NONE); + + signalled = WaitForRequestStatus(JSON_TIMEOUT,UserSettings_OnCaptionsChanged); + EXPECT_TRUE(signalled & UserSettings_OnCaptionsChanged); + + jsonrpc.Unsubscribe(JSON_TIMEOUT, _T("oncaptionschanged")); + + EXPECT_EQ(status,Core::ERROR_NONE); + if (status != Core::ERROR_NONE) { + TEST_LOG("Expected Core::ERROR_NONE (0) but got: %u", status); + } + + status = InvokeServiceMethod("org.rdk.UserSettings", "getcaptions", result_bool); + EXPECT_EQ(status,Core::ERROR_NONE); + + TEST_LOG("result_bool: %d", result_bool.Value()); + EXPECT_TRUE(result_bool.Value()); +} + +TEST_F(UserSettingTest,SetPreferredCaptionsLanguagesSuccess) +{ + JSONRPC::LinkType jsonrpc(USERSETTING_CALLSIGN, USERSETTINGL2TEST_CALLSIGN); + StrictMock async_handler; + uint32_t status = Core::ERROR_GENERAL; + JsonObject params; + JsonObject result_json; + Core::JSON::String result_string; + string preferredLanguages = "en,es"; + uint32_t signalled = UserSettings_StateInvalid; + + TEST_LOG("Testing SetPreferredCaptionsLanguagesSuccess"); + + status = jsonrpc.Subscribe(JSON_TIMEOUT, + _T("onpreferredcaptionslanguageschanged"), + [&async_handler](const JsonObject& parameters) { + std::string preferredLanguages = parameters["preferredlanguages"].String(); + async_handler.OnPreferredCaptionsLanguagesChanged(preferredLanguages); + }); + + EXPECT_EQ(Core::ERROR_NONE, status); + + EXPECT_CALL(async_handler, OnPreferredCaptionsLanguagesChanged(MatchRequestStatusString(preferredLanguages))) + .WillOnce(Invoke(this, &UserSettingTest::OnPreferredCaptionsLanguagesChanged)); + + params["value"] = "en,es"; + status = InvokeServiceMethod("org.rdk.UserSettings", "setpreferredcaptionslanguages", params, result_json); + EXPECT_EQ(status,Core::ERROR_NONE); + + signalled = WaitForRequestStatus(JSON_TIMEOUT,UserSettings_OnPreferredCaptionsLanguagesChanged); + EXPECT_TRUE(signalled & UserSettings_OnPreferredCaptionsLanguagesChanged); + + jsonrpc.Unsubscribe(JSON_TIMEOUT, _T("onpreferredcaptionslanguageschanged")); + + EXPECT_EQ(status,Core::ERROR_NONE); + if (status != Core::ERROR_NONE) { + TEST_LOG("Expected Core::ERROR_NONE (0) but got: %u", status); + } + + status = InvokeServiceMethod("org.rdk.UserSettings", "getpreferredcaptionslanguages", result_string); + EXPECT_EQ(status,Core::ERROR_NONE); + + EXPECT_EQ(result_string.Value(), preferredLanguages); +} + +TEST_F(UserSettingTest,SetPreferredClosedCaptionServiceSuccess) +{ + JSONRPC::LinkType jsonrpc(USERSETTING_CALLSIGN, USERSETTINGL2TEST_CALLSIGN); + StrictMock async_handler; + uint32_t status = Core::ERROR_GENERAL; + JsonObject params; + JsonObject result_json; + Core::JSON::String result_string; + string expected_service = "CC3"; + uint32_t signalled = UserSettings_StateInvalid; + + TEST_LOG("Testing SetPreferredClosedCaptionServiceSuccess"); + + status = jsonrpc.Subscribe(JSON_TIMEOUT, + _T("onpreferredclosedcaptionservicechanged"), + [&async_handler](const JsonObject& parameters) { + std::string preferredService = parameters["service"].String(); + async_handler.OnPreferredClosedCaptionServiceChanged(preferredService); + }); + EXPECT_EQ(Core::ERROR_NONE, status); + + EXPECT_CALL(async_handler, OnPreferredClosedCaptionServiceChanged(MatchRequestStatusString(expected_service))) + .WillOnce(Invoke(this, &UserSettingTest::OnPreferredClosedCaptionServiceChanged)); + + params["value"] = "CC3"; + status = InvokeServiceMethod("org.rdk.UserSettings", "setpreferredclosedcaptionservice", params, result_json); + EXPECT_EQ(status,Core::ERROR_NONE); + + signalled = WaitForRequestStatus(JSON_TIMEOUT,UserSettings_OnPreferredClosedCaptionServiceChanged); + EXPECT_TRUE(signalled & UserSettings_OnPreferredClosedCaptionServiceChanged); + + jsonrpc.Unsubscribe(JSON_TIMEOUT, _T("onpreferredclosedcaptionservicechanged")); + + EXPECT_EQ(status,Core::ERROR_NONE); + if (status != Core::ERROR_NONE) { + TEST_LOG("Expected Core::ERROR_NONE (0) but got: %u", status); + } + + status = InvokeServiceMethod("org.rdk.UserSettings", "getpreferredclosedcaptionservice", result_string); + EXPECT_EQ(status,Core::ERROR_NONE); + + EXPECT_EQ(result_string.Value(), expected_service); +} + +TEST_F(UserSettingTest,AudioDescriptionSuccessUsingComRpcConnection) +{ + Core::ProxyType> mEngine_UserSettings; + Core::ProxyType mClient_UserSettings; + PluginHost::IShell *mController_UserSettings; + uint32_t status = Core::ERROR_GENERAL; + Core::Sink mNotification; + + TEST_LOG("Creating mEngine_UserSettings"); + mEngine_UserSettings = Core::ProxyType>::Create(); + mClient_UserSettings = Core::ProxyType::Create(Core::NodeId("/tmp/communicator"), Core::ProxyType(mEngine_UserSettings)); + + TEST_LOG("Creating mEngine_UserSettings Announcements"); +#if ((THUNDER_VERSION == 2) || ((THUNDER_VERSION == 4) && (THUNDER_VERSION_MINOR == 2))) + mEngine_UserSettings->Announcements(mClient_UserSettings->Announcement()); +#endif + + if (!mClient_UserSettings.IsValid()) + { + TEST_LOG("Invalid mClient_UserSettings"); + } + else + { + mController_UserSettings = mClient_UserSettings->Open(_T("org.rdk.UserSettings"), ~0, 3000); + if (mController_UserSettings) + { + auto UserSettingsPlugin = mController_UserSettings->QueryInterface(); + uint32_t signalled = UserSettings_StateInvalid; + + UserSettingsPlugin->AddRef(); + UserSettingsPlugin->Register(&mNotification); + + if (UserSettingsPlugin) + { + status = UserSettingsPlugin->SetAudioDescription(true); + EXPECT_EQ(status,Core::ERROR_NONE); + if (status != Core::ERROR_NONE) + { + std::string errorMsg = "COM-RPC returned error " + std::to_string(status) + " (" + std::string(Core::ErrorToString(status)) + ")"; + TEST_LOG("Err: %s", errorMsg.c_str()); + } + + signalled = mNotification.WaitForRequestStatus(JSON_TIMEOUT,UserSettings_OnAudioDescriptionChanged); + EXPECT_TRUE(signalled & UserSettings_OnAudioDescriptionChanged); + + bool Enable = false; + status = UserSettingsPlugin->GetAudioDescription(Enable); + EXPECT_EQ(Enable, true); + EXPECT_EQ(status,Core::ERROR_NONE); + if (status != Core::ERROR_NONE) + { + std::string errorMsg = "COM-RPC returned error " + std::to_string(status) + " (" + std::string(Core::ErrorToString(status)) + ")"; + TEST_LOG("Err: %s", errorMsg.c_str()); + } + UserSettingsPlugin->Unregister(&mNotification); + UserSettingsPlugin->Release(); + } + else + { + TEST_LOG("UserSettingsPlugin is NULL"); + } + mController_UserSettings->Release(); + } + else + { + TEST_LOG("mController_UserSettings is NULL"); + } + } +} + +TEST_F(UserSettingTest,PreferredAudioLanguagesSuccessUsingComRpcConnection) +{ + Core::ProxyType> mEngine_UserSettings; + Core::ProxyType mClient_UserSettings; + PluginHost::IShell *mController_UserSettings; + Core::Sink mNotification; + uint32_t status = Core::ERROR_GENERAL; + + TEST_LOG("Creating mEngine_UserSettings"); + mEngine_UserSettings = Core::ProxyType>::Create(); + mClient_UserSettings = Core::ProxyType::Create(Core::NodeId("/tmp/communicator"), Core::ProxyType(mEngine_UserSettings)); + + TEST_LOG("Creating mEngine_UserSettings Announcements"); +#if ((THUNDER_VERSION == 2) || ((THUNDER_VERSION == 4) && (THUNDER_VERSION_MINOR == 2))) + mEngine_UserSettings->Announcements(mClient_UserSettings->Announcement()); +#endif + + if (!mClient_UserSettings.IsValid()) + { + TEST_LOG("Invalid mClient_UserSettings"); + } + else + { + mController_UserSettings = mClient_UserSettings->Open(_T("org.rdk.UserSettings"), ~0, 3000); + if (mController_UserSettings) + { + auto UserSettingsPlugin = mController_UserSettings->QueryInterface(); + uint32_t signalled = UserSettings_StateInvalid; + + UserSettingsPlugin->AddRef(); + UserSettingsPlugin->Register(&mNotification); + + if (UserSettingsPlugin) + { + const string preferredLanguages = "eng"; + status = UserSettingsPlugin->SetPreferredAudioLanguages(preferredLanguages); + EXPECT_EQ(status,Core::ERROR_NONE); + if (status != Core::ERROR_NONE) + { + std::string errorMsg = "COM-RPC returned error " + std::to_string(status) + " (" + std::string(Core::ErrorToString(status)) + ")"; + TEST_LOG("Err: %s", errorMsg.c_str()); + } + + signalled = mNotification.WaitForRequestStatus(JSON_TIMEOUT,UserSettings_OnPreferredAudioLanguagesChanged); + EXPECT_TRUE(signalled & UserSettings_OnPreferredAudioLanguagesChanged); + + string preferredLanguages1 = ""; + status = UserSettingsPlugin->GetPreferredAudioLanguages(preferredLanguages1); + EXPECT_EQ(preferredLanguages1, preferredLanguages); + EXPECT_EQ(status,Core::ERROR_NONE); + if (status != Core::ERROR_NONE) + { + std::string errorMsg = "COM-RPC returned error " + std::to_string(status) + " (" + std::string(Core::ErrorToString(status)) + ")"; + TEST_LOG("Err: %s", errorMsg.c_str()); + } + UserSettingsPlugin->Unregister(&mNotification); + UserSettingsPlugin->Release(); + } + else + { + TEST_LOG("UserSettingsPlugin is NULL"); + } + mController_UserSettings->Release(); + } + else + { + TEST_LOG("mController_UserSettings is NULL"); + } + } +} + +TEST_F(UserSettingTest,PresentationLanguageSuccessUsingComRpcConnection) +{ + Core::ProxyType> mEngine_UserSettings; + Core::ProxyType mClient_UserSettings; + PluginHost::IShell *mController_UserSettings; + uint32_t status = Core::ERROR_GENERAL; + Core::Sink mNotification; + + + TEST_LOG("Creating mEngine_UserSettings"); + mEngine_UserSettings = Core::ProxyType>::Create(); + mClient_UserSettings = Core::ProxyType::Create(Core::NodeId("/tmp/communicator"), Core::ProxyType(mEngine_UserSettings)); + + TEST_LOG("Creating mEngine_UserSettings Announcements"); +#if ((THUNDER_VERSION == 2) || ((THUNDER_VERSION == 4) && (THUNDER_VERSION_MINOR == 2))) + mEngine_UserSettings->Announcements(mClient_UserSettings->Announcement()); +#endif + + if (!mClient_UserSettings.IsValid()) + { + TEST_LOG("Invalid mClient_UserSettings"); + } + else + { + mController_UserSettings = mClient_UserSettings->Open(_T("org.rdk.UserSettings"), ~0, 3000); + if (mController_UserSettings) + { + auto UserSettingsPlugin = mController_UserSettings->QueryInterface(); + uint32_t signalled = UserSettings_StateInvalid; + + UserSettingsPlugin->AddRef(); + UserSettingsPlugin->Register(&mNotification); + + if (UserSettingsPlugin) + { + const string presentationLanguage = "fra"; + status = UserSettingsPlugin->SetPresentationLanguage(presentationLanguage); + EXPECT_EQ(status,Core::ERROR_NONE); + if (status != Core::ERROR_NONE) + { + std::string errorMsg = "COM-RPC returned error " + std::to_string(status) + " (" + std::string(Core::ErrorToString(status)) + ")"; + TEST_LOG("Err: %s", errorMsg.c_str()); + } + + signalled = mNotification.WaitForRequestStatus(JSON_TIMEOUT,UserSettings_OnPresentationLanguageChanged); + EXPECT_TRUE(signalled & UserSettings_OnPresentationLanguageChanged); + + string presentationLanguage1 = ""; + status = UserSettingsPlugin->GetPresentationLanguage(presentationLanguage1); + EXPECT_EQ(presentationLanguage1, presentationLanguage); + EXPECT_EQ(status,Core::ERROR_NONE); + if (status != Core::ERROR_NONE) + { + std::string errorMsg = "COM-RPC returned error " + std::to_string(status) + " (" + std::string(Core::ErrorToString(status)) + ")"; + TEST_LOG("Err: %s", errorMsg.c_str()); + } + UserSettingsPlugin->Unregister(&mNotification); + UserSettingsPlugin->Release(); + } + else + { + TEST_LOG("UserSettingsPlugin is NULL"); + } + mController_UserSettings->Release(); + } + else + { + TEST_LOG("mController_UserSettings is NULL"); + } + } +} + +TEST_F(UserSettingTest,CaptionsSuccessUsingComRpcConnection) +{ + Core::ProxyType> mEngine_UserSettings; + Core::ProxyType mClient_UserSettings; + PluginHost::IShell *mController_UserSettings; + uint32_t status = Core::ERROR_GENERAL; + Core::Sink mNotification; + + TEST_LOG("Creating mEngine_UserSettings"); + mEngine_UserSettings = Core::ProxyType>::Create(); + mClient_UserSettings = Core::ProxyType::Create(Core::NodeId("/tmp/communicator"), Core::ProxyType(mEngine_UserSettings)); + + TEST_LOG("Creating mEngine_UserSettings Announcements"); +#if ((THUNDER_VERSION == 2) || ((THUNDER_VERSION == 4) && (THUNDER_VERSION_MINOR == 2))) + mEngine_UserSettings->Announcements(mClient_UserSettings->Announcement()); +#endif + + if (!mClient_UserSettings.IsValid()) + { + TEST_LOG("Invalid mClient_UserSettings"); + } + else + { + mController_UserSettings = mClient_UserSettings->Open(_T("org.rdk.UserSettings"), ~0, 3000); + if (mController_UserSettings) + { + auto UserSettingsPlugin = mController_UserSettings->QueryInterface(); + uint32_t signalled = UserSettings_StateInvalid; + + UserSettingsPlugin->AddRef(); + UserSettingsPlugin->Register(&mNotification); + + if (UserSettingsPlugin) + { + status = UserSettingsPlugin->SetCaptions(true); + EXPECT_EQ(status,Core::ERROR_NONE); + if (status != Core::ERROR_NONE) + { + std::string errorMsg = "COM-RPC returned error " + std::to_string(status) + " (" + std::string(Core::ErrorToString(status)) + ")"; + TEST_LOG("Err: %s", errorMsg.c_str()); + } + + signalled = mNotification.WaitForRequestStatus(JSON_TIMEOUT,UserSettings_OnCaptionsChanged); + EXPECT_TRUE(signalled & UserSettings_OnCaptionsChanged); + + bool Enable = false; + status = UserSettingsPlugin->GetCaptions(Enable); + EXPECT_EQ(Enable, true); + EXPECT_EQ(status,Core::ERROR_NONE); + if (status != Core::ERROR_NONE) + { + std::string errorMsg = "COM-RPC returned error " + std::to_string(status) + " (" + std::string(Core::ErrorToString(status)) + ")"; + TEST_LOG("Err: %s", errorMsg.c_str()); + } + UserSettingsPlugin->Unregister(&mNotification); + UserSettingsPlugin->Release(); + } + else + { + TEST_LOG("UserSettingsPlugin is NULL"); + } + mController_UserSettings->Release(); + } + else + { + TEST_LOG("mController_UserSettings is NULL"); + } + } +} + +TEST_F(UserSettingTest,PreferredCaptionsLanguagesSuccessUsingComRpcConnection) +{ + Core::ProxyType> mEngine_UserSettings; + Core::ProxyType mClient_UserSettings; + PluginHost::IShell *mController_UserSettings; + uint32_t status = Core::ERROR_GENERAL; + Core::Sink mNotification; + + TEST_LOG("Creating mEngine_UserSettings"); + mEngine_UserSettings = Core::ProxyType>::Create(); + mClient_UserSettings = Core::ProxyType::Create(Core::NodeId("/tmp/communicator"), Core::ProxyType(mEngine_UserSettings)); + + TEST_LOG("Creating mEngine_UserSettings Announcements"); +#if ((THUNDER_VERSION == 2) || ((THUNDER_VERSION == 4) && (THUNDER_VERSION_MINOR == 2))) + mEngine_UserSettings->Announcements(mClient_UserSettings->Announcement()); +#endif + + if (!mClient_UserSettings.IsValid()) + { + TEST_LOG("Invalid mClient_UserSettings"); + } + else + { + mController_UserSettings = mClient_UserSettings->Open(_T("org.rdk.UserSettings"), ~0, 3000); + if (mController_UserSettings) + { + const string preferredCaptionsLanguages = "eng"; + auto UserSettingsPlugin = mController_UserSettings->QueryInterface(); + uint32_t signalled = UserSettings_StateInvalid; + + UserSettingsPlugin->AddRef(); + UserSettingsPlugin->Register(&mNotification); + + if (UserSettingsPlugin) + { + status = UserSettingsPlugin->SetPreferredCaptionsLanguages(preferredCaptionsLanguages); + EXPECT_EQ(status,Core::ERROR_NONE); + if (status != Core::ERROR_NONE) + { + std::string errorMsg = "COM-RPC returned error " + std::to_string(status) + " (" + std::string(Core::ErrorToString(status)) + ")"; + TEST_LOG("Err: %s", errorMsg.c_str()); + } + + signalled = mNotification.WaitForRequestStatus(JSON_TIMEOUT,UserSettings_OnPreferredCaptionsLanguagesChanged); + EXPECT_TRUE(signalled & UserSettings_OnPreferredCaptionsLanguagesChanged); + + string preferredCaptionsLanguages1 = ""; + status = UserSettingsPlugin->GetPreferredCaptionsLanguages(preferredCaptionsLanguages1); + EXPECT_EQ(preferredCaptionsLanguages1, preferredCaptionsLanguages); + EXPECT_EQ(status,Core::ERROR_NONE); + if (status != Core::ERROR_NONE) + { + std::string errorMsg = "COM-RPC returned error " + std::to_string(status) + " (" + std::string(Core::ErrorToString(status)) + ")"; + TEST_LOG("Err: %s", errorMsg.c_str()); + } + UserSettingsPlugin->Unregister(&mNotification); + UserSettingsPlugin->Release(); + } + else + { + TEST_LOG("UserSettingsPlugin is NULL"); + } + mController_UserSettings->Release(); + } + else + { + TEST_LOG("mController_UserSettings is NULL"); + } + } +} + +TEST_F(UserSettingTest,PreferredClosedCaptionServiceSuccessUsingComRpcConnection) +{ + Core::ProxyType> mEngine_UserSettings; + Core::ProxyType mClient_UserSettings; + PluginHost::IShell *mController_UserSettings; + uint32_t status = Core::ERROR_GENERAL; + Core::Sink mNotification; + + TEST_LOG("Creating mEngine_UserSettings"); + mEngine_UserSettings = Core::ProxyType>::Create(); + mClient_UserSettings = Core::ProxyType::Create(Core::NodeId("/tmp/communicator"), Core::ProxyType(mEngine_UserSettings)); + + TEST_LOG("Creating mEngine_UserSettings Announcements"); +#if ((THUNDER_VERSION == 2) || ((THUNDER_VERSION == 4) && (THUNDER_VERSION_MINOR == 2))) + mEngine_UserSettings->Announcements(mClient_UserSettings->Announcement()); +#endif + + if (!mClient_UserSettings.IsValid()) + { + TEST_LOG("Invalid mClient_UserSettings"); + } + else + { + mController_UserSettings = mClient_UserSettings->Open(_T("org.rdk.UserSettings"), ~0, 3000); + if (mController_UserSettings) + { + auto UserSettingsPlugin = mController_UserSettings->QueryInterface(); + uint32_t signalled = UserSettings_StateInvalid; + + UserSettingsPlugin->AddRef(); + UserSettingsPlugin->Register(&mNotification); + + if (UserSettingsPlugin) + { + const string preferredClosedCaptionService = "CC3"; + status = UserSettingsPlugin->SetPreferredClosedCaptionService(preferredClosedCaptionService); + EXPECT_EQ(status,Core::ERROR_NONE); + if (status != Core::ERROR_NONE) + { + std::string errorMsg = "COM-RPC returned error " + std::to_string(status) + " (" + std::string(Core::ErrorToString(status)) + ")"; + TEST_LOG("Err: %s", errorMsg.c_str()); + } + + signalled = mNotification.WaitForRequestStatus(JSON_TIMEOUT,UserSettings_OnPreferredClosedCaptionServiceChanged); + EXPECT_TRUE(signalled & UserSettings_OnPreferredClosedCaptionServiceChanged); + + string preferredClosedCaptionService1 = ""; + status = UserSettingsPlugin->GetPreferredClosedCaptionService(preferredClosedCaptionService1); + EXPECT_EQ(preferredClosedCaptionService1, preferredClosedCaptionService); + EXPECT_EQ(status,Core::ERROR_NONE); + if (status != Core::ERROR_NONE) + { + std::string errorMsg = "COM-RPC returned error " + std::to_string(status) + " (" + std::string(Core::ErrorToString(status)) + ")"; + TEST_LOG("Err: %s", errorMsg.c_str()); + } + UserSettingsPlugin->Unregister(&mNotification); + UserSettingsPlugin->Release(); + } + else + { + TEST_LOG("UserSettingsPlugin is NULL"); + } + mController_UserSettings->Release(); + } + else + { + TEST_LOG("mController_UserSettings is NULL"); + } + } +} + + diff --git a/Tests/L2Tests/L2testController.cpp b/Tests/L2Tests/L2testController.cpp index 926cc77050..7e5ee564be 100755 --- a/Tests/L2Tests/L2testController.cpp +++ b/Tests/L2Tests/L2testController.cpp @@ -79,7 +79,12 @@ bool L2testController::StartThunder() char address[THUNDER_ADDRESS_LENGTH]; /* Spawn the Thunder process. */ +#ifdef USE_THUNDER_R4 + snprintf(command, sizeof(command), "WPEFramework -c %s/../etc/WPEFramework/config.json -f", CMAKE_INSTALL_PREFIX); +#else snprintf(command, sizeof(command), "WPEFramework -c %s/../etc/WPEFramework/config.json", CMAKE_INSTALL_PREFIX); +#endif + m_fp = popen(command, "w"); if (nullptr == m_fp) { diff --git a/Tests/L2Tests/patches/0001-RDK-45037-Secure-Storage-Thunder-Plugin.patch b/Tests/L2Tests/patches/0001-RDK-45037-Secure-Storage-Thunder-Plugin.patch new file mode 100755 index 0000000000..0efc84d074 --- /dev/null +++ b/Tests/L2Tests/patches/0001-RDK-45037-Secure-Storage-Thunder-Plugin.patch @@ -0,0 +1,602 @@ +commit dbfa64739f8f6ac9be268af6811823da7f3aa666 +Author: Siva Thandayuthapani +Date: Tue Jun 18 11:45:39 2024 +0530 + + R4.4.1 L2 test 0001-RDK-45037-Secure-Storage-Thunder-Plugin.patch + +diff --git a/interfaces/IStore2.h b/interfaces/IStore2.h +new file mode 100644 +index 0000000..6f4810e +--- /dev/null ++++ b/interfaces/IStore2.h +@@ -0,0 +1,87 @@ ++/* ++ * If not stated otherwise in this file or this component's LICENSE file the ++ * following copyright and licenses apply: ++ * ++ * Copyright 2022 Metrological ++ * ++ * Licensed under the Apache License, Version 2.0 (the "License"); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#pragma once ++ ++#include "Module.h" ++ ++// @stubgen:include ++ ++namespace WPEFramework { ++namespace Exchange { ++ ++ struct EXTERNAL IStore2 : virtual public Core::IUnknown { ++ enum { ID = ID_STORE2 }; ++ ++ ~IStore2() override = default; ++ ++ enum ScopeType : uint8_t { ++ DEVICE, ++ ACCOUNT ++ }; ++ ++ struct EXTERNAL INotification : virtual public Core::IUnknown { ++ enum { ID = ID_STORE2_NOTIFICATION }; ++ ++ ~INotification() override = default; ++ ++ virtual void ValueChanged(const ScopeType scope, const string& ns, const string& key, const string& value) = 0; ++ }; ++ ++ virtual uint32_t Register(Exchange::IStore2::INotification* notification) = 0; ++ virtual uint32_t Unregister(Exchange::IStore2::INotification* notification) = 0; ++ ++ virtual uint32_t SetValue(const ScopeType scope, const string& ns, const string& key, const string& value, const uint32_t ttl) = 0; ++ virtual uint32_t GetValue(const ScopeType scope, const string& ns, const string& key, string& value /* @out */, uint32_t& ttl /* @out */) = 0; ++ virtual uint32_t DeleteKey(const ScopeType scope, const string& ns, const string& key) = 0; ++ virtual uint32_t DeleteNamespace(const ScopeType scope, const string& ns) = 0; ++ }; ++ ++ struct EXTERNAL IStoreInspector : virtual public Core::IUnknown { ++ enum { ID = ID_STORE_INSPECTOR }; ++ ++ ~IStoreInspector() override = default; ++ ++ struct NamespaceSize { ++ string ns; ++ uint32_t size; ++ }; ++ ++ using ScopeType = IStore2::ScopeType; ++ using IStringIterator = RPC::IIteratorType; ++ using INamespaceSizeIterator = RPC::IIteratorType; ++ ++ virtual uint32_t GetKeys(const ScopeType scope, const string& ns, IStringIterator*& keys /* @out */) = 0; ++ virtual uint32_t GetNamespaces(const ScopeType scope, IStringIterator*& namespaces /* @out */) = 0; ++ virtual uint32_t GetStorageSizes(const ScopeType scope, INamespaceSizeIterator*& storageList /* @out */) = 0; ++ }; ++ ++ struct EXTERNAL IStoreLimit : virtual public Core::IUnknown { ++ enum { ID = ID_STORE_LIMIT }; ++ ++ ~IStoreLimit() override = default; ++ ++ using ScopeType = IStore2::ScopeType; ++ ++ virtual uint32_t SetNamespaceStorageLimit(const ScopeType scope, const string& ns, const uint32_t size) = 0; ++ virtual uint32_t GetNamespaceStorageLimit(const ScopeType scope, const string& ns, uint32_t& size /* @out */) = 0; ++ }; ++ ++} // namespace Exchange ++} // namespace WPEFramework +diff --git a/interfaces/Ids.h b/interfaces/Ids.h +index 2932adf..64151cf 100644 +--- a/interfaces/Ids.h ++++ b/interfaces/Ids.h +@@ -313,6 +313,11 @@ namespace Exchange { + ID_STORE = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x440, + ID_STORE_NOTIFICATION = ID_STORE + 1, + ID_STORE_CACHE = ID_STORE + 2, ++ ID_STORE2 = ID_STORE + 3, ++ ID_STORE2_NOTIFICATION = ID_STORE + 4, ++ ID_STORE_INSPECTOR = ID_STORE + 5, ++ ID_STORE_INSPECTOR_NAMESPACE_SIZE_ITERATOR = ID_STORE + 6, ++ ID_STORE_LIMIT = ID_STORE + 7, + + ID_LISA = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x450, + ID_LISA_NOTIFICATION = ID_LISA + 1, +diff --git a/jsonrpc/PersistentStore.json b/jsonrpc/PersistentStore.json +new file mode 100644 +index 0000000..0eab341 +--- /dev/null ++++ b/jsonrpc/PersistentStore.json +@@ -0,0 +1,480 @@ ++{ ++ "$schema": "interface.schema.json", ++ "jsonrpc": "2.0", ++ "info": { ++ "title": "PertsistentStore API", ++ "class": "PersistentStore", ++ "description": "Persistent Store JSON-RPC interface" ++ }, ++ "common": { ++ "$ref": "common.json" ++ }, ++ "definitions": { ++ "namespace": { ++ "summary": "Namespace", ++ "type": "string", ++ "example": "ns1" ++ }, ++ "key": { ++ "summary": "Key", ++ "type": "string", ++ "example": "key1" ++ }, ++ "value": { ++ "summary": "Value", ++ "type": "string", ++ "example": "value1" ++ }, ++ "scope": { ++ "summary": "Scope", ++ "type": "string", ++ "enum": [ ++ "device", ++ "account" ++ ], ++ "default": "device", ++ "example": "device" ++ }, ++ "size": { ++ "summary": "Size in bytes", ++ "type": "number", ++ "example": 100 ++ }, ++ "ttl": { ++ "summary": "Time in seconds", ++ "type": "number", ++ "example": 100 ++ }, ++ "success": { ++ "summary": "Legacy parameter (always true)", ++ "type": "boolean", ++ "default": true, ++ "example": true ++ } ++ }, ++ "methods": { ++ "deleteKey": { ++ "summary": "Deletes a key from the specified namespace", ++ "params": { ++ "type": "object", ++ "properties": { ++ "namespace": { ++ "$ref": "#/definitions/namespace" ++ }, ++ "key": { ++ "$ref": "#/definitions/key" ++ }, ++ "scope": { ++ "$ref": "#/definitions/scope" ++ } ++ }, ++ "required": [ ++ "namespace", ++ "key" ++ ] ++ }, ++ "result": { ++ "type": "object", ++ "properties": { ++ "success": { ++ "$ref": "#/definitions/success" ++ } ++ }, ++ "required": [ ++ "success" ++ ] ++ }, ++ "errors": [ ++ { ++ "description": "Unknown error", ++ "$ref": "#/common/errors/general" ++ } ++ ] ++ }, ++ "deleteNamespace": { ++ "summary": "Deletes the specified namespace", ++ "params": { ++ "type": "object", ++ "properties": { ++ "namespace": { ++ "$ref": "#/definitions/namespace" ++ }, ++ "scope": { ++ "$ref": "#/definitions/scope" ++ } ++ }, ++ "required": [ ++ "namespace" ++ ] ++ }, ++ "result": { ++ "type": "object", ++ "properties": { ++ "success": { ++ "$ref": "#/definitions/success" ++ } ++ }, ++ "required": [ ++ "success" ++ ] ++ }, ++ "errors": [ ++ { ++ "description": "Unknown error", ++ "$ref": "#/common/errors/general" ++ } ++ ] ++ }, ++ "flushCache": { ++ "summary": "Flushes the device cache", ++ "result": { ++ "type": "object", ++ "properties": { ++ "success": { ++ "$ref": "#/definitions/success" ++ } ++ }, ++ "required": [ ++ "success" ++ ] ++ }, ++ "errors": [ ++ { ++ "description": "Unknown error", ++ "$ref": "#/common/errors/general" ++ } ++ ] ++ }, ++ "getKeys": { ++ "summary": "Returns the keys that are stored in the specified namespace", ++ "params": { ++ "type": "object", ++ "properties": { ++ "namespace": { ++ "$ref": "#/definitions/namespace" ++ }, ++ "scope": { ++ "$ref": "#/definitions/scope" ++ } ++ }, ++ "required": [ ++ "namespace" ++ ] ++ }, ++ "result": { ++ "type": "object", ++ "properties": { ++ "keys": { ++ "type": "array", ++ "items": { ++ "$ref": "#/definitions/key" ++ } ++ }, ++ "success": { ++ "$ref": "#/definitions/success" ++ } ++ }, ++ "required": [ ++ "keys", ++ "success" ++ ] ++ }, ++ "errors": [ ++ { ++ "description": "Unknown error", ++ "$ref": "#/common/errors/general" ++ } ++ ] ++ }, ++ "getNamespaces": { ++ "summary": "Returns the namespaces", ++ "params": { ++ "type": "object", ++ "properties": { ++ "scope": { ++ "$ref": "#/definitions/scope" ++ } ++ }, ++ "required": [] ++ }, ++ "result": { ++ "type": "object", ++ "properties": { ++ "namespaces": { ++ "type": "array", ++ "items": { ++ "$ref": "#/definitions/namespace" ++ } ++ }, ++ "success": { ++ "$ref": "#/definitions/success" ++ } ++ }, ++ "required": [ ++ "namespaces", ++ "success" ++ ] ++ }, ++ "errors": [ ++ { ++ "description": "Unknown error", ++ "$ref": "#/common/errors/general" ++ } ++ ] ++ }, ++ "getStorageSizes": { ++ "summary": "Returns the size occupied by each namespace", ++ "params": { ++ "type": "object", ++ "properties": { ++ "scope": { ++ "$ref": "#/definitions/scope" ++ } ++ }, ++ "required": [] ++ }, ++ "result": { ++ "type": "object", ++ "properties": { ++ "storageList": { ++ "type": "array", ++ "items": { ++ "type": "object", ++ "properties": { ++ "namespace": { ++ "$ref": "#/definitions/namespace" ++ }, ++ "size": { ++ "$ref": "#/definitions/size" ++ } ++ }, ++ "required": [ ++ "namespace", ++ "size" ++ ] ++ } ++ } ++ }, ++ "required": [ ++ "storageList" ++ ] ++ }, ++ "errors": [ ++ { ++ "description": "Unknown error", ++ "$ref": "#/common/errors/general" ++ } ++ ] ++ }, ++ "getValue": { ++ "summary": "Returns the value of a key from the specified namespace", ++ "params": { ++ "type": "object", ++ "properties": { ++ "namespace": { ++ "$ref": "#/definitions/namespace" ++ }, ++ "key": { ++ "$ref": "#/definitions/key" ++ }, ++ "scope": { ++ "$ref": "#/definitions/scope" ++ } ++ }, ++ "required": [ ++ "namespace", ++ "key" ++ ] ++ }, ++ "result": { ++ "type": "object", ++ "properties": { ++ "value": { ++ "$ref": "#/definitions/value" ++ }, ++ "success": { ++ "$ref": "#/definitions/success" ++ }, ++ "ttl": { ++ "$ref": "#/definitions/ttl" ++ } ++ }, ++ "required": [ ++ "value", ++ "success" ++ ] ++ }, ++ "errors": [ ++ { ++ "description": "Time is not synced", ++ "$ref": "#/common/errors/pendingconditions" ++ }, ++ { ++ "description": "Unknown namespace", ++ "$ref": "#/common/errors/notexist" ++ }, ++ { ++ "description": "Unknown key", ++ "$ref": "#/common/errors/unknownkey" ++ }, ++ { ++ "description": "Unknown error", ++ "$ref": "#/common/errors/general" ++ } ++ ] ++ }, ++ "setValue": { ++ "summary": "Sets the value of a key in the the specified namespace", ++ "params": { ++ "type": "object", ++ "properties": { ++ "namespace": { ++ "$ref": "#/definitions/namespace" ++ }, ++ "key": { ++ "$ref": "#/definitions/key" ++ }, ++ "value": { ++ "$ref": "#/definitions/value" ++ }, ++ "scope": { ++ "$ref": "#/definitions/scope" ++ }, ++ "ttl": { ++ "$ref": "#/definitions/ttl" ++ } ++ }, ++ "required": [ ++ "namespace", ++ "key", ++ "value" ++ ] ++ }, ++ "result": { ++ "type": "object", ++ "properties": { ++ "success": { ++ "$ref": "#/definitions/success" ++ } ++ }, ++ "required": [ ++ "success" ++ ] ++ }, ++ "errors": [ ++ { ++ "description": "Time is not synced", ++ "$ref": "#/common/errors/pendingconditions" ++ }, ++ { ++ "description": "Empty/too large namespace or key, or the storage doesn't have enough space", ++ "$ref": "#/common/errors/invalidinputlength" ++ }, ++ { ++ "description": "Unknown error", ++ "$ref": "#/common/errors/general" ++ } ++ ] ++ }, ++ "setNamespaceStorageLimit": { ++ "summary": "Sets the storage limit for a given namespace", ++ "params": { ++ "type": "object", ++ "properties": { ++ "namespace": { ++ "$ref": "#/definitions/namespace" ++ }, ++ "storageLimit": { ++ "$ref": "#/definitions/size" ++ }, ++ "scope": { ++ "$ref": "#/definitions/scope" ++ } ++ }, ++ "required": [ ++ "namespace", ++ "storageLimit" ++ ] ++ }, ++ "result": { ++ "$ref": "#/common/results/void" ++ }, ++ "errors": [ ++ { ++ "description": "Empty/too large namespace, or the storage doesn't have enough space", ++ "$ref": "#/common/errors/invalidinputlength" ++ }, ++ { ++ "description": "Unknown error", ++ "$ref": "#/common/errors/general" ++ } ++ ] ++ }, ++ "getNamespaceStorageLimit": { ++ "summary": "Returns the storage limit for a given namespace", ++ "params": { ++ "type": "object", ++ "properties": { ++ "namespace": { ++ "$ref": "#/definitions/namespace" ++ }, ++ "scope": { ++ "$ref": "#/definitions/scope" ++ } ++ }, ++ "required": [ ++ "namespace" ++ ] ++ }, ++ "result": { ++ "type": "object", ++ "properties": { ++ "storageLimit": { ++ "$ref": "#/definitions/size" ++ } ++ }, ++ "required": [ ++ "storageLimit" ++ ] ++ }, ++ "errors": [ ++ { ++ "description": "Unknown namespace", ++ "$ref": "#/common/errors/notexist" ++ }, ++ { ++ "description": "Unknown error", ++ "$ref": "#/common/errors/general" ++ } ++ ] ++ } ++ }, ++ "events": { ++ "onValueChanged": { ++ "summary": "Triggered whenever any of the values stored are changed using setValue", ++ "params": { ++ "type": "object", ++ "properties": { ++ "namespace": { ++ "$ref": "#/definitions/namespace" ++ }, ++ "key": { ++ "$ref": "#/definitions/key" ++ }, ++ "value": { ++ "$ref": "#/definitions/value" ++ }, ++ "scope": { ++ "$ref": "#/definitions/scope" ++ } ++ }, ++ "required": [ ++ "namespace", ++ "key", ++ "value", ++ "scope" ++ ] ++ } ++ } ++ } ++} +\ No newline at end of file diff --git a/files/0003-R4.4.1-LocationSync-compilation-error.patch b/Tests/L2Tests/patches/0003-R4.4.1-LocationSync-compilation-error.patch similarity index 100% rename from files/0003-R4.4.1-LocationSync-compilation-error.patch rename to Tests/L2Tests/patches/0003-R4.4.1-LocationSync-compilation-error.patch diff --git a/files/0003-R4.4.1-SystemAudioPlayer-compilation-error.patch b/Tests/L2Tests/patches/0003-R4.4.1-SystemAudioPlayer-compilation-error.patch similarity index 100% rename from files/0003-R4.4.1-SystemAudioPlayer-compilation-error.patch rename to Tests/L2Tests/patches/0003-R4.4.1-SystemAudioPlayer-compilation-error.patch diff --git a/files/0007-RDK-IDeviceInfo-Changes.patch b/Tests/L2Tests/patches/0007-RDK-IDeviceInfo-Changes.patch similarity index 99% rename from files/0007-RDK-IDeviceInfo-Changes.patch rename to Tests/L2Tests/patches/0007-RDK-IDeviceInfo-Changes.patch index 23c432ce48..a6a5ece683 100755 --- a/files/0007-RDK-IDeviceInfo-Changes.patch +++ b/Tests/L2Tests/patches/0007-RDK-IDeviceInfo-Changes.patch @@ -1,3 +1,9 @@ +commit 579dd70842b9758783f510d00a9c8dcb23ffa07e +Author: Siva Thandayuthapani +Date: Tue Jun 18 11:28:49 2024 +0530 + + R4.4.1 L2 test 0007-RDK-IDeviceInfo-Changes + diff --git a/interfaces/IDeviceInfo.h b/interfaces/IDeviceInfo.h index b674799..2a3b48c 100644 --- a/interfaces/IDeviceInfo.h diff --git a/files/0001-Add-TextToSpeech-Interface.patch b/Tests/L2Tests/patches/R.4.4.1-0001-Add-TextToSpeech-Interface.patch old mode 100644 new mode 100755 similarity index 66% rename from files/0001-Add-TextToSpeech-Interface.patch rename to Tests/L2Tests/patches/R.4.4.1-0001-Add-TextToSpeech-Interface.patch index 07273acd18..1b1f3130d0 --- a/files/0001-Add-TextToSpeech-Interface.patch +++ b/Tests/L2Tests/patches/R.4.4.1-0001-Add-TextToSpeech-Interface.patch @@ -1,15 +1,23 @@ -Index: git/interfaces/ITextToSpeech.h -=================================================================== ---- git.orig/interfaces/ITextToSpeech.h -+++ git/interfaces/ITextToSpeech.h -@@ -65,6 +65,7 @@ namespace Exchange { +commit 1f4d2f2fc0a27fe911252ce6c4324aa8b2d23eff +Author: Siva Thandayuthapani +Date: Tue Jun 18 11:04:05 2024 +0530 + + R4.4.1 L2 test TextToSpeech + +diff --git a/interfaces/ITextToSpeech.h b/interfaces/ITextToSpeech.h +index 3c74dc0..6262f00 100644 +--- a/interfaces/ITextToSpeech.h ++++ b/interfaces/ITextToSpeech.h +@@ -65,7 +65,8 @@ namespace Exchange { virtual void Register(ITextToSpeech::INotification* sink) = 0; virtual void Unregister(ITextToSpeech::INotification* sink) = 0; -+ virtual void RegisterWithCallsign(const string callsign,ITextToSpeech::INotification* sink) = 0; - +- ++ ++ virtual void RegisterWithCallsign(const string callsign,ITextToSpeech::INotification* sink) = 0; // @property // @brief Query the status/enable tts + // @param enable status/enable @@ -80,6 +81,7 @@ namespace Exchange { virtual uint32_t SetFallbackText(const string scenario,const string value) = 0; virtual uint32_t SetAPIKey(const string apikey) = 0; @@ -18,12 +26,13 @@ Index: git/interfaces/ITextToSpeech.h // @brief Retrieve tts configuration attributes // @param config tts configuration -@@ -94,7 +96,7 @@ namespace Exchange { +@@ -94,8 +96,7 @@ namespace Exchange { // @param text for conversion // @param speechid returns id for the text // @param status return status - virtual uint32_t Speak(const string text,uint32_t &speechid/* @out */,TTSErrorDetail &status/* @out */) = 0; -+ virtual uint32_t Speak(const string callsign,const string text,uint32_t &speechid/* @out */,TTSErrorDetail &status/* @out */) = 0; - +- ++ virtual uint32_t Speak(const string callsign,const string text,uint32_t &speechid/* @out */,TTSErrorDetail &status/* @out */) = 0; // @brief Cancel the speech // @param speechid id of text to be cancelled + virtual uint32_t Cancel(const uint32_t speechid) = 0; diff --git a/Tests/L2Tests/patches/RDKV-48604-User-Settings-Thunder-Plugin.patch b/Tests/L2Tests/patches/RDKV-48604-User-Settings-Thunder-Plugin.patch new file mode 100755 index 0000000000..905e26de37 --- /dev/null +++ b/Tests/L2Tests/patches/RDKV-48604-User-Settings-Thunder-Plugin.patch @@ -0,0 +1,188 @@ +commit f5fcf7060609b702016a710dd0a53a37528fbe52 +Author: Siva Thandayuthapani +Date: Mon Jun 24 13:45:39 2024 +0530 + + R4.4.1 L2 test RDKV-48604-User-Settings-Thunder-Plugin.patch + +diff --git a/interfaces/IUserSettings.h b/interfaces/IUserSettings.h +new file mode 100755 +index 0000000..d223462 +--- /dev/null ++++ b/interfaces/IUserSettings.h +@@ -0,0 +1,160 @@ ++/* ++ * If not stated otherwise in this file or this component's LICENSE file the ++ * following copyright and licenses apply: ++ * ++ * Copyright 2024 RDK Management ++ * ++ * Licensed under the Apache License, Version 2.0 (the "License"); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#pragma once ++ ++#include "Module.h" ++ ++namespace WPEFramework { ++namespace Exchange { ++ // @json ++struct EXTERNAL IUserSettings : virtual public Core::IUnknown { ++ enum { ID = ID_USER_SETTINGS }; ++ ++ // @event ++ struct EXTERNAL INotification : virtual public Core::IUnknown { ++ enum { ID = ID_USER_SETTINGS_NOTIFICATION }; ++ ++ // @brief The AudioDescription setting has changed. ++ // @param enabled: Enabled/Disabled. ++ virtual void OnAudioDescriptionChanged(const bool enabled) = 0; ++ ++ // @brief The preferredLanguages setting has changed. ++ // @param preferredLanguages: PreferredLanguages. ++ virtual void OnPreferredAudioLanguagesChanged(const string& preferredLanguages) = 0; ++ ++ // @brief The PresentationLanguages setting has changed. ++ // @param presentationLanguages: PresentationLanguages. ++ virtual void OnPresentationLanguageChanged(const string& presentationLanguages) = 0; ++ ++ // @brief The Captions setting has changed. ++ // @param enabled: Enabled/Disabled. ++ virtual void OnCaptionsChanged(const bool enabled) = 0; ++ ++ // @brief The PreferredCaptionsLanguages setting has changed. ++ // @param preferredLanguages: PreferredLanguages. ++ virtual void OnPreferredCaptionsLanguagesChanged(const string& preferredLanguages) = 0; ++ ++ // @brief The PreferredClosedCaptionService setting has changed. ++ // @param service: "CC[1-4]", "TEXT[1-4]", "SERVICE[1-64]". ++ virtual void OnPreferredClosedCaptionServiceChanged(const string& service) = 0; ++ ++ // @brief The PrivacyMode setting has changed. ++ // @param privacyMode: "SHARE", "DO_NOT_SHARE". ++ virtual void OnPrivacyModeChanged(const string& privacyMode) = 0; ++ }; ++ ++ virtual uint32_t Register(Exchange::IUserSettings::INotification* notification /* @in */) = 0; ++ virtual uint32_t Unregister(Exchange::IUserSettings::INotification* notification /* @in */) = 0; ++ ++ // @property ++ // @brief Sets AudioDescription ON/OFF. Players should preferred Audio Descriptive tracks over normal audio track when enabled ++ // @param enabled: Enabled/Disabled ++ virtual uint32_t SetAudioDescription(const bool enabled /* @in */) = 0; ++ ++ // @property ++ // @brief Gets the current AudioDescription setting ++ // @param enabled: Enabled/Disabled ++ virtual uint32_t GetAudioDescription(bool &enabled /* @out */) const = 0; ++ ++ // @property ++ // @brief A prioritized list of ISO 639-2/B codes for the preferred audio languages, ++ // expressed as a comma separated lists of languages of zero of more elements. ++ // The players will pick the audio track that has the best match compared with ++ // this list. In the absence of a matching track, the player should by best ++ // effort select the preferred audio track.*/ ++ // @param preferredLanguages: PreferredLanguages ++ virtual uint32_t SetPreferredAudioLanguages(const string& preferredLanguages /* @in */) = 0; ++ ++ // @property ++ // @brief Gets the current PreferredAudioLanguages setting ++ // @param preferredLanguages: PreferredLanguages ++ virtual uint32_t GetPreferredAudioLanguages(string &preferredLanguages /* @out */) const = 0; ++ ++ // @property ++ // @brief Sets the presentationLanguages in a full BCP 47 value, including script, region, variant ++ // @param presentationLanguages: "en-US", "es-US", "en-CA", "fr-CA" ++ virtual uint32_t SetPresentationLanguage(const string& presentationLanguages /* @in */) = 0; ++ ++ // @property ++ // @brief Gets the presentationLanguages ++ // @param presentationLanguages: "en-US", "es-US", "en-CA", "fr-CA" ++ virtual uint32_t GetPresentationLanguage(string &presentationLanguages /* @out */) const = 0; ++ ++ // @property ++ // @brief brief Sets Captions ON/OFF. ++ // @details A setting of ON indicates that Players should select a subtitle track for presentation ++ // The Setting does not influence any running sessions. It is up to the player to enforce the setting. ++ // This is a global state persisted by the TextTrack plug-in applying to all forms of text; closed captions, Captions ++ // and timed text types. ++ // Media players should to listen to OnCaptionsChanged notifications to react to platform wide dynamic state changes ++ // of this state while a playback is active. ++ // When media players start playback, they should also call the GetCaptions method to retrieve the current enabled state. ++ // This holds true for media players that utilize TextTrack render sessions for text track decode-display and also for media ++ // players or apps that decode-display internally ++ // @param enabled Sets the state ++ virtual uint32_t SetCaptions(const bool enabled /* @in */) = 0; ++ ++ // @property ++ // @brief Gets the Captions setting. ++ // @param enabled Receives the state ++ virtual uint32_t GetCaptions(bool &enabled /* @out */) const = 0; ++ ++ // @property ++ // @brief Set preferred languages for captions. ++ // @details A prioritized list of ISO 639-2/B codes for the preferred Captions languages, ++ // expressed as a comma separated lists of languages of zero of more elements. ++ // The players will pick the subtitle track that has the best match compared with ++ // this list. In the absence of a matching track, the player should by best ++ // effort select the preferred subtitle track. ++ // @param preferredLanguages Is the list to set (e.g. "eng,fra") ++ virtual uint32_t SetPreferredCaptionsLanguages(const string& preferredLanguages /* @in */) = 0; ++ ++ // @property ++ // @brief Gets the current PreferredCaptionsLanguages setting. ++ // @param preferredLanguages (e.g. "eng,fra") ++ virtual uint32_t GetPreferredCaptionsLanguages(string &preferredLanguages /* @out */) const = 0; ++ ++ // @property ++ // @brief Sets the PreferredClosedCaptionService. ++ // @details The setting should be honored by the player. The behaviour of AUTO may be player specific. ++ // Valid input for service is "CC[1-4]", "TEXT[1-4]", "SERVICE[1-64]" ++ // @param service Identifies the service to display e.g. "CC3". ++ ++ virtual uint32_t SetPreferredClosedCaptionService(const string& service /* @in */) = 0; ++ ++ // @property ++ // @brief Gets the current PreferredClosedCaptionService setting. ++ // @param service Identifies the service to display e.g. "CC3". ++ virtual uint32_t GetPreferredClosedCaptionService(string &service /* @out */) const = 0; ++ ++ // @property ++ // @brief Sets the PrivacyMode. ++ // @details The setting should be honored by the Telemetry. ++ // If privacyMode is "DO_NOT_SHARE", logs and crash report should not be uploaded. ++ // @param privacyMode: "SHARE", "DO_NOT_SHARE" ++ virtual uint32_t SetPrivacyMode(const string& privacyMode /* @in */) = 0; ++ ++ // @property ++ // @brief Gets the current PrivacyMode setting. ++ // @param privacyMode e.g "SHARE" ++ virtual uint32_t GetPrivacyMode(string &privacyMode /* @out */) const = 0; ++}; ++} // namespace Exchange ++} // namespace WPEFramework +diff --git a/interfaces/Ids.h b/interfaces/Ids.h +index 64151cf..7aac530 100644 +--- a/interfaces/Ids.h ++++ b/interfaces/Ids.h +@@ -360,7 +360,10 @@ namespace Exchange { + ID_SCRIPT_ENGINE_NOTIFICATION = ID_SCRIPT_ENGINE + 1, + + ID_TEXT_TO_SPEECH = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x4C0, +- ID_TEXT_TO_SPEECH_NOTIFICATION = ID_TEXT_TO_SPEECH + 1 ++ ID_TEXT_TO_SPEECH_NOTIFICATION = ID_TEXT_TO_SPEECH + 1, ++ ++ ID_USER_SETTINGS = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x4D0, ++ ID_USER_SETTINGS_NOTIFICATION = ID_USER_SETTINGS + 1 + }; + } + } diff --git a/files/SplitDeviceCapablities.patch b/Tests/L2Tests/patches/SplitDeviceCapablities.patch similarity index 84% rename from files/SplitDeviceCapablities.patch rename to Tests/L2Tests/patches/SplitDeviceCapablities.patch index 2b6723406b..0aa8347bca 100755 --- a/files/SplitDeviceCapablities.patch +++ b/Tests/L2Tests/patches/SplitDeviceCapablities.patch @@ -1,3 +1,35 @@ +commit 8c05aa9f5d97d1668b2c21dabb396521d33e17e3 +Author: Siva Thandayuthapani +Date: Tue Jun 18 11:24:19 2024 +0530 + + R4.4.1 L2 test SplitDeviceCapablities + +diff --git a/interfaces/IFirmwareVersion.h b/interfaces/IFirmwareVersion.h +new file mode 100644 +index 0000000..682a0fa +--- /dev/null ++++ b/interfaces/IFirmwareVersion.h +@@ -0,0 +1,20 @@ ++#pragma once ++ ++#include "Module.h" ++ ++namespace WPEFramework { ++namespace Exchange { ++ ++ struct EXTERNAL IFirmwareVersion : virtual public Core::IUnknown { ++ enum { ID = ID_FIRMWARE_VERSION }; ++ ++ virtual ~IFirmwareVersion() override = default; ++ ++ virtual uint32_t Imagename(string& imagename /* @out */) const = 0; ++ virtual uint32_t Sdk(string& sdk /* @out */) const = 0; ++ virtual uint32_t Mediarite(string& mediarite /* @out */) const = 0; ++ virtual uint32_t Yocto(string& yocto /* @out */) const = 0; ++ }; ++} ++} ++ diff --git a/interfaces/Ids.h b/interfaces/Ids.h index a37db24..2932adf 100644 --- a/interfaces/Ids.h @@ -7,32 +39,6 @@ index a37db24..2932adf 100644 ID_DEVICE_CAPABILITIES_VIDEO_OUTPUT = ID_DEVICE_INFO + 7, ID_DEVICE_CAPABILITIES_RESOLUTION = ID_DEVICE_INFO + 8, + ID_FIRMWARE_VERSION = ID_DEVICE_INFO + 9, - + ID_DIALSERVER = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x380, ID_DIALSERVER_APPLICATION = ID_DIALSERVER + 1, - -diff --git a/interfaces/IFirmwareVersion.h b/interfaces/IFirmwareVersion.h -new file mode 100644 -index 0000000..ba6ce5a ---- /dev/null -+++ b/interfaces/IFirmwareVersion.h -@@ -0,0 +1,19 @@ -+#pragma once -+ -+#include "Module.h" -+ -+namespace WPEFramework { -+namespace Exchange { -+ -+ struct EXTERNAL IFirmwareVersion : virtual public Core::IUnknown { -+ enum { ID = ID_FIRMWARE_VERSION }; -+ -+ virtual ~IFirmwareVersion() override = default; -+ -+ virtual uint32_t Imagename(string& imagename /* @out */) const = 0; -+ virtual uint32_t Sdk(string& sdk /* @out */) const = 0; -+ virtual uint32_t Mediarite(string& mediarite /* @out */) const = 0; -+ virtual uint32_t Yocto(string& yocto /* @out */) const = 0; -+ }; -+} -+} diff --git a/Tests/mocks/RBus.cpp b/Tests/mocks/RBus.cpp index 9399a556bd..f0573acdeb 100755 --- a/Tests/mocks/RBus.cpp +++ b/Tests/mocks/RBus.cpp @@ -60,8 +60,36 @@ rbusError_t RBusApi::rbus_close(rbusHandle_t handle) EXPECT_NE(impl, nullptr); return impl->rbus_close(handle); } + +rbusValue_t RBusApi::rbusValue_Init(rbusValue_t* pvalue) +{ + EXPECT_NE(impl, nullptr); + return impl->rbusValue_Init(pvalue); +} + +void RBusApi::rbusValue_SetString(rbusValue_t value, char const* s) +{ + EXPECT_NE(impl, nullptr); + impl->rbusValue_SetString(value,s); +} + +rbusError_t RBusApi::rbus_set( rbusHandle_t handle, char const* name, rbusValue_t value, rbusSetOptions_t* opts) +{ + EXPECT_NE(impl, nullptr); + return impl->rbus_set( handle, name, value, opts); +} + +void RBusApi::rbusValue_Release(rbusValue_t value) +{ + EXPECT_NE(impl, nullptr); + impl->rbusValue_Release(value); +} rbusError_t (*rbus_open)(rbusHandle_t*,char const* ) = &RBusApi::rbus_open; rbusError_t (*rbusMethod_InvokeAsync)(rbusHandle_t,char const*, rbusObject_t,rbusMethodAsyncRespHandler_t,int)= &RBusApi::rbusMethod_InvokeAsync; rbusValue_t (*rbusObject_GetValue)(rbusObject_t,char const*) = &RBusApi::rbusObject_GetValue; char const* (*rbusValue_GetString)(rbusValue_t,int*) = &RBusApi::rbusValue_GetString; rbusError_t (*rbus_close)(rbusHandle_t) = &RBusApi::rbus_close; +rbusValue_t (*rbusValue_Init)(rbusValue_t*) = &RBusApi::rbusValue_Init; +void (*rbusValue_SetString)(rbusValue_t, char const*) = &RBusApi::rbusValue_SetString; +rbusError_t (*rbus_set)( rbusHandle_t , char const* , rbusValue_t , rbusSetOptions_t*) = &RBusApi::rbus_set; +void (*rbusValue_Release)(rbusValue_t) = &RBusApi::rbusValue_Release; \ No newline at end of file diff --git a/Tests/mocks/RBus.h b/Tests/mocks/RBus.h index 2b6ac48b3c..d792a87720 100644 --- a/Tests/mocks/RBus.h +++ b/Tests/mocks/RBus.h @@ -21,6 +21,13 @@ typedef struct _rbusObject* rbusObject_t; struct _rbusValue { }; + +typedef struct _rbusSetOptions +{ + bool commit; + unsigned int sessionId; +} rbusSetOptions_t; + typedef struct _rbusValue* rbusValue_t; typedef void (*rbusMethodAsyncRespHandler_t)(rbusHandle_t handle, char const* methodName, rbusError_t error, rbusObject_t params); @@ -35,6 +42,10 @@ class RBusApiImpl { virtual rbusValue_t rbusObject_GetValue(rbusObject_t object, char const* name) = 0; virtual char const* rbusValue_GetString(rbusValue_t value, int* len) = 0; virtual rbusError_t rbus_close(rbusHandle_t handle) = 0; + virtual rbusValue_t rbusValue_Init(rbusValue_t* pvalue) = 0; + virtual void rbusValue_SetString(rbusValue_t value, char const* s) = 0; + virtual rbusError_t rbus_set( rbusHandle_t handle, char const* name, rbusValue_t value, rbusSetOptions_t* opts) = 0; + virtual void rbusValue_Release(rbusValue_t value) = 0; }; class RBusApi { @@ -51,6 +62,10 @@ class RBusApi { static rbusValue_t rbusObject_GetValue(rbusObject_t object, char const* name); static char const* rbusValue_GetString(rbusValue_t value, int* len); static rbusError_t rbus_close(rbusHandle_t handle); + static rbusValue_t rbusValue_Init(rbusValue_t* pvalue); + static void rbusValue_SetString(rbusValue_t value, char const* s); + static rbusError_t rbus_set( rbusHandle_t handle, char const* name, rbusValue_t value, rbusSetOptions_t* opts); + static void rbusValue_Release(rbusValue_t value); }; extern rbusError_t (*rbus_open)(rbusHandle_t*,char const* ); @@ -58,4 +73,7 @@ extern rbusError_t (*rbusMethod_InvokeAsync)(rbusHandle_t,char const*, rbusObjec extern rbusValue_t (*rbusObject_GetValue)(rbusObject_t,char const*); extern char const* (*rbusValue_GetString)(rbusValue_t,int*); extern rbusError_t (*rbus_close)(rbusHandle_t); - +extern rbusValue_t (*rbusValue_Init)(rbusValue_t*); +extern void (*rbusValue_SetString)(rbusValue_t, char const*); +extern rbusError_t (*rbus_set)( rbusHandle_t , char const* , rbusValue_t , rbusSetOptions_t*); +extern void (*rbusValue_Release)(rbusValue_t); diff --git a/Tests/mocks/RBusMock.h b/Tests/mocks/RBusMock.h index 50e3105d4e..4374b4b402 100644 --- a/Tests/mocks/RBusMock.h +++ b/Tests/mocks/RBusMock.h @@ -13,4 +13,8 @@ class RBusApiImplMock : public RBusApiImpl { MOCK_METHOD(rbusValue_t, rbusObject_GetValue, (rbusObject_t object, char const* name), (override)); MOCK_METHOD(char const*, rbusValue_GetString, (rbusValue_t value, int* len), (override)); MOCK_METHOD(rbusError_t, rbus_close, (rbusHandle_t handle) , (override)); + MOCK_METHOD(rbusValue_t,rbusValue_Init,(rbusValue_t* pvalue), (override));; + MOCK_METHOD(void,rbusValue_SetString,(rbusValue_t value, char const* s), (override));; + MOCK_METHOD(rbusError_t,rbus_set, (rbusHandle_t handle, char const* name, rbusValue_t value, rbusSetOptions_t* opts), (override));; + MOCK_METHOD(void,rbusValue_Release,(rbusValue_t value), (override));; }; diff --git a/UserSettings/CMakeLists.txt b/UserSettings/CMakeLists.txt index e0c39d2e71..684b858580 100755 --- a/UserSettings/CMakeLists.txt +++ b/UserSettings/CMakeLists.txt @@ -73,6 +73,16 @@ set_target_properties(${PLUGIN_IMPLEMENTATION} PROPERTIES CXX_STANDARD 11 CXX_STANDARD_REQUIRED YES) +if (RDK_SERVICE_L2_TEST) + find_library(TESTMOCKLIB_LIBRARIES NAMES TestMocklib) + if (TESTMOCKLIB_LIBRARIES) + message ("linking mock libraries ${TESTMOCKLIB_LIBRARIES} library") + target_link_libraries(${PLUGIN_IMPLEMENTATION} PRIVATE ${TESTMOCKLIB_LIBRARIES}) + else (TESTMOCKLIB_LIBRARIES) + message ("Require ${TESTMOCKLIB_LIBRARIES} library") + endif (TESTMOCKLIB_LIBRARIES) +endif (RDK_SERVICES_L2_TEST) + target_link_libraries(${PLUGIN_IMPLEMENTATION} PRIVATE CompileSettingsDebug::CompileSettingsDebug diff --git a/l2tests.cmake b/l2tests.cmake index b2132dbf90..8e20d66af2 100755 --- a/l2tests.cmake +++ b/l2tests.cmake @@ -98,7 +98,6 @@ add_definitions( -DUNIT_TESTING ) - message("Setting build options") set(CMAKE_DISABLE_FIND_PACKAGE_DS ON) set(CMAKE_DISABLE_FIND_PACKAGE_IARMBus ON) @@ -110,21 +109,25 @@ set(CMAKE_DISABLE_FIND_PACKAGE_Dobby ON) set(CMAKE_DISABLE_FIND_PACKAGE_CEC ON) set(PLUGIN_SYSTEMSERVICES ON) set(PLUGIN_WAREHOUSE ON) -set(PLUGIN_TELEMETRY ON) # We are not compiling TEXTTOSPEECH, NETWORK, HDCPPROFILE plugins for Thunder R4 as # this work is not in this scope. In future we will enable these plugins for Thunder R4. if (USE_THUNDER_R4) +set(PLUGIN_PERSISTENTSTORE ON) +set(PLUGIN_USERSETTINGS ON) set(PLUGIN_HDCPPROFILE OFF) set(PLUGIN_NETWORK OFF) set(PLUGIN_TEXTTOSPEECH OFF) +set(PLUGIN_TELEMETRY ON) +set(PLUGIN_USBACCESS OFF) else () set(PLUGIN_HDCPPROFILE ON) set(PLUGIN_NETWORK ON) set(PLUGIN_TEXTTOSPEECH ON) +set(PLUGIN_TELEMETRY ON) +set(PLUGIN_USBACCESS ON) endif (USE_THUNDER_R4) -set(PLUGIN_USBACCESS ON) set(PLUGIN_L2Tests ON) set(BUILD_SHARED_LIBS ON) set(DS_FOUND ON)