• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023-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 BASE_LOCATION_MOCK_IF_SYSTEM_ABILITY_MANAGER_H
17 #define BASE_LOCATION_MOCK_IF_SYSTEM_ABILITY_MANAGER_H
18 
19 #include "gmock/gmock.h"
20 
21 #include "if_system_ability_manager.h"
22 
23 namespace OHOS {
24 namespace Location {
25 class MockIfSystemAbilityManager : public ISystemAbilityManager {
26 public:
MockIfSystemAbilityManager()27     MockIfSystemAbilityManager() {}
~MockIfSystemAbilityManager()28     ~MockIfSystemAbilityManager() {}
29     MOCK_METHOD(sptr<IRemoteObject>, GetSystemAbility, (int32_t systemAbilityId));
30     MOCK_METHOD(sptr<IRemoteObject>, CheckSystemAbility, (int32_t systemAbilityId));
31     MOCK_METHOD(int32_t, RemoveSystemAbility, (int32_t systemAbilityId));
32     MOCK_METHOD(int32_t, SubscribeSystemAbility, (int32_t systemAbilityId,
33         const sptr<ISystemAbilityStatusChange>& listener));
34     MOCK_METHOD(int32_t, UnSubscribeSystemAbility, (int32_t systemAbilityId,
35         const sptr<ISystemAbilityStatusChange>& listener));
36     MOCK_METHOD(sptr<IRemoteObject>, GetSystemAbility, (int32_t systemAbilityId, const std::string& deviceId));
37     MOCK_METHOD(sptr<IRemoteObject>, CheckSystemAbility, (int32_t systemAbilityId, const std::string& deviceId));
38     MOCK_METHOD(int32_t, AddOnDemandSystemAbilityInfo, (int32_t systemAbilityId,
39         const std::u16string& localAbilityManagerName));
40 
41     MOCK_METHOD(sptr<IRemoteObject>, CheckSystemAbility, (int32_t systemAbilityId, bool& isExist));
42     MOCK_METHOD(int32_t, AddSystemAbility, (int32_t systemAbilityId, const sptr<IRemoteObject>& ability,
43         const ISystemAbilityManager::SAExtraProp& extraProp));
44     MOCK_METHOD(int32_t, AddSystemProcess, (const std::u16string& procName, const sptr<IRemoteObject>& procObject));
45     MOCK_METHOD(int32_t, LoadSystemAbility, (int32_t systemAbilityId,
46         const sptr<ISystemAbilityLoadCallback>& callback));
47     MOCK_METHOD(int32_t, LoadSystemAbility, (int32_t systemAbilityId, const std::string& deviceId,
48         const sptr<ISystemAbilityLoadCallback>& callback));
49     MOCK_METHOD(int32_t, UnloadSystemAbility, (int32_t systemAbilityId));
50     MOCK_METHOD(int32_t, CancelUnloadSystemAbility, (int32_t systemAbilityId));
51     MOCK_METHOD(int32_t, GetRunningSystemProcess, (std::list<SystemProcessInfo>& systemProcessInfos));
52     MOCK_METHOD(int32_t, SubscribeSystemProcess, (const sptr<ISystemProcessStatusChange>& listener));
53     MOCK_METHOD(int32_t, UnSubscribeSystemProcess, (const sptr<ISystemProcessStatusChange>& listener));
54 };
55 } // namespace Location
56 } // namespace OHOS
57 #endif