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_PROXY_H
17 #define OHOS_ACE_COMPONENT_TEST_PROXY_H
18 
19 #include "component_test/component_test_manager_impl.h"
20 
21 #include "base/memory/ace_type.h"
22 #include "core/common/container.h"
23 
24 namespace OHOS::Ace::ComponentTest {
25 class ACE_FORCE_EXPORT ComponentTestManagerProxy {
26 public:
27     static void PostUITask(std::function<void(void*)>&& task, std::function<void(void*)>&& onFinish,
28         void* data = nullptr, uint32_t delay = 0);
29     static void PostJSTask(std::function<void(void*)>&& task, std::function<void(void*)>&& onFinish,
30         void* data = nullptr, uint32_t delay = 0);
31     static void SetTestCaseAttribute(TestCaseAttribute attribute);
32     static void Record(std::string info, std::string position, Result result);
33     static void Finish();
34     static void ClaimLongOperation();
35     static void LongOperationComplete();
36     static void RequestContinuousIdleStatusNotification(IdleNotifycallback&& notifycallback);
37     static std::string GetTestConfigPage();
38     static bool IsComponentTestEnabled();
39 
40 private:
41     static RefPtr<ComponentTestManager> GetCurrentComponentTestManager();
42 };
43 } // namespace OHOS::Ace::ComponentTest
44 
45 #endif // OHOS_ACE_COMPONENT_TEST_PROXY_H
46