!9472 为 cj ability delegator 添加 finishtest

Merge pull request !9472 from Luckyoranges/feature_cj_ability_delegator_finishtest
This commit is contained in:
openharmony_ci 2024-07-29 02:11:50 +00:00 committed by Gitee
commit 2ad5c0af8a
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 17 additions and 0 deletions

View File

@ -63,6 +63,11 @@ std::string CJShellCmdResult::Dump()
{
return shellCmdResultr_->Dump();
}
void CJAbilityDelegator::FinishTest(const char* msg, int64_t code)
{
delegator_->FinishUserTest(msg, code);
}
extern "C" {
int64_t FFIAbilityDelegatorRegistryGetAbilityDelegator()
@ -144,6 +149,15 @@ int32_t FFIAbilityDelegatorApplicationContext(int64_t id)
}
return appContext->GetID();
}
void FFIAbilityDelegatorFinishTest(int64_t id, const char* msg, int64_t code)
{
auto cjDelegator = FFI::FFIData::GetData<CJAbilityDelegator>(id);
if (cjDelegator == nullptr) {
TAG_LOGE(AAFwkTag::CONTEXT, "cj delegator is null.");
}
cjDelegator->FinishTest(msg, code);
}
}
}
}

View File

@ -34,6 +34,7 @@ public:
int32_t StartAbility(const AAFwk::Want& want);
std::shared_ptr<AppExecFwk::ShellCmdResult> ExecuteShellCommand(const char* cmd, int64_t timeoutSec);
std::shared_ptr<AbilityRuntime::ApplicationContext> GetAppContext();
void FinishTest(const char* msg, int64_t code);
private:
std::shared_ptr<AppExecFwk::AbilityDelegator> delegator_;
@ -58,6 +59,7 @@ CJ_EXPORT int32_t FFIGetExitCode(int64_t id);
CJ_EXPORT const char* FFIGetStdResult(int64_t id);
CJ_EXPORT const char* FFIDump(int64_t id);
CJ_EXPORT int32_t FFIAbilityDelegatorApplicationContext(int64_t id);
CJ_EXPORT void FFIAbilityDelegatorFinishTest(int64_t id, const char* msg, int64_t code);
};
}
}

View File

@ -39,6 +39,7 @@ int FFIGetExitCode();
int FFIGetStdResult();
int FFIDump();
int FFIAbilityDelegatorApplicationContext();
int FFIAbilityDelegatorFinishTest();
struct AbilityContextBroker {
int64_t isAbilityContextExisted = 1;