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