mirror of
https://gitee.com/openharmony/ability_ability_runtime
synced 2024-11-30 10:52:57 +00:00
commit
1dba75251a
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
#include "ability_manager_errors.h"
|
#include "ability_manager_errors.h"
|
||||||
#include "ability_manager_radar.h"
|
#include "ability_manager_radar.h"
|
||||||
|
#include "fd_guard.h"
|
||||||
#include "hilog_tag_wrapper.h"
|
#include "hilog_tag_wrapper.h"
|
||||||
#include "hitrace_meter.h"
|
#include "hitrace_meter.h"
|
||||||
#include "status_bar_delegate_interface.h"
|
#include "status_bar_delegate_interface.h"
|
||||||
@ -980,7 +981,7 @@ int32_t AbilityManagerStub::TerminateUIServiceExtensionAbilityInner(MessageParce
|
|||||||
if (data.ReadBool()) {
|
if (data.ReadBool()) {
|
||||||
token = data.ReadRemoteObject();
|
token = data.ReadRemoteObject();
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t result = TerminateUIServiceExtensionAbility(token);
|
int32_t result = TerminateUIServiceExtensionAbility(token);
|
||||||
reply.WriteInt32(result);
|
reply.WriteInt32(result);
|
||||||
return NO_ERROR;
|
return NO_ERROR;
|
||||||
@ -3699,8 +3700,8 @@ int32_t AbilityManagerStub::OpenFileInner(MessageParcel &data, MessageParcel &re
|
|||||||
return ERR_DEAD_OBJECT;
|
return ERR_DEAD_OBJECT;
|
||||||
}
|
}
|
||||||
auto flag = data.ReadInt32();
|
auto flag = data.ReadInt32();
|
||||||
int fd = OpenFile(*uri, flag);
|
FdGuard fdGuard(OpenFile(*uri, flag));
|
||||||
reply.WriteFileDescriptor(fd);
|
reply.WriteFileDescriptor(fdGuard.Get());
|
||||||
return ERR_OK;
|
return ERR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,6 +51,7 @@
|
|||||||
#include "cpp/mutex.h"
|
#include "cpp/mutex.h"
|
||||||
#include "event_report.h"
|
#include "event_report.h"
|
||||||
#include "fault_data.h"
|
#include "fault_data.h"
|
||||||
|
#include "fd_guard.h"
|
||||||
#include "hisysevent.h"
|
#include "hisysevent.h"
|
||||||
#include "iapp_state_callback.h"
|
#include "iapp_state_callback.h"
|
||||||
#include "iapplication_state_observer.h"
|
#include "iapplication_state_observer.h"
|
||||||
@ -81,6 +82,7 @@ class FocusChangeInfo;
|
|||||||
}
|
}
|
||||||
namespace AppExecFwk {
|
namespace AppExecFwk {
|
||||||
using OHOS::AAFwk::Want;
|
using OHOS::AAFwk::Want;
|
||||||
|
using AAFwk::FdGuard;
|
||||||
class WindowFocusChangedListener;
|
class WindowFocusChangedListener;
|
||||||
class WindowVisibilityChangedListener;
|
class WindowVisibilityChangedListener;
|
||||||
class WindowPidVisibilityChangedListener;
|
class WindowPidVisibilityChangedListener;
|
||||||
@ -830,8 +832,8 @@ public:
|
|||||||
|
|
||||||
virtual int32_t StartRenderProcess(const pid_t hostPid,
|
virtual int32_t StartRenderProcess(const pid_t hostPid,
|
||||||
const std::string &renderParam,
|
const std::string &renderParam,
|
||||||
int32_t ipcFd, int32_t sharedFd,
|
FdGuard &&ipcFd, FdGuard &&sharedFd,
|
||||||
int32_t crashFd, pid_t &renderPid, bool isGPU = false);
|
FdGuard &&crashFd, pid_t &renderPid, bool isGPU = false);
|
||||||
|
|
||||||
virtual void AttachRenderProcess(const pid_t pid, const sptr<IRenderScheduler> &scheduler);
|
virtual void AttachRenderProcess(const pid_t pid, const sptr<IRenderScheduler> &scheduler);
|
||||||
|
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
#include "app_record_id.h"
|
#include "app_record_id.h"
|
||||||
#include "child_process_record.h"
|
#include "child_process_record.h"
|
||||||
#include "fault_data.h"
|
#include "fault_data.h"
|
||||||
|
#include "fd_guard.h"
|
||||||
#include "profile.h"
|
#include "profile.h"
|
||||||
#include "priority_object.h"
|
#include "priority_object.h"
|
||||||
#include "app_lifecycle_deal.h"
|
#include "app_lifecycle_deal.h"
|
||||||
@ -50,6 +51,7 @@ namespace Rosen {
|
|||||||
class WindowVisibilityInfo;
|
class WindowVisibilityInfo;
|
||||||
}
|
}
|
||||||
namespace AppExecFwk {
|
namespace AppExecFwk {
|
||||||
|
using AAFwk::FdGuard;
|
||||||
class AbilityRunningRecord;
|
class AbilityRunningRecord;
|
||||||
class AppMgrServiceInner;
|
class AppMgrServiceInner;
|
||||||
class AppRunningRecord;
|
class AppRunningRecord;
|
||||||
@ -71,15 +73,15 @@ private:
|
|||||||
*/
|
*/
|
||||||
class RenderRecord {
|
class RenderRecord {
|
||||||
public:
|
public:
|
||||||
RenderRecord(pid_t hostPid, const std::string &renderParam, int32_t ipcFd,
|
RenderRecord(pid_t hostPid, const std::string &renderParam,
|
||||||
int32_t sharedFd, int32_t crashFd,
|
FdGuard &&ipcFd, FdGuard &&sharedFd, FdGuard &&crashFd,
|
||||||
const std::shared_ptr<AppRunningRecord> &host);
|
const std::shared_ptr<AppRunningRecord> &host);
|
||||||
|
|
||||||
virtual ~RenderRecord();
|
virtual ~RenderRecord();
|
||||||
|
|
||||||
static std::shared_ptr<RenderRecord>
|
static std::shared_ptr<RenderRecord>
|
||||||
CreateRenderRecord(pid_t hostPid, const std::string &renderParam,
|
CreateRenderRecord(pid_t hostPid, const std::string &renderParam,
|
||||||
int32_t ipcFd, int32_t sharedFd, int32_t crashFd,
|
FdGuard &&ipcFd, FdGuard &&sharedFd, FdGuard &&crashFd,
|
||||||
const std::shared_ptr<AppRunningRecord> &host);
|
const std::shared_ptr<AppRunningRecord> &host);
|
||||||
|
|
||||||
void SetPid(pid_t pid);
|
void SetPid(pid_t pid);
|
||||||
@ -116,9 +118,9 @@ private:
|
|||||||
std::string hostBundleName_;
|
std::string hostBundleName_;
|
||||||
std::string renderParam_;
|
std::string renderParam_;
|
||||||
std::string processName_;
|
std::string processName_;
|
||||||
int32_t ipcFd_ = 0;
|
FdGuard ipcFd_;
|
||||||
int32_t sharedFd_ = 0;
|
FdGuard sharedFd_;
|
||||||
int32_t crashFd_ = 0;
|
FdGuard crashFd_;
|
||||||
int32_t state_ = 0;
|
int32_t state_ = 0;
|
||||||
ProcessType processType_ = ProcessType::RENDER;
|
ProcessType processType_ = ProcessType::RENDER;
|
||||||
std::weak_ptr<AppRunningRecord> host_; // nweb host
|
std::weak_ptr<AppRunningRecord> host_; // nweb host
|
||||||
|
@ -78,7 +78,6 @@ private:
|
|||||||
std::string processName_;
|
std::string processName_;
|
||||||
std::string srcEntry_;
|
std::string srcEntry_;
|
||||||
std::string entryFunc_;
|
std::string entryFunc_;
|
||||||
std::map<std::string, int32_t> fds_;
|
|
||||||
std::weak_ptr<AppRunningRecord> hostRecord_;
|
std::weak_ptr<AppRunningRecord> hostRecord_;
|
||||||
sptr<IChildScheduler> scheduler_ = nullptr;
|
sptr<IChildScheduler> scheduler_ = nullptr;
|
||||||
sptr<AppDeathRecipient> deathRecipient_ = nullptr;
|
sptr<AppDeathRecipient> deathRecipient_ = nullptr;
|
||||||
|
@ -983,14 +983,8 @@ int32_t AppMgrService::StartRenderProcess(const std::string &renderParam, int32_
|
|||||||
return ERR_INVALID_OPERATION;
|
return ERR_INVALID_OPERATION;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto result = appMgrServiceInner_->StartRenderProcess(IPCSkeleton::GetCallingPid(),
|
return appMgrServiceInner_->StartRenderProcess(IPCSkeleton::GetCallingPid(), renderParam,
|
||||||
renderParam, ipcFd, sharedFd, crashFd, renderPid, isGPU);
|
std::move(ipcFdGuard), std::move(sharedFdGuard), std::move(crashFdGuard), renderPid, isGPU);
|
||||||
if (result == ERR_OK) {
|
|
||||||
ipcFdGuard.Release();
|
|
||||||
sharedFdGuard.Release();
|
|
||||||
crashFdGuard.Release();
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AppMgrService::AttachRenderProcess(const sptr<IRemoteObject> &scheduler)
|
void AppMgrService::AttachRenderProcess(const sptr<IRemoteObject> &scheduler)
|
||||||
@ -1396,13 +1390,7 @@ int32_t AppMgrService::StartChildProcess(pid_t &childPid, const ChildProcessRequ
|
|||||||
return ERR_INVALID_OPERATION;
|
return ERR_INVALID_OPERATION;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto result = appMgrServiceInner_->StartChildProcess(IPCSkeleton::GetCallingPid(), childPid, request);
|
return appMgrServiceInner_->StartChildProcess(IPCSkeleton::GetCallingPid(), childPid, request);
|
||||||
if (result == ERR_OK) {
|
|
||||||
for (auto &fd : fds) {
|
|
||||||
fd.Release();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t AppMgrService::GetChildProcessInfoForSelf(ChildProcessInfo &info)
|
int32_t AppMgrService::GetChildProcessInfoForSelf(ChildProcessInfo &info)
|
||||||
|
@ -5189,13 +5189,13 @@ int AppMgrServiceInner::PreStartNWebSpawnProcess(const pid_t hostPid)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int AppMgrServiceInner::StartRenderProcess(const pid_t hostPid, const std::string &renderParam,
|
int AppMgrServiceInner::StartRenderProcess(const pid_t hostPid, const std::string &renderParam,
|
||||||
int32_t ipcFd, int32_t sharedFd, int32_t crashFd, pid_t &renderPid, bool isGPU)
|
FdGuard &&ipcFd, FdGuard &&sharedFd, FdGuard &&crashFd, pid_t &renderPid, bool isGPU)
|
||||||
{
|
{
|
||||||
TAG_LOGI(AAFwkTag::APPMGR, "hostPid:%{public}d", hostPid);
|
TAG_LOGI(AAFwkTag::APPMGR, "hostPid:%{public}d", hostPid);
|
||||||
if (hostPid <= 0 || renderParam.empty() || ipcFd <= 0 || sharedFd <= 0 || crashFd <= 0) {
|
if (hostPid <= 0 || renderParam.empty() || ipcFd.Get() <= 0 || sharedFd.Get() <= 0 || crashFd.Get() <= 0) {
|
||||||
TAG_LOGE(AAFwkTag::APPMGR, "invalid param: hostPid:%{public}d renderParam:%{private}s "
|
TAG_LOGE(AAFwkTag::APPMGR, "invalid param: hostPid:%{public}d renderParam:%{private}s "
|
||||||
"ipcFd:%{public}d crashFd:%{public}d sharedFd:%{public}d",
|
"ipcFd:%{public}d crashFd:%{public}d sharedFd:%{public}d",
|
||||||
hostPid, renderParam.c_str(), ipcFd, crashFd, sharedFd);
|
hostPid, renderParam.c_str(), ipcFd.Get(), crashFd.Get(), sharedFd.Get());
|
||||||
return ERR_INVALID_VALUE;
|
return ERR_INVALID_VALUE;
|
||||||
}
|
}
|
||||||
CHECK_POINTER_AND_RETURN_VALUE(appRunningManager_, ERR_INVALID_VALUE);
|
CHECK_POINTER_AND_RETURN_VALUE(appRunningManager_, ERR_INVALID_VALUE);
|
||||||
@ -5232,7 +5232,8 @@ int AppMgrServiceInner::StartRenderProcess(const pid_t hostPid, const std::strin
|
|||||||
return ERR_REACHING_MAXIMUM_RENDER_PROCESS_LIMITATION;
|
return ERR_REACHING_MAXIMUM_RENDER_PROCESS_LIMITATION;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto renderRecord = RenderRecord::CreateRenderRecord(hostPid, renderParam, ipcFd, sharedFd, crashFd, appRecord);
|
auto renderRecord = RenderRecord::CreateRenderRecord(hostPid, renderParam,
|
||||||
|
std::move(ipcFd), std::move(sharedFd), std::move(crashFd), appRecord);
|
||||||
if (!renderRecord) {
|
if (!renderRecord) {
|
||||||
TAG_LOGE(AAFwkTag::APPMGR, "create renderRecord fail, hostPid:%{public}d", hostPid);
|
TAG_LOGE(AAFwkTag::APPMGR, "create renderRecord fail, hostPid:%{public}d", hostPid);
|
||||||
return ERR_INVALID_VALUE;
|
return ERR_INVALID_VALUE;
|
||||||
|
@ -48,30 +48,26 @@ constexpr const char *EVENT_KEY_SUPPORT_STATE = "SUPPORT_STATE";
|
|||||||
int64_t AppRunningRecord::appEventId_ = 0;
|
int64_t AppRunningRecord::appEventId_ = 0;
|
||||||
|
|
||||||
RenderRecord::RenderRecord(pid_t hostPid, const std::string &renderParam,
|
RenderRecord::RenderRecord(pid_t hostPid, const std::string &renderParam,
|
||||||
int32_t ipcFd, int32_t sharedFd, int32_t crashFd,
|
FdGuard &&ipcFd, FdGuard &&sharedFd, FdGuard &&crashFd,
|
||||||
const std::shared_ptr<AppRunningRecord> &host)
|
const std::shared_ptr<AppRunningRecord> &host)
|
||||||
: hostPid_(hostPid), renderParam_(renderParam), ipcFd_(ipcFd),
|
: hostPid_(hostPid), renderParam_(renderParam), ipcFd_(std::move(ipcFd)),
|
||||||
sharedFd_(sharedFd), crashFd_(crashFd), host_(host) {}
|
sharedFd_(std::move(sharedFd)), crashFd_(std::move(crashFd)), host_(host) {}
|
||||||
|
|
||||||
RenderRecord::~RenderRecord()
|
RenderRecord::~RenderRecord()
|
||||||
{
|
{}
|
||||||
close(sharedFd_);
|
|
||||||
close(ipcFd_);
|
|
||||||
close(crashFd_);
|
|
||||||
}
|
|
||||||
|
|
||||||
std::shared_ptr<RenderRecord> RenderRecord::CreateRenderRecord(
|
std::shared_ptr<RenderRecord> RenderRecord::CreateRenderRecord(
|
||||||
pid_t hostPid, const std::string &renderParam, int32_t ipcFd,
|
pid_t hostPid, const std::string &renderParam,
|
||||||
int32_t sharedFd, int32_t crashFd,
|
FdGuard &&ipcFd, FdGuard &&sharedFd, FdGuard &&crashFd,
|
||||||
const std::shared_ptr<AppRunningRecord> &host)
|
const std::shared_ptr<AppRunningRecord> &host)
|
||||||
{
|
{
|
||||||
if (hostPid <= 0 || renderParam.empty() || ipcFd <= 0 || sharedFd <= 0 ||
|
if (hostPid <= 0 || renderParam.empty() || ipcFd.Get() <= 0 || sharedFd.Get() <= 0 ||
|
||||||
crashFd <= 0 || !host) {
|
crashFd.Get() <= 0 || !host) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto renderRecord = std::make_shared<RenderRecord>(
|
auto renderRecord = std::make_shared<RenderRecord>(
|
||||||
hostPid, renderParam, ipcFd, sharedFd, crashFd, host);
|
hostPid, renderParam, std::move(ipcFd), std::move(sharedFd), std::move(crashFd), host);
|
||||||
renderRecord->SetHostUid(host->GetUid());
|
renderRecord->SetHostUid(host->GetUid());
|
||||||
renderRecord->SetHostBundleName(host->GetBundleName());
|
renderRecord->SetHostBundleName(host->GetBundleName());
|
||||||
renderRecord->SetProcessName(host->GetProcessName());
|
renderRecord->SetProcessName(host->GetProcessName());
|
||||||
@ -140,17 +136,17 @@ std::string RenderRecord::GetRenderParam() const
|
|||||||
|
|
||||||
int32_t RenderRecord::GetIpcFd() const
|
int32_t RenderRecord::GetIpcFd() const
|
||||||
{
|
{
|
||||||
return ipcFd_;
|
return ipcFd_.Get();
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t RenderRecord::GetSharedFd() const
|
int32_t RenderRecord::GetSharedFd() const
|
||||||
{
|
{
|
||||||
return sharedFd_;
|
return sharedFd_.Get();
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t RenderRecord::GetCrashFd() const
|
int32_t RenderRecord::GetCrashFd() const
|
||||||
{
|
{
|
||||||
return crashFd_;
|
return crashFd_.Get();
|
||||||
}
|
}
|
||||||
|
|
||||||
ProcessType RenderRecord::GetProcessType() const
|
ProcessType RenderRecord::GetProcessType() const
|
||||||
|
@ -27,7 +27,6 @@ ChildProcessRecord::ChildProcessRecord(pid_t hostPid, const ChildProcessRequest
|
|||||||
hostRecord_(hostRecord), isStartWithDebug_(request.isStartWithDebug)
|
hostRecord_(hostRecord), isStartWithDebug_(request.isStartWithDebug)
|
||||||
{
|
{
|
||||||
srcEntry_ = request.srcEntry;
|
srcEntry_ = request.srcEntry;
|
||||||
fds_ = request.args.fds;
|
|
||||||
if (childProcessType_ == CHILD_PROCESS_TYPE_NATIVE_ARGS) {
|
if (childProcessType_ == CHILD_PROCESS_TYPE_NATIVE_ARGS) {
|
||||||
auto pos = request.srcEntry.rfind(":");
|
auto pos = request.srcEntry.rfind(":");
|
||||||
if (pos != std::string::npos) {
|
if (pos != std::string::npos) {
|
||||||
@ -50,9 +49,6 @@ ChildProcessRecord::ChildProcessRecord(pid_t hostPid, const std::string &libName
|
|||||||
ChildProcessRecord::~ChildProcessRecord()
|
ChildProcessRecord::~ChildProcessRecord()
|
||||||
{
|
{
|
||||||
TAG_LOGD(AAFwkTag::APPMGR, "called");
|
TAG_LOGD(AAFwkTag::APPMGR, "called");
|
||||||
for (const auto &item : fds_) {
|
|
||||||
close(item.second);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<ChildProcessRecord> ChildProcessRecord::CreateChildProcessRecord(pid_t hostPid,
|
std::shared_ptr<ChildProcessRecord> ChildProcessRecord::CreateChildProcessRecord(pid_t hostPid,
|
||||||
@ -194,7 +190,7 @@ void ChildProcessRecord::MakeProcessName(const std::shared_ptr<AppRunningRecord>
|
|||||||
if (childProcessType_ == CHILD_PROCESS_TYPE_NATIVE || childProcessType_ == CHILD_PROCESS_TYPE_NATIVE_ARGS) {
|
if (childProcessType_ == CHILD_PROCESS_TYPE_NATIVE || childProcessType_ == CHILD_PROCESS_TYPE_NATIVE_ARGS) {
|
||||||
processName_.append("Native_");
|
processName_.append("Native_");
|
||||||
}
|
}
|
||||||
|
|
||||||
processName_.append(filename);
|
processName_.append(filename);
|
||||||
}
|
}
|
||||||
processName_.append(std::to_string(childProcessCount_));
|
processName_.append(std::to_string(childProcessCount_));
|
||||||
|
@ -47,7 +47,7 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t GetFd() const
|
int32_t Get() const
|
||||||
{
|
{
|
||||||
return fd_;
|
return fd_;
|
||||||
}
|
}
|
||||||
|
@ -449,8 +449,8 @@ HWTEST_F(AmsAppRunningRecordTest, GetRenderRecordByPid_002, TestSize.Level1)
|
|||||||
int32_t sharedFd = 1;
|
int32_t sharedFd = 1;
|
||||||
int32_t crashFd = 1;
|
int32_t crashFd = 1;
|
||||||
std::shared_ptr<AppRunningRecord> host;
|
std::shared_ptr<AppRunningRecord> host;
|
||||||
std::shared_ptr<RenderRecord> renderRecord =
|
std::shared_ptr<RenderRecord> renderRecord = RenderRecord::CreateRenderRecord(hostPid, renderParam,
|
||||||
RenderRecord::CreateRenderRecord(hostPid, renderParam, ipcFd, sharedFd, crashFd, host);
|
FdGuard(ipcFd), FdGuard(sharedFd), FdGuard(crashFd), host);
|
||||||
EXPECT_NE(appRunningRecord, nullptr);
|
EXPECT_NE(appRunningRecord, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1927,7 +1927,7 @@ HWTEST_F(AmsAppRunningRecordTest, NewRenderRecord_001, TestSize.Level1)
|
|||||||
int32_t crashFd = 0;
|
int32_t crashFd = 0;
|
||||||
std::shared_ptr<AppRunningRecord> host;
|
std::shared_ptr<AppRunningRecord> host;
|
||||||
RenderRecord *renderRecord =
|
RenderRecord *renderRecord =
|
||||||
new RenderRecord(hostPid, renderParam, ipcFd, sharedFd, crashFd, host);
|
new RenderRecord(hostPid, renderParam, FdGuard(ipcFd), FdGuard(sharedFd), FdGuard(crashFd), host);
|
||||||
EXPECT_NE(renderRecord, nullptr);
|
EXPECT_NE(renderRecord, nullptr);
|
||||||
delete renderRecord;
|
delete renderRecord;
|
||||||
}
|
}
|
||||||
@ -1960,17 +1960,21 @@ HWTEST_F(AmsAppRunningRecordTest, CreateRenderRecord_001, TestSize.Level1)
|
|||||||
std::string processName = "processName";
|
std::string processName = "processName";
|
||||||
std::shared_ptr<AppRunningRecord> host1 = GetTestAppRunningRecord();
|
std::shared_ptr<AppRunningRecord> host1 = GetTestAppRunningRecord();
|
||||||
|
|
||||||
std::shared_ptr<RenderRecord> renderRecord =
|
std::shared_ptr<RenderRecord> renderRecord = RenderRecord::CreateRenderRecord(hostPid, renderParam,
|
||||||
RenderRecord::CreateRenderRecord(hostPid, renderParam, ipcFd, sharedFd, crashFd, host);
|
FdGuard(ipcFd), FdGuard(sharedFd), FdGuard(crashFd), host);
|
||||||
EXPECT_EQ(renderRecord, nullptr);
|
EXPECT_EQ(renderRecord, nullptr);
|
||||||
|
|
||||||
renderRecord = RenderRecord::CreateRenderRecord(hostPid1, renderParam, ipcFd, sharedFd, crashFd, host);
|
renderRecord = RenderRecord::CreateRenderRecord(hostPid1, renderParam,
|
||||||
|
FdGuard(ipcFd), FdGuard(sharedFd), FdGuard(crashFd), host);
|
||||||
EXPECT_EQ(renderRecord, nullptr);
|
EXPECT_EQ(renderRecord, nullptr);
|
||||||
renderRecord = RenderRecord::CreateRenderRecord(hostPid1, renderParam1, ipcFd, sharedFd, crashFd, host);
|
renderRecord = RenderRecord::CreateRenderRecord(hostPid1, renderParam1,
|
||||||
|
FdGuard(ipcFd), FdGuard(sharedFd), FdGuard(crashFd), host);
|
||||||
EXPECT_EQ(renderRecord, nullptr);
|
EXPECT_EQ(renderRecord, nullptr);
|
||||||
renderRecord = RenderRecord::CreateRenderRecord(hostPid1, renderParam1, ipcFd1, sharedFd, crashFd, host);
|
renderRecord = RenderRecord::CreateRenderRecord(hostPid1, renderParam1,
|
||||||
|
FdGuard(ipcFd1), FdGuard(sharedFd), FdGuard(crashFd), host);
|
||||||
EXPECT_EQ(renderRecord, nullptr);
|
EXPECT_EQ(renderRecord, nullptr);
|
||||||
renderRecord = RenderRecord::CreateRenderRecord(hostPid1, renderParam1, ipcFd1, sharedFd1, crashFd, host);
|
renderRecord = RenderRecord::CreateRenderRecord(hostPid1, renderParam1,
|
||||||
|
FdGuard(ipcFd1), FdGuard(sharedFd1), FdGuard(crashFd), host);
|
||||||
EXPECT_EQ(renderRecord, nullptr);
|
EXPECT_EQ(renderRecord, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1988,7 +1992,7 @@ HWTEST_F(AmsAppRunningRecordTest, SetPid_001, TestSize.Level1)
|
|||||||
std::string renderParam = "test_render_param";
|
std::string renderParam = "test_render_param";
|
||||||
std::shared_ptr<AppRunningRecord> host;
|
std::shared_ptr<AppRunningRecord> host;
|
||||||
RenderRecord* renderRecord =
|
RenderRecord* renderRecord =
|
||||||
new RenderRecord(hostPid, renderParam, 0, 0, 0, host);
|
new RenderRecord(hostPid, renderParam, FdGuard(0), FdGuard(0), FdGuard(0), host);
|
||||||
EXPECT_NE(renderRecord, nullptr);
|
EXPECT_NE(renderRecord, nullptr);
|
||||||
pid_t pid = 0;
|
pid_t pid = 0;
|
||||||
renderRecord->SetPid(pid);
|
renderRecord->SetPid(pid);
|
||||||
@ -2009,7 +2013,7 @@ HWTEST_F(AmsAppRunningRecordTest, GetHostPid_001, TestSize.Level1)
|
|||||||
std::string renderParam = "test_render_param";
|
std::string renderParam = "test_render_param";
|
||||||
std::shared_ptr<AppRunningRecord> host;
|
std::shared_ptr<AppRunningRecord> host;
|
||||||
RenderRecord* renderRecord =
|
RenderRecord* renderRecord =
|
||||||
new RenderRecord(hostPid, renderParam, 1, 0, 0, host);
|
new RenderRecord(hostPid, renderParam, FdGuard(1), FdGuard(0), FdGuard(0), host);
|
||||||
EXPECT_NE(renderRecord, nullptr);
|
EXPECT_NE(renderRecord, nullptr);
|
||||||
EXPECT_EQ(renderRecord->GetHostPid(), hostPid);
|
EXPECT_EQ(renderRecord->GetHostPid(), hostPid);
|
||||||
}
|
}
|
||||||
@ -2028,7 +2032,7 @@ HWTEST_F(AmsAppRunningRecordTest, SetUid_001, TestSize.Level1)
|
|||||||
std::string renderParam = "test_render_param";
|
std::string renderParam = "test_render_param";
|
||||||
std::shared_ptr<AppRunningRecord> host;
|
std::shared_ptr<AppRunningRecord> host;
|
||||||
RenderRecord* renderRecord =
|
RenderRecord* renderRecord =
|
||||||
new RenderRecord(hostPid, renderParam, 0, 0, 0, host);
|
new RenderRecord(hostPid, renderParam, FdGuard(0), FdGuard(0), FdGuard(0), host);
|
||||||
EXPECT_NE(renderRecord, nullptr);
|
EXPECT_NE(renderRecord, nullptr);
|
||||||
int32_t uid = 1;
|
int32_t uid = 1;
|
||||||
renderRecord->SetUid(uid);
|
renderRecord->SetUid(uid);
|
||||||
@ -2049,7 +2053,7 @@ HWTEST_F(AmsAppRunningRecordTest, SetHostUid_001, TestSize.Level1)
|
|||||||
std::string renderParam = "test_render_param";
|
std::string renderParam = "test_render_param";
|
||||||
std::shared_ptr<AppRunningRecord> host;
|
std::shared_ptr<AppRunningRecord> host;
|
||||||
RenderRecord* renderRecord =
|
RenderRecord* renderRecord =
|
||||||
new RenderRecord(hostPid, renderParam, 0, 0, 0, host);
|
new RenderRecord(hostPid, renderParam, FdGuard(0), FdGuard(0), FdGuard(0), host);
|
||||||
EXPECT_NE(renderRecord, nullptr);
|
EXPECT_NE(renderRecord, nullptr);
|
||||||
int32_t uid = 1;
|
int32_t uid = 1;
|
||||||
renderRecord->SetHostUid(uid);
|
renderRecord->SetHostUid(uid);
|
||||||
@ -2070,7 +2074,7 @@ HWTEST_F(AmsAppRunningRecordTest, SetHostBundleName_001, TestSize.Level1)
|
|||||||
std::string renderParam = "test_render_param";
|
std::string renderParam = "test_render_param";
|
||||||
std::shared_ptr<AppRunningRecord> host;
|
std::shared_ptr<AppRunningRecord> host;
|
||||||
RenderRecord* renderRecord =
|
RenderRecord* renderRecord =
|
||||||
new RenderRecord(hostPid, renderParam, 0, 0, 0, host);
|
new RenderRecord(hostPid, renderParam, FdGuard(0), FdGuard(0), FdGuard(0), host);
|
||||||
EXPECT_NE(renderRecord, nullptr);
|
EXPECT_NE(renderRecord, nullptr);
|
||||||
std::string hostBundleName = "testhostBundleName";
|
std::string hostBundleName = "testhostBundleName";
|
||||||
renderRecord->SetHostBundleName(hostBundleName);
|
renderRecord->SetHostBundleName(hostBundleName);
|
||||||
@ -2091,7 +2095,7 @@ HWTEST_F(AmsAppRunningRecordTest, SetProcessName_001, TestSize.Level1)
|
|||||||
std::string renderParam = "test_render_param";
|
std::string renderParam = "test_render_param";
|
||||||
std::shared_ptr<AppRunningRecord> host;
|
std::shared_ptr<AppRunningRecord> host;
|
||||||
RenderRecord* renderRecord =
|
RenderRecord* renderRecord =
|
||||||
new RenderRecord(hostPid, renderParam, 0, 0, 0, host);
|
new RenderRecord(hostPid, renderParam, FdGuard(0), FdGuard(0), FdGuard(0), host);
|
||||||
EXPECT_NE(renderRecord, nullptr);
|
EXPECT_NE(renderRecord, nullptr);
|
||||||
std::string hostProcessName = "testhostProcessName";
|
std::string hostProcessName = "testhostProcessName";
|
||||||
renderRecord->SetProcessName(hostProcessName);
|
renderRecord->SetProcessName(hostProcessName);
|
||||||
@ -2112,7 +2116,7 @@ HWTEST_F(AmsAppRunningRecordTest, GetRenderParam_001, TestSize.Level1)
|
|||||||
std::string renderParam = "test_render_param";
|
std::string renderParam = "test_render_param";
|
||||||
std::shared_ptr<AppRunningRecord> host;
|
std::shared_ptr<AppRunningRecord> host;
|
||||||
RenderRecord* renderRecord =
|
RenderRecord* renderRecord =
|
||||||
new RenderRecord(hostPid, renderParam, 0, 0, 0, host);
|
new RenderRecord(hostPid, renderParam, FdGuard(0), FdGuard(0), FdGuard(0), host);
|
||||||
EXPECT_NE(renderRecord, nullptr);
|
EXPECT_NE(renderRecord, nullptr);
|
||||||
EXPECT_EQ(renderRecord->GetRenderParam(), renderParam);
|
EXPECT_EQ(renderRecord->GetRenderParam(), renderParam);
|
||||||
}
|
}
|
||||||
@ -2131,7 +2135,7 @@ HWTEST_F(AmsAppRunningRecordTest, GetIpcFd_001, TestSize.Level1)
|
|||||||
std::string renderParam = "test_render_param";
|
std::string renderParam = "test_render_param";
|
||||||
std::shared_ptr<AppRunningRecord> host;
|
std::shared_ptr<AppRunningRecord> host;
|
||||||
RenderRecord* renderRecord =
|
RenderRecord* renderRecord =
|
||||||
new RenderRecord(hostPid, renderParam, 1, 0, 0, host);
|
new RenderRecord(hostPid, renderParam, FdGuard(1), FdGuard(0), FdGuard(0), host);
|
||||||
EXPECT_NE(renderRecord, nullptr);
|
EXPECT_NE(renderRecord, nullptr);
|
||||||
EXPECT_EQ(renderRecord->GetIpcFd(), 1);
|
EXPECT_EQ(renderRecord->GetIpcFd(), 1);
|
||||||
}
|
}
|
||||||
@ -2150,7 +2154,7 @@ HWTEST_F(AmsAppRunningRecordTest, GetSharedFd_001, TestSize.Level1)
|
|||||||
std::string renderParam = "test_render_param";
|
std::string renderParam = "test_render_param";
|
||||||
std::shared_ptr<AppRunningRecord> host;
|
std::shared_ptr<AppRunningRecord> host;
|
||||||
RenderRecord* renderRecord =
|
RenderRecord* renderRecord =
|
||||||
new RenderRecord(hostPid, renderParam, 0, 1, 0, host);
|
new RenderRecord(hostPid, renderParam, FdGuard(0), FdGuard(1), FdGuard(0), host);
|
||||||
EXPECT_NE(renderRecord, nullptr);
|
EXPECT_NE(renderRecord, nullptr);
|
||||||
EXPECT_EQ(renderRecord->GetSharedFd(), 1);
|
EXPECT_EQ(renderRecord->GetSharedFd(), 1);
|
||||||
}
|
}
|
||||||
@ -2169,7 +2173,7 @@ HWTEST_F(AmsAppRunningRecordTest, GetHostRecord_001, TestSize.Level1)
|
|||||||
std::string renderParam = "test_render_param";
|
std::string renderParam = "test_render_param";
|
||||||
std::shared_ptr<AppRunningRecord> host;
|
std::shared_ptr<AppRunningRecord> host;
|
||||||
RenderRecord* renderRecord =
|
RenderRecord* renderRecord =
|
||||||
new RenderRecord(hostPid, renderParam, 0, 1, 0, host);
|
new RenderRecord(hostPid, renderParam, FdGuard(0), FdGuard(1), FdGuard(0), host);
|
||||||
EXPECT_NE(renderRecord, nullptr);
|
EXPECT_NE(renderRecord, nullptr);
|
||||||
EXPECT_EQ(renderRecord->GetHostRecord(), host);
|
EXPECT_EQ(renderRecord->GetHostRecord(), host);
|
||||||
}
|
}
|
||||||
@ -2188,7 +2192,7 @@ HWTEST_F(AmsAppRunningRecordTest, SetScheduler_001, TestSize.Level1)
|
|||||||
std::string renderParam = "test_render_param";
|
std::string renderParam = "test_render_param";
|
||||||
std::shared_ptr<AppRunningRecord> host;
|
std::shared_ptr<AppRunningRecord> host;
|
||||||
RenderRecord* renderRecord =
|
RenderRecord* renderRecord =
|
||||||
new RenderRecord(hostPid, renderParam, 0, 0, 0, host);
|
new RenderRecord(hostPid, renderParam, FdGuard(0), FdGuard(0), FdGuard(0), host);
|
||||||
EXPECT_NE(renderRecord, nullptr);
|
EXPECT_NE(renderRecord, nullptr);
|
||||||
sptr<IRenderScheduler> scheduler;
|
sptr<IRenderScheduler> scheduler;
|
||||||
renderRecord->SetScheduler(scheduler);
|
renderRecord->SetScheduler(scheduler);
|
||||||
@ -2209,7 +2213,7 @@ HWTEST_F(AmsAppRunningRecordTest, SetDeathRecipient_001, TestSize.Level1)
|
|||||||
std::string renderParam = "test_render_param";
|
std::string renderParam = "test_render_param";
|
||||||
std::shared_ptr<AppRunningRecord> host;
|
std::shared_ptr<AppRunningRecord> host;
|
||||||
RenderRecord* renderRecord =
|
RenderRecord* renderRecord =
|
||||||
new RenderRecord(hostPid, renderParam, 0, 0, 0, host);
|
new RenderRecord(hostPid, renderParam, FdGuard(0), FdGuard(0), FdGuard(0), host);
|
||||||
EXPECT_NE(renderRecord, nullptr);
|
EXPECT_NE(renderRecord, nullptr);
|
||||||
sptr<AppDeathRecipient> recipient;
|
sptr<AppDeathRecipient> recipient;
|
||||||
renderRecord->SetDeathRecipient(recipient);
|
renderRecord->SetDeathRecipient(recipient);
|
||||||
@ -2230,7 +2234,7 @@ HWTEST_F(AmsAppRunningRecordTest, RegisterDeathRecipient_001, TestSize.Level1)
|
|||||||
std::string renderParam = "test_render_param";
|
std::string renderParam = "test_render_param";
|
||||||
std::shared_ptr<AppRunningRecord> host;
|
std::shared_ptr<AppRunningRecord> host;
|
||||||
RenderRecord* renderRecord =
|
RenderRecord* renderRecord =
|
||||||
new RenderRecord(hostPid, renderParam, 0, 0, 0, host);
|
new RenderRecord(hostPid, renderParam, FdGuard(0), FdGuard(0), FdGuard(0), host);
|
||||||
EXPECT_NE(renderRecord, nullptr);
|
EXPECT_NE(renderRecord, nullptr);
|
||||||
renderRecord->RegisterDeathRecipient();
|
renderRecord->RegisterDeathRecipient();
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ HWTEST_F(AppMgrEventTest, SendCreateAtomicServiceProcessEvent_0300, TestSize.Lev
|
|||||||
auto appRecord = std::make_shared<AppRunningRecord>(appInfo, recordId, processName);
|
auto appRecord = std::make_shared<AppRunningRecord>(appInfo, recordId, processName);
|
||||||
EXPECT_NE(appRecord, nullptr);
|
EXPECT_NE(appRecord, nullptr);
|
||||||
appRecord->SetCallerUid(-1);
|
appRecord->SetCallerUid(-1);
|
||||||
|
|
||||||
auto callerAppInfo = std::make_shared<ApplicationInfo>();
|
auto callerAppInfo = std::make_shared<ApplicationInfo>();
|
||||||
EXPECT_NE(callerAppInfo, nullptr);
|
EXPECT_NE(callerAppInfo, nullptr);
|
||||||
callerAppInfo->bundleName = "testCallerBundleName";
|
callerAppInfo->bundleName = "testCallerBundleName";
|
||||||
@ -179,7 +179,7 @@ HWTEST_F(AppMgrEventTest, SendProcessStartEvent_0300, TestSize.Level1)
|
|||||||
auto appRecord = std::make_shared<AppRunningRecord>(appInfo, recordId, processName);
|
auto appRecord = std::make_shared<AppRunningRecord>(appInfo, recordId, processName);
|
||||||
EXPECT_NE(appRecord, nullptr);
|
EXPECT_NE(appRecord, nullptr);
|
||||||
appRecord->SetCallerUid(-1);
|
appRecord->SetCallerUid(-1);
|
||||||
|
|
||||||
auto callerAppInfo = std::make_shared<ApplicationInfo>();
|
auto callerAppInfo = std::make_shared<ApplicationInfo>();
|
||||||
EXPECT_NE(callerAppInfo, nullptr);
|
EXPECT_NE(callerAppInfo, nullptr);
|
||||||
callerAppInfo->bundleName = "testCallerBundleName";
|
callerAppInfo->bundleName = "testCallerBundleName";
|
||||||
@ -188,7 +188,7 @@ HWTEST_F(AppMgrEventTest, SendProcessStartEvent_0300, TestSize.Level1)
|
|||||||
int32_t callerRecordId = 2;
|
int32_t callerRecordId = 2;
|
||||||
auto callerAppRecord = std::make_shared<AppRunningRecord>(callerAppInfo, callerRecordId, callerProcessName);
|
auto callerAppRecord = std::make_shared<AppRunningRecord>(callerAppInfo, callerRecordId, callerProcessName);
|
||||||
EXPECT_NE(callerAppRecord, nullptr);
|
EXPECT_NE(callerAppRecord, nullptr);
|
||||||
|
|
||||||
AAFwk::EventInfo eventInfo;
|
AAFwk::EventInfo eventInfo;
|
||||||
bool ret = AppMgrEventUtil::SendProcessStartEvent(callerAppRecord, appRecord, eventInfo);
|
bool ret = AppMgrEventUtil::SendProcessStartEvent(callerAppRecord, appRecord, eventInfo);
|
||||||
EXPECT_EQ(ret, true);
|
EXPECT_EQ(ret, true);
|
||||||
@ -252,7 +252,7 @@ HWTEST_F(AppMgrEventTest, SendProcessStartFailedEvent_0300, TestSize.Level1)
|
|||||||
auto appRecord = std::make_shared<AppRunningRecord>(appInfo, recordId, processName);
|
auto appRecord = std::make_shared<AppRunningRecord>(appInfo, recordId, processName);
|
||||||
EXPECT_NE(appRecord, nullptr);
|
EXPECT_NE(appRecord, nullptr);
|
||||||
appRecord->SetCallerUid(-1);
|
appRecord->SetCallerUid(-1);
|
||||||
|
|
||||||
auto callerAppInfo = std::make_shared<ApplicationInfo>();
|
auto callerAppInfo = std::make_shared<ApplicationInfo>();
|
||||||
EXPECT_NE(callerAppInfo, nullptr);
|
EXPECT_NE(callerAppInfo, nullptr);
|
||||||
callerAppInfo->bundleName = "testCallerBundleName";
|
callerAppInfo->bundleName = "testCallerBundleName";
|
||||||
@ -261,7 +261,7 @@ HWTEST_F(AppMgrEventTest, SendProcessStartFailedEvent_0300, TestSize.Level1)
|
|||||||
int32_t callerRecordId = 2;
|
int32_t callerRecordId = 2;
|
||||||
auto callerAppRecord = std::make_shared<AppRunningRecord>(callerAppInfo, callerRecordId, callerProcessName);
|
auto callerAppRecord = std::make_shared<AppRunningRecord>(callerAppInfo, callerRecordId, callerProcessName);
|
||||||
EXPECT_NE(callerAppRecord, nullptr);
|
EXPECT_NE(callerAppRecord, nullptr);
|
||||||
|
|
||||||
AAFwk::EventInfo eventInfo;
|
AAFwk::EventInfo eventInfo;
|
||||||
bool ret = AppMgrEventUtil::SendProcessStartFailedEvent(callerAppRecord, appRecord, eventInfo);
|
bool ret = AppMgrEventUtil::SendProcessStartFailedEvent(callerAppRecord, appRecord, eventInfo);
|
||||||
EXPECT_EQ(ret, true);
|
EXPECT_EQ(ret, true);
|
||||||
@ -291,8 +291,8 @@ HWTEST_F(AppMgrEventTest, SendRenderProcessStartFailedEvent_0100, TestSize.Level
|
|||||||
int32_t ipcFd = 1;
|
int32_t ipcFd = 1;
|
||||||
int32_t sharedFd = 1;
|
int32_t sharedFd = 1;
|
||||||
int32_t crashFd = 1;
|
int32_t crashFd = 1;
|
||||||
std::shared_ptr<RenderRecord> renderRecord =
|
std::shared_ptr<RenderRecord> renderRecord = RenderRecord::CreateRenderRecord(hostPid, renderParam,
|
||||||
RenderRecord::CreateRenderRecord(hostPid, renderParam, ipcFd, sharedFd, crashFd, hostRecord);
|
FdGuard(ipcFd), FdGuard(sharedFd), FdGuard(crashFd), hostRecord);
|
||||||
|
|
||||||
bool ret = AppMgrEventUtil::SendRenderProcessStartFailedEvent(renderRecord,
|
bool ret = AppMgrEventUtil::SendRenderProcessStartFailedEvent(renderRecord,
|
||||||
ProcessStartFailedReason::APPSPAWN_FAILED, 123);
|
ProcessStartFailedReason::APPSPAWN_FAILED, 123);
|
||||||
|
@ -678,7 +678,7 @@ HWTEST_F(AppMgrServiceInnerSecondTest, AppMgrServiceInnerSecondTest_UpdateRender
|
|||||||
ret = appMgrServiceInner->UpdateRenderState(INT_MAX, 0);
|
ret = appMgrServiceInner->UpdateRenderState(INT_MAX, 0);
|
||||||
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
||||||
|
|
||||||
auto renderRecord = std::make_shared<RenderRecord>(1, "", -1, -1, -1, appRecord);
|
auto renderRecord = std::make_shared<RenderRecord>(1, "", FdGuard(-1), FdGuard(-1), FdGuard(-1), appRecord);
|
||||||
renderRecord->SetPid(100); // 100 means pid
|
renderRecord->SetPid(100); // 100 means pid
|
||||||
appRecord->AddRenderRecord(renderRecord);
|
appRecord->AddRenderRecord(renderRecord);
|
||||||
ret = appMgrServiceInner->UpdateRenderState(100, 1); // 100 means pid
|
ret = appMgrServiceInner->UpdateRenderState(100, 1); // 100 means pid
|
||||||
@ -1668,7 +1668,7 @@ HWTEST_F(AppMgrServiceInnerSecondTest, GetRunningMultiInstanceKeys_001, TestSize
|
|||||||
instanceKeys.push_back(appRecord->GetInstanceKey());
|
instanceKeys.push_back(appRecord->GetInstanceKey());
|
||||||
appMgrServiceInner.GetRunningMultiInstanceKeys(appRecord, instanceKeys);
|
appMgrServiceInner.GetRunningMultiInstanceKeys(appRecord, instanceKeys);
|
||||||
EXPECT_FALSE(instanceKeys.size() == 1);
|
EXPECT_FALSE(instanceKeys.size() == 1);
|
||||||
|
|
||||||
appRecord->priorityObject_ = nullptr;
|
appRecord->priorityObject_ = nullptr;
|
||||||
appMgrServiceInner.GetRunningMultiInstanceKeys(appRecord, instanceKeys);
|
appMgrServiceInner.GetRunningMultiInstanceKeys(appRecord, instanceKeys);
|
||||||
EXPECT_FALSE(instanceKeys.size() == 1 && instanceKeys[0] == appRecord->GetInstanceKey());
|
EXPECT_FALSE(instanceKeys.size() == 1 && instanceKeys[0] == appRecord->GetInstanceKey());
|
||||||
@ -1719,7 +1719,7 @@ HWTEST_F(AppMgrServiceInnerSecondTest, UpdateAbilityState_001, TestSize.Level1)
|
|||||||
EXPECT_EQ(abilityRecord1->GetAbilityInfo(), nullptr);
|
EXPECT_EQ(abilityRecord1->GetAbilityInfo(), nullptr);
|
||||||
|
|
||||||
appMgrServiceInner->UpdateAbilityState(token1, AbilityState::ABILITY_STATE_CREATE);
|
appMgrServiceInner->UpdateAbilityState(token1, AbilityState::ABILITY_STATE_CREATE);
|
||||||
|
|
||||||
abilityRecord1 =
|
abilityRecord1 =
|
||||||
appMgrServiceInner->GetAppRunningRecordByAbilityToken(token1)->GetAbilityRunningRecordByToken(token1);
|
appMgrServiceInner->GetAppRunningRecordByAbilityToken(token1)->GetAbilityRunningRecordByToken(token1);
|
||||||
abilityRecord1->SetState(AbilityState::ABILITY_STATE_TERMINATED);
|
abilityRecord1->SetState(AbilityState::ABILITY_STATE_TERMINATED);
|
||||||
@ -1756,7 +1756,7 @@ HWTEST_F(AppMgrServiceInnerSecondTest, KillProcessByAbilityToken_001, TestSize.L
|
|||||||
applicationInfo_, abilityInfo_, processName, bundleInfo, hapModuleInfo, want);
|
applicationInfo_, abilityInfo_, processName, bundleInfo, hapModuleInfo, want);
|
||||||
EXPECT_NE(appRecord, nullptr);
|
EXPECT_NE(appRecord, nullptr);
|
||||||
appMgrServiceInner->KillProcessByAbilityToken(token);
|
appMgrServiceInner->KillProcessByAbilityToken(token);
|
||||||
|
|
||||||
appRecord->GetPriorityObject()->SetPid(1);
|
appRecord->GetPriorityObject()->SetPid(1);
|
||||||
appRecord->SetKeepAliveEnableState(true);
|
appRecord->SetKeepAliveEnableState(true);
|
||||||
appRecord->SetEmptyKeepAliveAppState(true);
|
appRecord->SetEmptyKeepAliveAppState(true);
|
||||||
@ -1792,7 +1792,7 @@ HWTEST_F(AppMgrServiceInnerSecondTest, SetOverlayInfo_001, TestSize.Level1)
|
|||||||
appMgrServiceInner->SetOverlayInfo("testBundleName", 1, startMsg);
|
appMgrServiceInner->SetOverlayInfo("testBundleName", 1, startMsg);
|
||||||
EXPECT_EQ(startMsg.flags, 0);
|
EXPECT_EQ(startMsg.flags, 0);
|
||||||
EXPECT_EQ(startMsg.overlayInfo, "");
|
EXPECT_EQ(startMsg.overlayInfo, "");
|
||||||
|
|
||||||
TAG_LOGI(AAFwkTag::TEST, "SetOverlayInfo_001 end");
|
TAG_LOGI(AAFwkTag::TEST, "SetOverlayInfo_001 end");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1873,15 +1873,15 @@ HWTEST_F(AppMgrServiceInnerSecondTest, ProcessAppDebug_0010, TestSize.Level1)
|
|||||||
std::shared_ptr<AppRunningRecord> appRecord;
|
std::shared_ptr<AppRunningRecord> appRecord;
|
||||||
auto appMgrServiceInner = std::make_shared<AppMgrServiceInner>();
|
auto appMgrServiceInner = std::make_shared<AppMgrServiceInner>();
|
||||||
EXPECT_NE(appMgrServiceInner, nullptr);
|
EXPECT_NE(appMgrServiceInner, nullptr);
|
||||||
|
|
||||||
appMgrServiceInner->appDebugManager_ = nullptr;
|
appMgrServiceInner->appDebugManager_ = nullptr;
|
||||||
appMgrServiceInner->ProcessAppDebug(nullptr, true);
|
appMgrServiceInner->ProcessAppDebug(nullptr, true);
|
||||||
EXPECT_EQ(appMgrServiceInner->appDebugManager_, nullptr);
|
EXPECT_EQ(appMgrServiceInner->appDebugManager_, nullptr);
|
||||||
|
|
||||||
appMgrServiceInner->appDebugManager_ = std::make_shared<AppDebugManager>();
|
appMgrServiceInner->appDebugManager_ = std::make_shared<AppDebugManager>();
|
||||||
appMgrServiceInner->ProcessAppDebug(nullptr, true);
|
appMgrServiceInner->ProcessAppDebug(nullptr, true);
|
||||||
EXPECT_NE(appMgrServiceInner->appDebugManager_, nullptr);
|
EXPECT_NE(appMgrServiceInner->appDebugManager_, nullptr);
|
||||||
|
|
||||||
appMgrServiceInner->appDebugManager_ = nullptr;
|
appMgrServiceInner->appDebugManager_ = nullptr;
|
||||||
BundleInfo bundleInfo;
|
BundleInfo bundleInfo;
|
||||||
HapModuleInfo hapModuleInfo;
|
HapModuleInfo hapModuleInfo;
|
||||||
@ -1916,7 +1916,7 @@ HWTEST_F(AppMgrServiceInnerSecondTest, ProcessAppDebug_0010, TestSize.Level1)
|
|||||||
appRecord->SetDebugApp(true);
|
appRecord->SetDebugApp(true);
|
||||||
appMgrServiceInner->ProcessAppDebug(appRecord, false);
|
appMgrServiceInner->ProcessAppDebug(appRecord, false);
|
||||||
EXPECT_EQ(appRecord->IsDebugApp(), true);
|
EXPECT_EQ(appRecord->IsDebugApp(), true);
|
||||||
|
|
||||||
TAG_LOGI(AAFwkTag::TEST, "ProcessAppDebug_0010 end");
|
TAG_LOGI(AAFwkTag::TEST, "ProcessAppDebug_0010 end");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1931,7 +1931,7 @@ HWTEST_F(AppMgrServiceInnerSecondTest, FinishUserTest_0010, TestSize.Level1)
|
|||||||
TAG_LOGI(AAFwkTag::TEST, "FinishUserTest_0010 start");
|
TAG_LOGI(AAFwkTag::TEST, "FinishUserTest_0010 start");
|
||||||
auto appMgrServiceInner = std::make_shared<AppMgrServiceInner>();
|
auto appMgrServiceInner = std::make_shared<AppMgrServiceInner>();
|
||||||
EXPECT_NE(appMgrServiceInner, nullptr);
|
EXPECT_NE(appMgrServiceInner, nullptr);
|
||||||
|
|
||||||
pid_t pid = 0;
|
pid_t pid = 0;
|
||||||
appMgrServiceInner->FinishUserTest("", 0, "", pid);
|
appMgrServiceInner->FinishUserTest("", 0, "", pid);
|
||||||
|
|
||||||
@ -1961,7 +1961,7 @@ HWTEST_F(AppMgrServiceInnerSecondTest, FinishUserTest_0010, TestSize.Level1)
|
|||||||
|
|
||||||
appMgrServiceInner->remoteClientManager_ = nullptr;
|
appMgrServiceInner->remoteClientManager_ = nullptr;
|
||||||
appMgrServiceInner->FinishUserTest(msg, 0, bundleName, pid);
|
appMgrServiceInner->FinishUserTest(msg, 0, bundleName, pid);
|
||||||
|
|
||||||
TAG_LOGI(AAFwkTag::TEST, "FinishUserTest_0010 end");
|
TAG_LOGI(AAFwkTag::TEST, "FinishUserTest_0010 end");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2153,7 +2153,7 @@ HWTEST_F(AppMgrServiceInnerSecondTest, AppMgrServiceInnerSecondTest_KillChildPro
|
|||||||
appRecord->AddChildProcessRecord(childPid, childProcessRecord);
|
appRecord->AddChildProcessRecord(childPid, childProcessRecord);
|
||||||
appMgrServiceInner->KillChildProcess(appRecord);
|
appMgrServiceInner->KillChildProcess(appRecord);
|
||||||
EXPECT_EQ(appMgrServiceInner->killedProcessMap_.size(), 1);
|
EXPECT_EQ(appMgrServiceInner->killedProcessMap_.size(), 1);
|
||||||
|
|
||||||
TAG_LOGI(AAFwkTag::TEST, "AppMgrServiceInnerSecondTest_KillChildProcess_0100 end");
|
TAG_LOGI(AAFwkTag::TEST, "AppMgrServiceInnerSecondTest_KillChildProcess_0100 end");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2282,8 +2282,8 @@ HWTEST_F(AppMgrServiceInnerSecondTest, AppMgrServiceInnerSecondTest_KillRenderPr
|
|||||||
auto appRunningRecord = std::make_shared<AppRunningRecord>(appInfo, recordId, TEST_PROCESS_NAME);
|
auto appRunningRecord = std::make_shared<AppRunningRecord>(appInfo, recordId, TEST_PROCESS_NAME);
|
||||||
EXPECT_NE(appRunningRecord, nullptr);
|
EXPECT_NE(appRunningRecord, nullptr);
|
||||||
|
|
||||||
std::shared_ptr<RenderRecord> renderRecord =
|
std::shared_ptr<RenderRecord> renderRecord = RenderRecord::CreateRenderRecord(hostPid, renderParam,
|
||||||
RenderRecord::CreateRenderRecord(hostPid, renderParam, ipcFd, sharedFd, crashFd, hostRecord);
|
FdGuard(ipcFd), FdGuard(sharedFd), FdGuard(crashFd), hostRecord);
|
||||||
EXPECT_NE(renderRecord, nullptr);
|
EXPECT_NE(renderRecord, nullptr);
|
||||||
|
|
||||||
renderRecord->SetPid(10);
|
renderRecord->SetPid(10);
|
||||||
|
@ -910,8 +910,8 @@ HWTEST_F(AppMgrServiceInnerTest, StartRenderProcessImpl_001, TestSize.Level0)
|
|||||||
int32_t ipcFd = 1;
|
int32_t ipcFd = 1;
|
||||||
int32_t sharedFd = 1;
|
int32_t sharedFd = 1;
|
||||||
int32_t crashFd = 1;
|
int32_t crashFd = 1;
|
||||||
std::shared_ptr<RenderRecord> renderRecord =
|
std::shared_ptr<RenderRecord> renderRecord = RenderRecord::CreateRenderRecord(hostPid, renderParam,
|
||||||
RenderRecord::CreateRenderRecord(hostPid, renderParam, ipcFd, sharedFd, crashFd, appRecord);
|
FdGuard(ipcFd), FdGuard(sharedFd), FdGuard(crashFd), appRecord);
|
||||||
EXPECT_NE(renderRecord, nullptr);
|
EXPECT_NE(renderRecord, nullptr);
|
||||||
pid_t renderPid = 1;
|
pid_t renderPid = 1;
|
||||||
appMgrServiceInner->StartRenderProcessImpl(nullptr, nullptr, renderPid);
|
appMgrServiceInner->StartRenderProcessImpl(nullptr, nullptr, renderPid);
|
||||||
|
@ -2930,37 +2930,37 @@ HWTEST_F(AppMgrServiceInnerTest, StartRenderProcess_001, TestSize.Level0)
|
|||||||
pid_t hostPid = 0;
|
pid_t hostPid = 0;
|
||||||
std::string renderParam = "test_renderParam";
|
std::string renderParam = "test_renderParam";
|
||||||
pid_t renderPid = 0;
|
pid_t renderPid = 0;
|
||||||
int ret = appMgrServiceInner->StartRenderProcess(hostPid, "", 0, 0, 0, renderPid);
|
int ret = appMgrServiceInner->StartRenderProcess(hostPid, "", FdGuard(0), FdGuard(0), FdGuard(0), renderPid);
|
||||||
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
||||||
ret = appMgrServiceInner->StartRenderProcess(hostPid, "", 0, 0, 1, renderPid);
|
ret = appMgrServiceInner->StartRenderProcess(hostPid, "", FdGuard(0), FdGuard(0), FdGuard(1), renderPid);
|
||||||
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
||||||
ret = appMgrServiceInner->StartRenderProcess(hostPid, "", 0, 1, 0, renderPid);
|
ret = appMgrServiceInner->StartRenderProcess(hostPid, "", FdGuard(0), FdGuard(1), FdGuard(0), renderPid);
|
||||||
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
||||||
ret = appMgrServiceInner->StartRenderProcess(hostPid, "", 0, 1, 1, renderPid);
|
ret = appMgrServiceInner->StartRenderProcess(hostPid, "", FdGuard(0), FdGuard(1), FdGuard(1), renderPid);
|
||||||
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
||||||
ret = appMgrServiceInner->StartRenderProcess(hostPid, "", 1, 0, 0, renderPid);
|
ret = appMgrServiceInner->StartRenderProcess(hostPid, "", FdGuard(1), FdGuard(0), FdGuard(0), renderPid);
|
||||||
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
||||||
ret = appMgrServiceInner->StartRenderProcess(hostPid, "", 1, 0, 1, renderPid);
|
ret = appMgrServiceInner->StartRenderProcess(hostPid, "", FdGuard(1), FdGuard(0), FdGuard(1), renderPid);
|
||||||
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
||||||
ret = appMgrServiceInner->StartRenderProcess(hostPid, "", 1, 1, 0, renderPid);
|
ret = appMgrServiceInner->StartRenderProcess(hostPid, "", FdGuard(1), FdGuard(1), FdGuard(0), renderPid);
|
||||||
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
||||||
ret = appMgrServiceInner->StartRenderProcess(hostPid, "", 1, 1, 1, renderPid);
|
ret = appMgrServiceInner->StartRenderProcess(hostPid, "", FdGuard(1), FdGuard(1), FdGuard(1), renderPid);
|
||||||
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
||||||
ret = appMgrServiceInner->StartRenderProcess(hostPid, renderParam, 0, 0, 0, renderPid);
|
ret = appMgrServiceInner->StartRenderProcess(hostPid, renderParam, FdGuard(0), FdGuard(0), FdGuard(0), renderPid);
|
||||||
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
||||||
ret = appMgrServiceInner->StartRenderProcess(hostPid, renderParam, 0, 0, 1, renderPid);
|
ret = appMgrServiceInner->StartRenderProcess(hostPid, renderParam, FdGuard(0), FdGuard(0), FdGuard(1), renderPid);
|
||||||
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
||||||
ret = appMgrServiceInner->StartRenderProcess(hostPid, renderParam, 0, 1, 0, renderPid);
|
ret = appMgrServiceInner->StartRenderProcess(hostPid, renderParam, FdGuard(0), FdGuard(1), FdGuard(0), renderPid);
|
||||||
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
||||||
ret = appMgrServiceInner->StartRenderProcess(hostPid, renderParam, 0, 1, 1, renderPid);
|
ret = appMgrServiceInner->StartRenderProcess(hostPid, renderParam, FdGuard(0), FdGuard(1), FdGuard(1), renderPid);
|
||||||
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
||||||
ret = appMgrServiceInner->StartRenderProcess(hostPid, renderParam, 1, 0, 0, renderPid);
|
ret = appMgrServiceInner->StartRenderProcess(hostPid, renderParam, FdGuard(1), FdGuard(0), FdGuard(0), renderPid);
|
||||||
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
||||||
ret = appMgrServiceInner->StartRenderProcess(hostPid, renderParam, 1, 0, 1, renderPid);
|
ret = appMgrServiceInner->StartRenderProcess(hostPid, renderParam, FdGuard(1), FdGuard(0), FdGuard(1), renderPid);
|
||||||
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
||||||
ret = appMgrServiceInner->StartRenderProcess(hostPid, renderParam, 1, 1, 0, renderPid);
|
ret = appMgrServiceInner->StartRenderProcess(hostPid, renderParam, FdGuard(1), FdGuard(1), FdGuard(0), renderPid);
|
||||||
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
||||||
ret = appMgrServiceInner->StartRenderProcess(hostPid, renderParam, 1, 1, 1, renderPid);
|
ret = appMgrServiceInner->StartRenderProcess(hostPid, renderParam, FdGuard(1), FdGuard(1), FdGuard(1), renderPid);
|
||||||
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
||||||
|
|
||||||
TAG_LOGI(AAFwkTag::TEST, "StartRenderProcess_001 end");
|
TAG_LOGI(AAFwkTag::TEST, "StartRenderProcess_001 end");
|
||||||
@ -2981,40 +2981,40 @@ HWTEST_F(AppMgrServiceInnerTest, StartRenderProcess_002, TestSize.Level0)
|
|||||||
pid_t hostPid1 = 1;
|
pid_t hostPid1 = 1;
|
||||||
std::string renderParam = "test_renderParam";
|
std::string renderParam = "test_renderParam";
|
||||||
pid_t renderPid = 0;
|
pid_t renderPid = 0;
|
||||||
int ret = appMgrServiceInner->StartRenderProcess(hostPid1, "", 0, 0, 0, renderPid);
|
int ret = appMgrServiceInner->StartRenderProcess(hostPid1, "", FdGuard(0), FdGuard(0), FdGuard(0), renderPid);
|
||||||
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
||||||
ret = appMgrServiceInner->StartRenderProcess(hostPid1, "", 0, 0, 1, renderPid);
|
ret = appMgrServiceInner->StartRenderProcess(hostPid1, "", FdGuard(0), FdGuard(0), FdGuard(1), renderPid);
|
||||||
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
||||||
ret = appMgrServiceInner->StartRenderProcess(hostPid1, "", 0, 1, 0, renderPid);
|
ret = appMgrServiceInner->StartRenderProcess(hostPid1, "", FdGuard(0), FdGuard(1), FdGuard(0), renderPid);
|
||||||
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
||||||
ret = appMgrServiceInner->StartRenderProcess(hostPid1, "", 0, 1, 1, renderPid);
|
ret = appMgrServiceInner->StartRenderProcess(hostPid1, "", FdGuard(0), FdGuard(1), FdGuard(1), renderPid);
|
||||||
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
||||||
ret = appMgrServiceInner->StartRenderProcess(hostPid1, "", 1, 0, 0, renderPid);
|
ret = appMgrServiceInner->StartRenderProcess(hostPid1, "", FdGuard(1), FdGuard(0), FdGuard(0), renderPid);
|
||||||
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
||||||
ret = appMgrServiceInner->StartRenderProcess(hostPid1, "", 1, 0, 1, renderPid);
|
ret = appMgrServiceInner->StartRenderProcess(hostPid1, "", FdGuard(1), FdGuard(0), FdGuard(1), renderPid);
|
||||||
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
||||||
ret = appMgrServiceInner->StartRenderProcess(hostPid1, "", 1, 1, 0, renderPid);
|
ret = appMgrServiceInner->StartRenderProcess(hostPid1, "", FdGuard(1), FdGuard(1), FdGuard(0), renderPid);
|
||||||
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
||||||
ret = appMgrServiceInner->StartRenderProcess(hostPid1, "", 1, 1, 1, renderPid);
|
ret = appMgrServiceInner->StartRenderProcess(hostPid1, "", FdGuard(1), FdGuard(1), FdGuard(1), renderPid);
|
||||||
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
||||||
ret = appMgrServiceInner->StartRenderProcess(hostPid1, renderParam, 0, 0, 0, renderPid);
|
ret = appMgrServiceInner->StartRenderProcess(hostPid1, renderParam, FdGuard(0), FdGuard(0), FdGuard(0), renderPid);
|
||||||
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
||||||
ret = appMgrServiceInner->StartRenderProcess(hostPid1, renderParam, 0, 0, 1, renderPid);
|
ret = appMgrServiceInner->StartRenderProcess(hostPid1, renderParam, FdGuard(0), FdGuard(0), FdGuard(1), renderPid);
|
||||||
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
||||||
ret = appMgrServiceInner->StartRenderProcess(hostPid1, renderParam, 0, 1, 0, renderPid);
|
ret = appMgrServiceInner->StartRenderProcess(hostPid1, renderParam, FdGuard(0), FdGuard(1), FdGuard(0), renderPid);
|
||||||
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
||||||
|
|
||||||
ret = appMgrServiceInner->StartRenderProcess(hostPid1, renderParam, 0, 1, 1, renderPid);
|
ret = appMgrServiceInner->StartRenderProcess(hostPid1, renderParam, FdGuard(0), FdGuard(1), FdGuard(1), renderPid);
|
||||||
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
||||||
|
|
||||||
ret = appMgrServiceInner->StartRenderProcess(hostPid1, renderParam, 1, 0, 0, renderPid);
|
ret = appMgrServiceInner->StartRenderProcess(hostPid1, renderParam, FdGuard(1), FdGuard(0), FdGuard(0), renderPid);
|
||||||
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
||||||
ret = appMgrServiceInner->StartRenderProcess(hostPid1, renderParam, 1, 0, 1, renderPid);
|
ret = appMgrServiceInner->StartRenderProcess(hostPid1, renderParam, FdGuard(1), FdGuard(0), FdGuard(1), renderPid);
|
||||||
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
||||||
ret = appMgrServiceInner->StartRenderProcess(hostPid1, renderParam, 1, 1, 0, renderPid);
|
ret = appMgrServiceInner->StartRenderProcess(hostPid1, renderParam, FdGuard(1), FdGuard(1), FdGuard(0), renderPid);
|
||||||
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
||||||
|
|
||||||
ret = appMgrServiceInner->StartRenderProcess(hostPid1, renderParam, 1, 1, 1, renderPid);
|
ret = appMgrServiceInner->StartRenderProcess(hostPid1, renderParam, FdGuard(1), FdGuard(1), FdGuard(1), renderPid);
|
||||||
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
||||||
TAG_LOGI(AAFwkTag::TEST, "StartRenderProcess_002 end");
|
TAG_LOGI(AAFwkTag::TEST, "StartRenderProcess_002 end");
|
||||||
}
|
}
|
||||||
|
@ -514,7 +514,7 @@ HWTEST_F(AppRunningManagerSecondTest, AppRunningManager_GetAppRunningRecordByRen
|
|||||||
appInfo_->bundleName = BUNDLE_NAME;
|
appInfo_->bundleName = BUNDLE_NAME;
|
||||||
auto record1 = appRunningManager->CreateAppRunningRecord(appInfo_, PROCESS_NAME, bundleInfo, "");
|
auto record1 = appRunningManager->CreateAppRunningRecord(appInfo_, PROCESS_NAME, bundleInfo, "");
|
||||||
auto record2 = appRunningManager->CreateAppRunningRecord(appInfo_, PROCESS_NAME, bundleInfo, "");
|
auto record2 = appRunningManager->CreateAppRunningRecord(appInfo_, PROCESS_NAME, bundleInfo, "");
|
||||||
auto renderRecord = std::make_shared<RenderRecord>(0, "", -1, -1, -1, record2);
|
auto renderRecord = std::make_shared<RenderRecord>(0, "", FdGuard(-1), FdGuard(-1), FdGuard(-1), record2);
|
||||||
record2->AddRenderRecord(renderRecord);
|
record2->AddRenderRecord(renderRecord);
|
||||||
auto ret = appRunningManager->GetAppRunningRecordByRenderPid(1);
|
auto ret = appRunningManager->GetAppRunningRecordByRenderPid(1);
|
||||||
|
|
||||||
|
@ -923,7 +923,7 @@ HWTEST_F(AppSpawnSocketTest, HandleOnRenderProcessCreated_001, TestSize.Level0)
|
|||||||
manager->HandleOnRenderProcessCreated(nullptr);
|
manager->HandleOnRenderProcessCreated(nullptr);
|
||||||
std::shared_ptr<AppRunningRecord> appRecord = MockAppRecord();
|
std::shared_ptr<AppRunningRecord> appRecord = MockAppRecord();
|
||||||
std::shared_ptr<RenderRecord> renderRecord =
|
std::shared_ptr<RenderRecord> renderRecord =
|
||||||
std::make_shared<RenderRecord>(1, "param", 1, 1, 1, appRecord);
|
std::make_shared<RenderRecord>(1, "param", FdGuard(1), FdGuard(1), FdGuard(1), appRecord);
|
||||||
renderRecord->SetPid(1);
|
renderRecord->SetPid(1);
|
||||||
manager->HandleOnRenderProcessCreated(renderRecord);
|
manager->HandleOnRenderProcessCreated(renderRecord);
|
||||||
}
|
}
|
||||||
@ -1142,7 +1142,7 @@ HWTEST_F(AppSpawnSocketTest, HandleOnRenderProcessDied_001, TestSize.Level0)
|
|||||||
ASSERT_NE(manager, nullptr);
|
ASSERT_NE(manager, nullptr);
|
||||||
std::shared_ptr<AppRunningRecord> appRecord = MockAppRecord();
|
std::shared_ptr<AppRunningRecord> appRecord = MockAppRecord();
|
||||||
std::shared_ptr<RenderRecord> renderRecord =
|
std::shared_ptr<RenderRecord> renderRecord =
|
||||||
std::make_shared<RenderRecord>(1, "param", 1, 1, 1, appRecord);
|
std::make_shared<RenderRecord>(1, "param", FdGuard(1), FdGuard(1), FdGuard(1), appRecord);
|
||||||
renderRecord->SetPid(1);
|
renderRecord->SetPid(1);
|
||||||
manager->HandleOnRenderProcessDied(nullptr);
|
manager->HandleOnRenderProcessDied(nullptr);
|
||||||
manager->HandleOnRenderProcessDied(renderRecord);
|
manager->HandleOnRenderProcessDied(renderRecord);
|
||||||
|
Loading…
Reference in New Issue
Block a user