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 OHOS_ACE_COMPONENT_TEST_MANAGER_H
17 #define OHOS_ACE_COMPONENT_TEST_MANAGER_H
18 
19 #include "component_test/test_result_recorder.h"
20 #include "component_test/test_task_scheduler.h"
21 
22 #include "base/memory/referenced.h"
23 
24 namespace OHOS::Ace::ComponentTest {
25 class ComponentTestManager : public AceType {
26 public:
27     virtual void PostUITask(std::function<void(void*)>&& task, std::function<void(void*)>&& onFinish,
28         void* data = nullptr, uint32_t delay = 0) = 0;
29     virtual void PostJSTask(std::function<void(void*)>&& task, std::function<void(void*)>&& onFinish,
30         void* data = nullptr, uint32_t delay = 0) = 0;
31     virtual void SetTestCaseAttribute(TestCaseAttribute attribute) = 0;
32     virtual void Record(std::string info, std::string position, Result result) = 0;
33     virtual void Finish() = 0;
34     virtual void ClaimLongOperation() = 0;
35     virtual void LongOperationComplete() = 0;
36     virtual void RequestContinuousIdleStatusNotification(IdleNotifycallback&& notifycallback) = 0;
37     virtual ~ComponentTestManager() = default;
38 };
39 } // namespace OHOS::Ace::ComponentTest
40 
41 #endif // OHOS_ACE_COMPONENT_TEST_MANAGER_H
42