From d1280ed842974d0bd3b236ba0e984c4a2825a454 Mon Sep 17 00:00:00 2001 From: s30030188 Date: Sat, 9 Aug 2025 19:15:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=85=8D=E7=BD=AE=E5=9C=BA?= =?UTF-8?q?=E6=99=AF=E6=B5=8B=E8=AF=95=E6=A1=86=E6=9E=B6=E8=BF=90=E8=A1=8C?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: s30030188 --- .../ability_delegator/runner_runtime/js_test_runner.cpp | 8 +++++++- test/unittest/runtime_test/js_runtime_test.cpp | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/frameworks/native/appkit/ability_delegator/runner_runtime/js_test_runner.cpp b/frameworks/native/appkit/ability_delegator/runner_runtime/js_test_runner.cpp index ee8e444aa71..a487bb6ba12 100644 --- a/frameworks/native/appkit/ability_delegator/runner_runtime/js_test_runner.cpp +++ b/frameworks/native/appkit/ability_delegator/runner_runtime/js_test_runner.cpp @@ -23,6 +23,8 @@ namespace OHOS { namespace RunnerRuntime { +const int ABC_LENGTH = 4; + std::unique_ptr JsTestRunner::Create(const std::unique_ptr &runtime, const std::shared_ptr &args, const AppExecFwk::BundleInfo &bundleInfo, bool isFaJsModel) { @@ -240,14 +242,18 @@ void JsTestRunner::ReportStatus(const std::string &msg) std::string JsTestRunner::GetTestRunnerPath(const std::shared_ptr &args) { std::string result; + result.append(args->GetTestModuleName()); if (!args->GetTestRunnerClassName().empty()) { - result.append(args->GetTestModuleName()); if (args->GetTestRunnerClassName().find("/") == std::string::npos) { result.append(LOWERCASETESTRUNNER); } result.append(args->GetTestRunnerClassName()); } else { + result.append("/"); result.append(args->GetTestRunnerPath()); + if (result.compare(result.size() - ABC_LENGTH, ABC_LENGTH, ".ets") == 0) { + result.erase(result.size() - ABC_LENGTH); + } } return result; } diff --git a/test/unittest/runtime_test/js_runtime_test.cpp b/test/unittest/runtime_test/js_runtime_test.cpp index e3bf5fcb696..17459ad6fad 100755 --- a/test/unittest/runtime_test/js_runtime_test.cpp +++ b/test/unittest/runtime_test/js_runtime_test.cpp @@ -555,6 +555,7 @@ HWTEST_F(JsRuntimeTest, JsRuntimeStartDebugModeTest_0100, TestSize.Level2) debugOption.isDebugApp = true; debugOption.isStartWithNative = false; debugOption.isDeveloperMode = true; + debugOption.arkTSMode = "static"; jsRuntime->StartDebugMode(debugOption); EXPECT_TRUE(jsRuntime != nullptr); -- Gitee