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_RENDER_H
17 #define UI_TEST_RENDER_H
18 
19 #include "components/ui_label.h"
20 #include "components/ui_label_button.h"
21 #include "components/ui_scroll_view.h"
22 #include "ui_test.h"
23 
24 namespace OHOS {
25 namespace {
26     constexpr char* UI_TEST_RENDER_ID = "Render";
27     constexpr char* UI_TEST_RENDER_UPDATA_BUTTON_ID_01 = "test_render_updata_buttin_01";
28 }
29 class UITestRender : public UITest, public UIView::OnClickListener {
30 public:
UITestRender()31     UITestRender() : container_(nullptr) {}
~UITestRender()32     ~UITestRender() {}
33     void SetUp() override;
34     void TearDown() override;
35     const UIView* GetTestView() override;
36     bool OnClick(UIView& view, const ClickEvent& event) override;
37 
38     /**
39      * @brief Test render Function
40      */
41     void UIKitRenderTestRender001();
42 
43     /**
44      * @brief Test render measure Function
45      */
46     void UIKitRenderTestRenderMeasure001();
47 
48 private:
49     UIViewGroup* CreateTestCaseGroup() const;
50     UILabel* CreateTitleLabel() const;
51     UIScrollView* container_ = nullptr;
52     UILabel* testLabel_ = nullptr;
53     UILabelButton* labelButton_ = nullptr;
54 };
55 } // namespace OHOS
56 #endif // UI_TEST_RENDER_H
57