• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2020-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 UI_TEST_APP_LIST_H
17 #define UI_TEST_APP_LIST_H
18 
19 #include "components/root_view.h"
20 #include "components/ui_label.h"
21 #include "components/ui_label_button.h"
22 #include "components/ui_list.h"
23 #include "graphic_thread.h"
24 #include "test_case_list_adapter.h"
25 
26 namespace OHOS {
27 namespace {
28     constexpr char* UI_TEST_MAIN_LIST_ID = "main_list";
29     constexpr char* UI_TEST_BACK_BUTTON_ID = "back_button";
30 }
31 #ifdef _WIN32
32 DWORD AutoTestThread(LPVOID);
33 #elif defined __linux__ || defined __LITEOS__ || defined __APPLE__
34 void* AutoTestThread(void*);
35 #endif // _WIN32
36 class UITestApp {
37 public:
38     static UITestApp* GetInstance();
39     void Start();
40 
41 private:
UITestApp()42     UITestApp() {}
43     ~UITestApp();
44 
45     UITestApp(const UITestApp&) = delete;
46     UITestApp& operator=(const UITestApp&) = delete;
47     UITestApp(UITestApp&&) = delete;
48     UITestApp& operator=(UITestApp&&) = delete;
49 
50     void Init();
51     void InitMainMenu();
52     void InitBackBtn();
53     void InitTestLabel();
54     RootView* rootView_ = nullptr;
55     UIList* mainList_ = nullptr;
56     TestCaseListAdapter* adapter_ = nullptr;
57     UILabelButton* backBtn_ = nullptr;
58     UILabel* testCaseLabel_ = nullptr;
59     UILabel* testLabel_ = nullptr;
60     UILabelButton* autoTestBtn_ = nullptr;
61     UIViewGroup* mainMenu_ = nullptr;
62 };
63 } // namespace OHOS
64 #endif
65