mirror of
https://gitee.com/openharmony/ability_ability_runtime
synced 2024-11-23 23:30:44 +00:00
commit
8cf074c0e1
@ -250,11 +250,7 @@ enum {
|
||||
*/
|
||||
ERR_AAFWK_PARCEL_FAIL,
|
||||
/**
|
||||
* Result(2097199) for type is empty.
|
||||
*/
|
||||
ERR_WANT_NO_TYPE,
|
||||
/**
|
||||
* Result(2097200) for implicit start ability is failed.
|
||||
* Result(2097199) for for implicit start ability is failed.
|
||||
*/
|
||||
ERR_IMPLICIT_START_ABILITY_FAIL,
|
||||
};
|
||||
|
@ -36,6 +36,7 @@ namespace {
|
||||
const std::string EVENT_CLOSE_CODE = "EVENT_CLOSE";
|
||||
const std::string EVENT_MULT_APP_CHOOSE = "EVENT_MULT_APP_CHOOSE";
|
||||
const std::string EVENT_MULT_APP_CLOSE = "EVENT_MULT_APP_CLOSE";
|
||||
const std::string EVENT_TIPS_APP = "EVENT_TIPS_APP";
|
||||
}
|
||||
|
||||
std::shared_ptr<UIServiceMgrClient> UIServiceMgrClient::GetInstance()
|
||||
@ -103,6 +104,12 @@ ErrCode UIServiceMgrClient::ShowDialog(const std::string& name, const std::strin
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
if (code_ == EVENT_TIPS_APP) {
|
||||
params_ = params;
|
||||
callback(0, EVENT_CLOSE_CODE, "");
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -36,6 +36,7 @@ using namespace OHOS::AppExecFwk;
|
||||
namespace {
|
||||
const std::string EVENT_MULT_APP_CHOOSE = "EVENT_MULT_APP_CHOOSE";
|
||||
const std::string EVENT_MULT_APP_CLOSE = "EVENT_MULT_APP_CLOSE";
|
||||
const std::string EVENT_TIPS_APP = "EVENT_TIPS_APP";
|
||||
const std::string ACTION_VIEW = "ohos.want.action.viewData";
|
||||
const std::string WANT_TYPE = "image/png";
|
||||
const int32_t MOCK_MAIN_USER_ID = 100;
|
||||
@ -107,6 +108,11 @@ void StartAbilityImplicitModuleTest::OnStartAms()
|
||||
abilityMs_->iBundleManager_ = new BundleMgrService();
|
||||
EXPECT_TRUE(abilityMs_->iBundleManager_);
|
||||
|
||||
abilityMs_->implicitStartProcessor_ = std::make_shared<ImplicitStartProcessor>();
|
||||
EXPECT_TRUE(abilityMs_->implicitStartProcessor_);
|
||||
abilityMs_->implicitStartProcessor_->iBundleManager_ = new BundleMgrService();
|
||||
EXPECT_TRUE(abilityMs_->implicitStartProcessor_->iBundleManager_);
|
||||
|
||||
DelayedSingleton<SystemDialogScheduler>::GetInstance()->SetDeviceType("phone");
|
||||
abilityMs_->InitMissionListManager(userId, true);
|
||||
abilityMs_->SwitchManagers(0, false);
|
||||
@ -250,13 +256,13 @@ HWTEST_F(StartAbilityImplicitModuleTest, StartAbility_004, TestSize.Level1)
|
||||
want.SetType(WANT_TYPE);
|
||||
want.SetParam("numMock", 0);
|
||||
|
||||
Ace::UIServiceMgrClient::GetInstance()->SetDialogCheckState(EVENT_MULT_APP_CHOOSE);
|
||||
Ace::UIServiceMgrClient::GetInstance()->SetDialogCheckState(EVENT_TIPS_APP);
|
||||
abilityMs_->StartAbility(want, MOCK_MAIN_USER_ID);
|
||||
auto params = Ace::UIServiceMgrClient::GetInstance()->GetParams();
|
||||
auto isCallBack = Ace::UIServiceMgrClient::GetInstance()->IsCallBack();
|
||||
|
||||
EXPECT_TRUE(params.empty());
|
||||
EXPECT_TRUE(!isCallBack);
|
||||
EXPECT_TRUE(!params.empty());
|
||||
EXPECT_TRUE(isCallBack);
|
||||
|
||||
auto abilityRecord = abilityMs_->currentMissionListManager_->GetCurrentTopAbilityLocked();
|
||||
EXPECT_TRUE(abilityRecord == nullptr);
|
||||
@ -281,7 +287,7 @@ HWTEST_F(StartAbilityImplicitModuleTest, StartAbility_005, TestSize.Level1)
|
||||
Ace::UIServiceMgrClient::GetInstance()->SetDialogCheckState(EVENT_MULT_APP_CHOOSE);
|
||||
auto ret = abilityMs_->StartAbility(want, MOCK_MAIN_USER_ID);
|
||||
|
||||
EXPECT_EQ(ret, ERR_WANT_NO_TYPE);
|
||||
EXPECT_EQ(ret, ERR_OK);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user