• 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_BORDER_MARGIN_PADDING_H
17 #define UI_TEST_BORDER_MARGIN_PADDING_H
18 
19 #include "components/text_adapter.h"
20 #include "components/ui_chart.h"
21 #include "components/ui_label.h"
22 #include "components/ui_picker.h"
23 #include "components/ui_scroll_view.h"
24 #include "components/ui_toggle_button.h"
25 #include "layout/grid_layout.h"
26 #include "layout/list_layout.h"
27 #include "ui_test.h"
28 
29 namespace OHOS {
30 class BorderListener;
31 class MarginListener;
32 class PaddingListener;
33 
34 constexpr char* UI_TEST_MARGIN_BTN = "margin_btn";
35 constexpr char* UI_TEST_BORDER_BTN = "border_btn";
36 constexpr char* UI_TEST_PADDING_BTN = "padding_btn";
37 
38 class UITestBorderMarginPadding : public UITest {
39 public:
UITestBorderMarginPadding()40     UITestBorderMarginPadding()
41     {
42         style_ = StyleDefault::GetDefaultStyle();
43         style_.bgOpa_ = OPA_OPAQUE;
44         style_.bgColor_ = Color::Gray();
45     }
~UITestBorderMarginPadding()46     virtual ~UITestBorderMarginPadding() {}
47     void SetUp() override;
48     void TearDown() override;
49     const UIView* GetTestView() override;
50     void ReloadTest();
51 
52     void UIKitUITestBorderMarginPaddingTest001();
53     void UIKitUITestBorderMarginPaddingTest002();
54     void UIKitUITestBorderMarginPaddingTest003();
55     void UIKitUITestBorderMarginPaddingTest004();
56     void UIKitUITestBorderMarginPaddingTest005();
57     void UIKitUITestBorderMarginPaddingTest006();
58     void UIKitUITestBorderMarginPaddingTest007();
59     void UIKitUITestBorderMarginPaddingTest008();
60     void UIKitUITestBorderMarginPaddingTest009();
61     void UIKitUITestBorderMarginPaddingTest010();
62     void UIKitUITestBorderMarginPaddingTest011();
63     void UIKitUITestBorderMarginPaddingTest012();
64     void UIKitUITestBorderMarginPaddingTest013();
65     void UIKitUITestBorderMarginPaddingTest014();
66     void UIKitUITestBorderMarginPaddingTest015();
67     void UIKitUITestBorderMarginPaddingTest016();
68     void UIKitUITestBorderMarginPaddingTest017();
69     void UIKitUITestBorderMarginPaddingTest018();
70     void InitStyle();
71     Style style_;
72 
73 private:
74     const int16_t TITLE_HEIGHT = 29;
75     const int16_t BUTTON_GROUP_WIDTH = 250;
76     UIScrollView* scroll_ = nullptr;
77     GridLayout* layoutButton_ = nullptr;
78     ListLayout* listScroll_ = nullptr;
79     UIViewGroup* container_ = nullptr;
80     MarginListener* marginListener_ = nullptr;
81     BorderListener* borderListener_ = nullptr;
82     PaddingListener* paddingListener_ = nullptr;
83     UIChartPolyline* chart_ = nullptr;
84     UIChartDataSerial* dataSerial_ = nullptr;
85     TextAdapter* adapter_ = nullptr;
86     List<const char*>* adapterData_ = nullptr;
87     UIPicker* picker_ = nullptr;
88 
89     void AddTitle(const char* text);
90 };
91 } // namespace OHOS
92 #endif // UI_TEST_BORDER_MARGIN_PADDING_H
93