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 MODULETEST_OHOS_ABILITY_RUNTIME_MOCK_APP_SCHEDULER_H 17 #define MODULETEST_OHOS_ABILITY_RUNTIME_MOCK_APP_SCHEDULER_H 18 19 #include "gmock/gmock.h" 20 #include "refbase.h" 21 #include "iremote_object.h" 22 #include "app_scheduler.h" 23 #include "app_launch_data.h" 24 #include "configuration.h" 25 26 namespace OHOS { 27 namespace AAFwk { 28 class MockAppScheduler : public AppScheduler { 29 public: 30 MockAppScheduler() = default; 31 virtual ~MockAppScheduler() = default; 32 33 MOCK_METHOD0(ScheduleForegroundApplication, void()); 34 MOCK_METHOD0(ScheduleBackgroundApplication, void()); 35 MOCK_METHOD0(ScheduleTerminateApplication, void()); 36 MOCK_METHOD2(ScheduleLaunchApplication, void(const AppExecFwk::AppLaunchData &, const Configuration &config)); 37 MOCK_METHOD3(ScheduleLaunchAbility, void(const AppExecFwk::AbilityInfo &, const sptr<IRemoteObject> &, 38 const std::shared_ptr<AAFwk::Want> &)); 39 MOCK_METHOD1(ScheduleCleanAbility, void(const sptr<IRemoteObject> &)); 40 MOCK_METHOD1(ScheduleProfileChanged, void(const AppExecFwk::Profile &)); 41 MOCK_METHOD1(ScheduleConfigurationUpdated, void(const AppExecFwk::Configuration &config)); 42 MOCK_METHOD1(ScheduleShrinkMemory, void(const int)); 43 MOCK_METHOD1(ScheduleMemoryLevel, void(int32_t level)); 44 MOCK_METHOD0(ScheduleLowMemory, void()); 45 }; 46 } // namespace AAFwk 47 } // namespace OHOS 48 #endif // MODULETEST_OHOS_ABILITY_RUNTIME_MOCK_APP_SCHEDULER_H 49