From f303d646693038ed267252c9b1e205edf179f916 Mon Sep 17 00:00:00 2001 From: zhangzezhong Date: Mon, 23 Jun 2025 21:07:44 +0800 Subject: [PATCH] =?UTF-8?q?mac=E4=B8=8Asourcemap=E8=A7=A3=E6=9E=90?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangzezhong --- .../ability_simulator/src/simulator.cpp | 5 +++++ .../app_mgr_service_inner_test.cpp | 22 +++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/frameworks/simulator/ability_simulator/src/simulator.cpp b/frameworks/simulator/ability_simulator/src/simulator.cpp index a71f886e92..b51897b253 100644 --- a/frameworks/simulator/ability_simulator/src/simulator.cpp +++ b/frameworks/simulator/ability_simulator/src/simulator.cpp @@ -766,10 +766,15 @@ panda::ecmascript::EcmaVM *SimulatorImpl::CreateJSVM() std::string SimulatorImpl::ReadSourceMap() { std::string normalizedPath = options_.modulePath; + TAG_LOGD(AAFwkTag::ABILITY_SIM, "modulePath:%{public}s", normalizedPath.c_str()); std::replace(normalizedPath.begin(), normalizedPath.end(), '\\', '/'); auto sourceMapPath = std::regex_replace(normalizedPath, std::regex(MERGE_ABC_PATH), SOURCE_MAPS_PATH); + TAG_LOGD(AAFwkTag::ABILITY_SIM, "is mac sourceMapPath:%{public}s", sourceMapPath.c_str()); +#if defined(WINDOWS_PLATFORM) std::replace(sourceMapPath.begin(), sourceMapPath.end(), '/', '\\'); + TAG_LOGD(AAFwkTag::ABILITY_SIM, "is windows sourceMapPath:%{public}s", sourceMapPath.c_str()); +#endif std::ifstream stream(sourceMapPath, std::ios::ate | std::ios::binary); if (!stream.is_open()) { TAG_LOGE(AAFwkTag::ABILITY_SIM, "open:%{public}s failed", sourceMapPath.c_str()); diff --git a/test/unittest/app_mgr_service_inner_test/app_mgr_service_inner_test.cpp b/test/unittest/app_mgr_service_inner_test/app_mgr_service_inner_test.cpp index f4d394c21a..00b87dd64d 100644 --- a/test/unittest/app_mgr_service_inner_test/app_mgr_service_inner_test.cpp +++ b/test/unittest/app_mgr_service_inner_test/app_mgr_service_inner_test.cpp @@ -5894,5 +5894,27 @@ HWTEST_F(AppMgrServiceInnerTest, GetSpecifiedProcessFlag_0002, TestSize.Level1) std::string result = appMgrServiceInner->GetSpecifiedProcessFlag(abilityInfo, want); EXPECT_EQ(result, ""); } + +/** + * @tc.name: GetSpecifiedProcessFlag_0003 + * @tc.desc: Verify that GetSpecifiedProcessFlag returns an empty string when the flag is set in the want but + * AbilityInfo does not meet the conditions. + * @tc.type: FUNC + */ +HWTEST_F(AppMgrServiceInnerTest, GetSpecifiedProcessFlag_0003, TestSize.Level1) +{ + AbilityInfo abilityInfo; + abilityInfo.type = AbilityType::PAGE; + abilityInfo.isStageBasedModel = false; + abilityInfo.isolationProcess = false; + abilityInfo.extensionAbilityType = ExtensionAbilityType::UNSPECIFIED; + AAFwk::Want want; + std::string flag = "uiext_flag"; + want.SetParam("ohoSpecifiedProcessFlag", flag); + + auto appMgrServiceInner = std::make_shared(); + std::string result = appMgrServiceInner->GetSpecifiedProcessFlag(abilityInfo, want); + EXPECT_EQ(result, ""); +} } // namespace AppExecFwk } // namespace OHOS