1 /* 2 * Copyright (c) 2021 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 FOUNDATION_AAFWK_SERVICES_TEST_MT_MOCK_ABILITY_SCHEDULER_STUB_H 17 #define FOUNDATION_AAFWK_SERVICES_TEST_MT_MOCK_ABILITY_SCHEDULER_STUB_H 18 19 #include "ability_scheduler_stub.h" 20 21 namespace OHOS { 22 namespace AAFwk { 23 class MockAbilitySchedulerStub : public AbilitySchedulerStub { 24 public: 25 MOCK_METHOD2(ScheduleAbilityTransaction, void(const Want &, const LifeCycleStateInfo &)); 26 MOCK_METHOD3(SendResult, void(int, int, const Want &)); 27 MOCK_METHOD1(ScheduleConnectAbility, void(const Want &)); 28 MOCK_METHOD1(ScheduleDisconnectAbility, void(const Want &)); 29 MOCK_METHOD3(ScheduleCommandAbility, void(const Want &, bool, int)); 30 MOCK_METHOD0(ScheduleSaveAbilityState, void()); 31 MOCK_METHOD1(ScheduleRestoreAbilityState, void(const PacMap &)); 32 MOCK_METHOD1(ScheduleUpdateConfiguration, void(const AppExecFwk::Configuration &)); 33 MOCK_METHOD2(GetFileTypes, std::vector<std::string>(const Uri &, const std::string &)); 34 MOCK_METHOD2(OpenFile, int(const Uri &, const std::string &)); 35 MOCK_METHOD2(Insert, int(const Uri &, const NativeRdb::ValuesBucket &)); 36 MOCK_METHOD3(Update, int(const Uri &, const NativeRdb::ValuesBucket &, const NativeRdb::DataAbilityPredicates &)); 37 MOCK_METHOD2(Delete, int(const Uri &, const NativeRdb::DataAbilityPredicates &)); 38 MOCK_METHOD3(Query, std::shared_ptr<NativeRdb::AbsSharedResultSet>( 39 const Uri &, std::vector<std::string> &, const NativeRdb::DataAbilityPredicates &)); 40 MOCK_METHOD4(Call, std::shared_ptr<PacMap>(const Uri &, const std::string &, const std::string &, const PacMap &)); 41 MOCK_METHOD1(GetType, std::string(const Uri &uri)); 42 MOCK_METHOD2(OpenRawFile, int(const Uri &uri, const std::string &mode)); 43 MOCK_METHOD2(Reload, bool(const Uri &uri, const PacMap &extras)); 44 MOCK_METHOD2(BatchInsert, int(const Uri &uri, const std::vector<NativeRdb::ValuesBucket> &values)); 45 MOCK_METHOD1(NormalizeUri, Uri(const Uri &)); 46 MOCK_METHOD1(DenormalizeUri, Uri(const Uri &)); 47 #ifdef SUPPORT_GRAPHICS 48 MOCK_METHOD2(NotifyMultiWinModeChanged, void(int32_t winModeKey, bool flag)); 49 MOCK_METHOD1(NotifyTopActiveAbilityChanged, void(bool flag)); 50 #endif 51 MOCK_METHOD2(ScheduleRegisterObserver, bool(const Uri &uri, const sptr<AAFwk::IDataAbilityObserver> &dataObserver)); 52 MOCK_METHOD2( 53 ScheduleUnregisterObserver, bool(const Uri &uri, const sptr<AAFwk::IDataAbilityObserver> &dataObserver)); 54 MOCK_METHOD1(ScheduleNotifyChange, bool(const Uri &uri)); 55 MOCK_METHOD1(ExecuteBatch, std::vector<std::shared_ptr<AppExecFwk::DataAbilityResult>>( 56 const std::vector<std::shared_ptr<AppExecFwk::DataAbilityOperation>> &operations)); 57 MOCK_METHOD1(NotifyContinuationResult, void(int32_t result)); 58 MOCK_METHOD1(ContinueAbility, void(const std::string& deviceId)); 59 MOCK_METHOD2(DumpAbilityInfo, void(const std::vector<std::string> ¶ms, std::vector<std::string> &info)); 60 CallRequest()61 virtual sptr<IRemoteObject> CallRequest() 62 { 63 return sptr<IRemoteObject>(nullptr); 64 } 65 }; 66 } // namespace AAFwk 67 } // namespace OHOS 68 #endif // FOUNDATION_AAFWK_SERVICES_TEST_MT_MOCK_ABILITY_SCHEDULER_STUB_H 69