ui_test_app.h 1.9 KB
Newer Older
M
mamingshuai 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
/*
 * Copyright (c) 2020-2021 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef UI_TEST_APP_LIST_H
#define UI_TEST_APP_LIST_H

#include "components/root_view.h"
#include "components/ui_label.h"
#include "components/ui_label_button.h"
#include "components/ui_list.h"
23
#include "graphic_thread.h"
M
mamingshuai 已提交
24 25 26
#include "test_case_list_adapter.h"

namespace OHOS {
Z
zhdengc 已提交
27 28 29 30
namespace {
    constexpr char* UI_TEST_MAIN_LIST_ID = "main_list";
    constexpr char* UI_TEST_BACK_BUTTON_ID = "back_button";
}
31 32 33 34 35
#ifdef _WIN32
DWORD AutoTestThread(LPVOID);
#elif defined __linux__ || defined __LITEOS__ || defined __APPLE__
void* AutoTestThread(void*);
#endif // _WIN32
M
mamingshuai 已提交
36 37
class UITestApp {
public:
Z
zhdengc 已提交
38
    static UITestApp* GetInstance();
M
mamingshuai 已提交
39 40 41 42 43 44 45 46 47 48 49
    void Start();

private:
    UITestApp() {}
    ~UITestApp();

    UITestApp(const UITestApp&) = delete;
    UITestApp& operator=(const UITestApp&) = delete;
    UITestApp(UITestApp&&) = delete;
    UITestApp& operator=(UITestApp&&) = delete;

50 51 52 53
    void Init();
    void InitMainMenu();
    void InitBackBtn();
    void InitTestLabel();
M
mamingshuai 已提交
54 55 56 57 58 59
    RootView* rootView_ = nullptr;
    UIList* mainList_ = nullptr;
    TestCaseListAdapter* adapter_ = nullptr;
    UILabelButton* backBtn_ = nullptr;
    UILabel* testCaseLabel_ = nullptr;
    UILabel* testLabel_ = nullptr;
60 61
    UILabelButton* autoTestBtn_ = nullptr;
    UIViewGroup* mainMenu_ = nullptr;
Z
zhdengc 已提交
62
};
M
mamingshuai 已提交
63
} // namespace OHOS
Z
zhdengc 已提交
64
#endif