1 /* 2 * Copyright (c) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"), 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef MOCK_ABILITY_MANAGER_COLLABORATOR_H 17 #define MOCK_ABILITY_MANAGER_COLLABORATOR_H 18 19 #include <gmock/gmock.h> 20 #include "iability_manager_collaborator.h" 21 22 namespace OHOS { 23 namespace AAFwk { 24 class MockAbilityManagerCollaborator : public IAbilityManagerCollaborator { 25 public: 26 MOCK_METHOD4(NotifyStartAbility, int32_t(const AppExecFwk::AbilityInfo &abilityInfo, 27 int32_t userId, Want &want, uint64_t accessTokenIDEx)); 28 MOCK_METHOD1(NotifyPreloadAbility, int32_t(const std::string &bundleName)); 29 MOCK_METHOD2(NotifyMissionCreated, int32_t(int32_t missionId, const Want &want)); 30 MOCK_METHOD1(NotifyMissionCreated, int32_t(const sptr<SessionInfo> &sessionInfo)); 31 MOCK_METHOD3(NotifyLoadAbility, int32_t(const AppExecFwk::AbilityInfo &abilityInfo, int32_t missionId, 32 const Want &want)); 33 MOCK_METHOD2(NotifyLoadAbility, int32_t(const AppExecFwk::AbilityInfo &abilityInfo, 34 const sptr<SessionInfo> &sessionInfo)); 35 MOCK_METHOD1(NotifyMoveMissionToBackground, int32_t(int32_t missionId)); 36 MOCK_METHOD1(NotifyMoveMissionToForeground, int32_t(int32_t missionId)); 37 MOCK_METHOD1(NotifyTerminateMission, int32_t(int32_t missionId)); 38 MOCK_METHOD1(NotifyClearMission, int32_t(int32_t missionId)); 39 MOCK_METHOD3(NotifyRemoveShellProcess, int32_t(int32_t pid, int32_t type, const std::string &reason)); 40 MOCK_METHOD1(UpdateMissionInfo, void(InnerMissionInfoDto &info)); 41 MOCK_METHOD1(UpdateMissionInfo, void(sptr<SessionInfo> &sessionInfo)); AsObject()42 sptr<IRemoteObject> AsObject() override 43 { 44 return {}; 45 } 46 }; 47 } // AAFwk 48 } // OHOS 49 #endif // MOCK_ABILITY_MANAGER_COLLABORATOR_H