1 /* 2 * Copyright (c) 2024 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 DISTRIBUTED_SCHED_STUB_TEST_H 17 #define DISTRIBUTED_SCHED_STUB_TEST_H 18 19 #include "distributed_sched_interface.h" 20 #include "event_handler.h" 21 #include "iremote_stub.h" 22 #include "gtest/gtest.h" 23 #ifdef SUPPORT_DISTRIBUTED_MISSION_MANAGER 24 #include "mission/snapshot.h" 25 #endif 26 27 #define private public 28 #include "distributed_sched_stub.h" 29 #undef private 30 31 namespace OHOS { 32 namespace DistributedSchedule { 33 class DistributedSchedStubTest : public testing::Test { 34 public: 35 static void SetUpTestCase(); 36 static void TearDownTestCase(); 37 void SetUp(); 38 void TearDown(); 39 void WaitHandlerTaskDone(const std::shared_ptr<AppExecFwk::EventHandler> &handler); 40 void CallerInfoMarshalling(const CallerInfo& callerInfo, MessageParcel& data); 41 void FreeInstallInfoMarshalling(const CallerInfo& callerInfo, 42 const DistributedSchedService::AccountInfo accountInfo, const int64_t taskId, MessageParcel& data); 43 bool isTaskDone_; 44 std::mutex taskDoneLock_; 45 std::condition_variable taskDoneCondition_; 46 }; 47 } // namespace DistributedSchedule 48 } // namespace OHOS 49 #endif // DISTRIBUTED_SCHED_STUB_TEST_H