Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# the repo. Unless a later match takes precedence,
# @global-owner1 and @global-owner2 will be requested for
# review when someone opens a pull request.
* @rdkcentral/nativescript-owners
* @rdkcentral/nativescript-maintainers

20 changes: 20 additions & 0 deletions .github/workflows/cla.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "CLA"

permissions:
contents: read
pull-requests: write
actions: write
statuses: write

on:
issue_comment:
types: [created]
pull_request_target:
types: [opened, closed, synchronize]

jobs:
CLA-Lite:
name: "Signature"
uses: rdkcentral/cmf-actions/.github/workflows/cla.yml@v1
secrets:
PERSONAL_ACCESS_TOKEN: ${{ secrets.CLA_ASSISTANT }}
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@ name: Fossid Stateless Diff Scan

on:
pull_request:
branches:
- develop
types: [opened, synchronize, reopened]

permissions:
contents: read
pull-requests: read

jobs:
call-fossid-workflow:
uses: rdkcentral/build_tools_workflows/.github/workflows/fossid_integration_stateless_diffscan.yml@develop
if: ${{ ! github.event.pull_request.head.repo.fork }}
uses: rdkcentral/build_tools_workflows/.github/workflows/fossid_integration_stateless_diffscan.yml@1.0.0
secrets:
FOSSID_CONTAINER_USERNAME: ${{ secrets.FOSSID_CONTAINER_USERNAME }}
FOSSID_CONTAINER_PASSWORD: ${{ secrets.FOSSID_CONTAINER_PASSWORD }}
FOSSID_HOST_USERNAME: ${{ secrets.FOSSID_HOST_USERNAME }}
FOSSID_HOST_TOKEN: ${{ secrets.FOSSID_HOST_TOKEN }}

106 changes: 106 additions & 0 deletions .github/workflows/jsruntime_L1tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: L1 Unit Tests for rdkNativeScript
permissions:
contents: read
checks: write

on:
push:
branches: [develop]
pull_request:
branches: [develop]
workflow_dispatch:

env:
AUTOMATICS_UNAME: ${{ secrets.AUTOMATICS_UNAME }}
AUTOMATICS_PASSCODE: ${{ secrets.AUTOMATICS_PASSCODE }}

jobs:
build-and-test-l1:
runs-on: ubuntu-latest

steps:
- name: Checkout source repository
uses: actions/checkout@v3

- name: Checkout rdkNativeScript_tests repository
uses: actions/checkout@v3
with:
repository: rdk-e/rdkNativeScript_tests
ref: topic/RDKEMW-5610
path: rdkNativeScript_tests
token: ${{ secrets.GH_PAT }}

- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install -y \
g++ \
cmake \
build-essential \
libcurl4-openssl-dev \
libcjson-dev \
libgtest-dev \
libssl-dev \
zlib1g-dev \
libuv1-dev \
lcov \
libglib2.0-dev

- name: Build Google Test and Google Mock
run: |
cd /usr/src/googletest
sudo cmake -S . -B build
sudo cmake --build build
sudo cp build/lib/libgmock.a /usr/lib
sudo cp build/lib/libgmock_main.a /usr/lib
sudo cp build/lib/libgtest.a /usr/lib
sudo cp build/lib/libgtest_main.a /usr/lib

- name: Configure and Build L1
run: |
mkdir -p build_l1
cd build_l1
cmake -DCMAKE_BUILD_TYPE=Debug \
-DRUN_L1=ON \
-DRUN_L2=OFF \
-DENABLE_JSRUNTIME_ESSOS=ON \
-DENABLE_JSRUNTIME_PLAYER=ON \
-DENABLE_AAMP_JSBINDINGS=ON \
-DENABLE_AAMP_JSBINDINGS_DYNAMIC=ON \
-DENABLE_AAMP_JSBINDINGS_STATIC=OFF \
-DJSRUNTIME_ENGINE_NAME=jsc \
-Djsruntime_source=.. ../rdkNativeScript_tests
make -j$(nproc)

- name: Run L1 Tests and Generate JUnit Results
run: |
cd build_l1
#ctest -R RunL1Tests --output-on-failure --no-compress-output --output-junit ctest-results.xml
./L1_tests --gtest_output=xml:ctest-results.xml

- name: Publish L1 test results
uses: dorny/test-reporter@v1
with:
name: Unit Test Results
path: build_l1/ctest-results.xml
reporter: java-junit

- name: Generate coverage report
run: |
cd build_l1
lcov --capture --directory . --output-file coverage.info --ignore-errors mismatch --rc geninfo_unexecuted_blocks=1
lcov --remove coverage.info '/usr/*' '*/test/*' '*/tests/*' '*/L1/*' '*/mocks/*' '*/gtest/*' '*/gmock/*' '*/googletest/*' '*/include/*' --output-file coverage.cleaned.info --ignore-errors unused
lcov --extract coverage.cleaned.info '*/src/*' --output-file coverage.final.info
genhtml coverage.final.info --output-directory html_coverage_report

- name: Upload test result file (JUnit XML)
uses: actions/upload-artifact@v4
with:
name: ctest-results-l1-${{ github.run_id }}
path: build_l1/ctest-results.xml

- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: l1-html-coverage-report
path: build_l1/html_coverage_report
if-no-files-found: warn
27 changes: 20 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,22 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [1.0.7](https://github.com/rdkcentral/rdkNativeScript/compare/1.0.6...1.0.7)

- Switching between Xumo Fast Channels and Vipa activated… [`#68`](https://github.com/rdkcentral/rdkNativeScript/pull/68)
- RDKEMW-5610 : L1 test cases for jsruntime [`#66`](https://github.com/rdkcentral/rdkNativeScript/pull/66)
- Deploy fossid_integration_stateless_diffscan_target_repo action [`#67`](https://github.com/rdkcentral/rdkNativeScript/pull/67)
- Deploy cla action [`#40`](https://github.com/rdkcentral/rdkNativeScript/pull/40)
- Update CODEOWNERS [`#63`](https://github.com/rdkcentral/rdkNativeScript/pull/63)
- Switching between Xumo Fast Channels and Vipa activated Channels [`228cf8b`](https://github.com/rdkcentral/rdkNativeScript/commit/228cf8bfdde6d7f7d991805193038b392bc0e89b)
- Merge tag '1.0.6' into develop [`afdf341`](https://github.com/rdkcentral/rdkNativeScript/commit/afdf341c4f81e7019d76f207c7b428dbd0ffc00d)

#### [1.0.6](https://github.com/rdkcentral/rdkNativeScript/compare/1.0.5...1.0.6)

> 16 September 2025

- RDKEMW-8240 : Add logs in jsruntime.log in /opt/logs [`#60`](https://github.com/rdkcentral/rdkNativeScript/pull/60)
- 1.0.6 release changelog updates [`1721c05`](https://github.com/rdkcentral/rdkNativeScript/commit/1721c05e9b79e6be0e98852b6f596abf7b6f1e68)
- Merge tag '1.0.5' into develop [`0bae809`](https://github.com/rdkcentral/rdkNativeScript/commit/0bae809fc9bb8a69156798e07b15cade4c526431)

#### [1.0.5](https://github.com/rdkcentral/rdkNativeScript/compare/1.0.4...1.0.5)
Expand All @@ -22,7 +35,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
> 7 September 2025

- RDKEMW-7489: Adding Href support [`#54`](https://github.com/rdkcentral/rdkNativeScript/pull/54)
- Ticket:RDKEMW-5556: Bug for terminateApplication [`#51`](https://github.com/rdkcentral/rdkNativeScript/pull/51)
- RDKEMW-5556: Bug for terminateApplication [`#51`](https://github.com/rdkcentral/rdkNativeScript/pull/51)
- 1.0.4 release changelog updates [`2e56742`](https://github.com/rdkcentral/rdkNativeScript/commit/2e56742d0adda04fe61277fa0782e2b5b2dde19c)
- Merge tag '1.0.3' into develop [`e15828d`](https://github.com/rdkcentral/rdkNativeScript/commit/e15828d5a330b072753e682f5c446b0f9ae14531)

Expand All @@ -45,9 +58,9 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- RDKEMW-4729:Add support for clearMeasures [`#33`](https://github.com/rdkcentral/rdkNativeScript/pull/33)
- RDKEMW-3466 : JSRuntimeWidget [`#32`](https://github.com/rdkcentral/rdkNativeScript/pull/32)
- RDKEMW-4353:Implement logs to remain [`#29`](https://github.com/rdkcentral/rdkNativeScript/pull/29)
- Ticket Number:RDKEMW-4353:Bug when set DEBUG level [`#28`](https://github.com/rdkcentral/rdkNativeScript/pull/28)
- Ticket Number:RDKEMW-4278:Update launchTime metrics [`#27`](https://github.com/rdkcentral/rdkNativeScript/pull/27)
- Ticket Number:RDKEMW-4353:Implement logs to remain [`32f6cf1`](https://github.com/rdkcentral/rdkNativeScript/commit/32f6cf11af9c786d34334838ff75065fbd0d70cf)
- RDKEMW-4353:Bug when set DEBUG level [`#28`](https://github.com/rdkcentral/rdkNativeScript/pull/28)
- RDKEMW-4278:Update launchTime metrics [`#27`](https://github.com/rdkcentral/rdkNativeScript/pull/27)
- RDKEMW-4353:Implement logs to remain [`32f6cf1`](https://github.com/rdkcentral/rdkNativeScript/commit/32f6cf11af9c786d34334838ff75065fbd0d70cf)
- 1.0.2 release changelog updates [`bd89254`](https://github.com/rdkcentral/rdkNativeScript/commit/bd89254c510cbd92accda18c4df5fa8d7221615f)
- RDKEMW-4729: Code cleanup for window change [`9162e1c`](https://github.com/rdkcentral/rdkNativeScript/commit/9162e1cc2b8c7a19c41a7420e19f05786df4899e)

Expand All @@ -57,12 +70,12 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

- RDKEMW-3457 : WebSocket IPC [`#24`](https://github.com/rdkcentral/rdkNativeScript/pull/24)
- RDKEMW-3523:Update rdkNativeScript with application identifiers [`#20`](https://github.com/rdkcentral/rdkNativeScript/pull/20)
- Ticket Number:RDKEMW-3430: Implementing log levels [`#22`](https://github.com/rdkcentral/rdkNativeScript/pull/22)
- RDKEMW-3430: Implementing log levels [`#22`](https://github.com/rdkcentral/rdkNativeScript/pull/22)
- RDKEMW-3105 : Add ability to show network connections with details [`#18`](https://github.com/rdkcentral/rdkNativeScript/pull/18)
- Ticket Number :RDKEMW-3557:-Metrics for launchtime [`#19`](https://github.com/rdkcentral/rdkNativeScript/pull/19)
- RDKEMW-3557:-Metrics for launchtime [`#19`](https://github.com/rdkcentral/rdkNativeScript/pull/19)
- RDKEMW-2175 : Run player within jsruntime plugin via dynamic load of … [`#16`](https://github.com/rdkcentral/rdkNativeScript/pull/16)
- 3523:Update rdkNativeScript with interface API's [`60fc51b`](https://github.com/rdkcentral/rdkNativeScript/commit/60fc51b6f48272e9671bc787c68a2ce19b036e0c)
- Ticket Number:RDKEMW-3557:Metrics for launch time [`eca1c15`](https://github.com/rdkcentral/rdkNativeScript/commit/eca1c15b2e98e40156dba22696325c2c5d5fbaa5)
- RDKEMW-3557:Metrics for launch time [`eca1c15`](https://github.com/rdkcentral/rdkNativeScript/commit/eca1c15b2e98e40156dba22696325c2c5d5fbaa5)
- 1.0.1 release changelog updates [`e60bbb2`](https://github.com/rdkcentral/rdkNativeScript/commit/e60bbb2b72c74a43c34af35179d4b619fd9ac779)

#### 1.0.0
Expand Down
5 changes: 5 additions & 0 deletions include/EssosInstance.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@
#ifndef NativeJS_ESSOS_INSTANCE_H
#define NativeJS_ESSOS_INSTANCE_H

#ifdef USE_ESSOS_MOCK
#include "essos_mock.h"
#else
#include <essos.h>
#endif

#include <KeyListener.h>

class EssosInstance
Expand Down
5 changes: 5 additions & 0 deletions include/JSRuntimeClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,14 @@
**/

#pragma once

#ifdef USE_WEBSOCKET_MOCK
#include "websocketpp.hpp"
#else
#include <websocketpp/config/asio_no_tls_client.hpp>
#include <websocketpp/common/thread.hpp>
#include <websocketpp/client.hpp>
#endif

#include <string>
#include <condition_variable>
Expand Down
5 changes: 5 additions & 0 deletions include/JSRuntimeServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,13 @@

#pragma once
#include <NativeJSRenderer.h>

#ifdef USE_WEBSOCKET_MOCK
#include "websocketpp.hpp"
#else
#include <websocketpp/config/asio_no_tls.hpp>
#include <websocketpp/server.hpp>
#endif

#include <memory>
#include <mutex>
Expand Down
1 change: 1 addition & 0 deletions include/jsc/JavaScriptContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ class JavaScriptContext: public JavaScriptContextBase, public NetworkMetricsList
#ifdef ENABLE_AAMP_JSBINDINGS_DYNAMIC
void loadAAMPJSBindingsLib();
void unloadAAMPJSBindingsLib();
void *jscLibHandle = nullptr;
#endif
#endif
JSContextGroupRef mContextGroup;
Expand Down
1 change: 1 addition & 0 deletions include/jsc/JavaScriptEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include <unistd.h>
#include <errno.h>
#include <cstdint>

//#include <algorithm>
#include <string>
Expand Down
8 changes: 8 additions & 0 deletions src/JSRuntimeClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@
**/
#include <JSRuntimeClient.h>
#include <NativeJSLogger.h>

#ifdef USE_JSCLIB_MOCK
#include "jsc_lib_mock.h"
#else
#include "jsc_lib.h"
#endif

#include <iostream>
#include <sstream>
#include <thread>
Expand Down Expand Up @@ -143,6 +149,7 @@ void JSRuntimeClient::onClose(websocketpp::connection_hdl hdl)
setState("close");
}

#ifndef UNIT_TEST_BUILD
int main(int argc, char **argv)
{
std::string command;
Expand Down Expand Up @@ -178,3 +185,4 @@ int main(int argc, char **argv)

return 0;
}
#endif
5 changes: 5 additions & 0 deletions src/JSRuntimeServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@
* limitations under the License.
**/

#ifdef USE_JSCLIB_MOCK
#include "jsc_lib_mock.h"
#else
#include "jsc_lib.h"
#endif

#include <JSRuntimeServer.h>
#include <NativeJSLogger.h>
#include <iostream>
Expand Down
9 changes: 5 additions & 4 deletions src/jsc/JavaScriptContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ void JavaScriptContext::loadAAMPJSBindingsLib()
{
static const char *aampJSBindingsLib = "libaampjsbindings.so";
static const char *jscLib = "libJavaScriptCore.so";
void *jscLibHandle = dlopen(jscLib, RTLD_NOW | RTLD_GLOBAL);
jscLibHandle = dlopen(jscLib, RTLD_NOW | RTLD_GLOBAL);
if (!jscLibHandle)
{
std::cout<<"dlopen error for jsc library " << dlerror() << std::endl;
Expand All @@ -146,18 +146,17 @@ void JavaScriptContext::loadAAMPJSBindingsLib()
gAAMPJSBindings->PlayerLibHandle = aampJSBindingsLibHandle;

gAAMPJSBindings->fnLoadJS =
reinterpret_cast<typeof AAMPJSBindings::fnLoadJS>(
reinterpret_cast<decltype(AAMPJSBindings::fnLoadJS)>(
dlsym(aampJSBindingsLibHandle, "_Z17AAMPPlayer_LoadJSPv"));
gAAMPJSBindings->fnUnloadJS =
reinterpret_cast<typeof AAMPJSBindings::fnUnloadJS>(
reinterpret_cast<decltype(AAMPJSBindings::fnUnloadJS)>(
dlsym(aampJSBindingsLibHandle, "_Z19AAMPPlayer_UnloadJSPv"));
}
else
{
NativeJSLogger::log(ERROR, "failed to load %s and error is %s\n", aampJSBindingsLib, dlerror());
}

dlclose(jscLibHandle);
}
}

Expand All @@ -166,6 +165,8 @@ void JavaScriptContext::unloadAAMPJSBindingsLib()
if (nullptr != gAAMPJSBindings->PlayerLibHandle)
{
dlclose(gAAMPJSBindings->PlayerLibHandle);
dlclose(jscLibHandle);

}
}
#endif
Expand Down
6 changes: 6 additions & 0 deletions src/jsc/JavaScriptUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@
#include "JavaScriptUtils.h"
#include "JavaScriptWrapper.h"
#include "rtLog.h"

#ifdef USE_JSCLIB_MOCK
#include "jsc_lib_mock.h"
#else
#include "jsc_lib.h"
#endif

#include <unistd.h>
#include <stdio.h>
#include <errno.h>
Expand Down
5 changes: 5 additions & 0 deletions src/jsc/JavaScriptWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@
* limitations under the License.
**/

#ifdef USE_JSCLIB_MOCK
#include "jsc_lib_mock.h"
#else
#include "jsc_lib.h"
#endif

#include "JavaScriptEngine.h"
#include "JavaScriptWrapper.h"
#include <NativeJSLogger.h>
Expand Down
Loading