mirror of
https://github.com/openharmony/ability_ability_runtime.git
synced 2026-08-24 12:43:16 -04:00
!15204 mac上sourcemap解析失败问题修复
Merge pull request !15204 from zhangzezhong/simulator_update_0623
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -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<AppMgrServiceInner>();
|
||||
std::string result = appMgrServiceInner->GetSpecifiedProcessFlag(abilityInfo, want);
|
||||
EXPECT_EQ(result, "");
|
||||
}
|
||||
} // namespace AppExecFwk
|
||||
} // namespace OHOS
|
||||
|
||||
Reference in New Issue
Block a user