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_METHOD1(ScheduleSaveAbilityState, void(PacMap &)); 31 MOCK_METHOD1(ScheduleRestoreAbilityState, void(const PacMap &)); 32 MOCK_METHOD1(ScheduleUpdateConfiguration, void(const DummyConfiguration &)); 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_METHOD1(GetType, std::string(const Uri &uri)); 41 MOCK_METHOD2(OpenRawFile, int(const Uri &uri, const std::string &mode)); 42 MOCK_METHOD2(Reload, bool(const Uri &uri, const PacMap &extras)); 43 MOCK_METHOD2(BatchInsert, int(const Uri &uri, const std::vector<NativeRdb::ValuesBucket> &values)); 44 MOCK_METHOD1(NormalizeUri, Uri(const Uri &)); 45 MOCK_METHOD1(DenormalizeUri, Uri(const Uri &)); 46 MOCK_METHOD2(NotifyMultiWinModeChanged, void(int32_t winModeKey, bool flag)); 47 MOCK_METHOD1(NotifyTopActiveAbilityChanged, void(bool flag)); 48 MOCK_METHOD2(ScheduleRegisterObserver, bool(const Uri &uri, const sptr<AAFwk::IDataAbilityObserver> &dataObserver)); 49 MOCK_METHOD2( 50 ScheduleUnregisterObserver, bool(const Uri &uri, const sptr<AAFwk::IDataAbilityObserver> &dataObserver)); 51 MOCK_METHOD1(ScheduleNotifyChange, bool(const Uri &uri)); 52 MOCK_METHOD1(ExecuteBatch, std::vector<std::shared_ptr<AppExecFwk::DataAbilityResult>>( 53 const std::vector<std::shared_ptr<AppExecFwk::DataAbilityOperation>> &operations)); 54 }; 55 } // namespace AAFwk 56 } // namespace OHOS 57 #endif // FOUNDATION_AAFWK_SERVICES_TEST_MT_MOCK_ABILITY_SCHEDULER_STUB_H 58