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 class UITestBorderMarginPadding : public UITest { 35 public: UITestBorderMarginPadding()36 UITestBorderMarginPadding() 37 { 38 style_ = StyleDefault::GetDefaultStyle(); 39 style_.bgOpa_ = OPA_OPAQUE; 40 style_.bgColor_ = Color::Gray(); 41 } ~UITestBorderMarginPadding()42 virtual ~UITestBorderMarginPadding() {} 43 void SetUp() override; 44 void TearDown() override; 45 const UIView* GetTestView() override; 46 void ReloadTest(); 47 48 void UIKit_UITestBorderMarginPadding_Test_001(); 49 void UIKit_UITestBorderMarginPadding_Test_002(); 50 void UIKit_UITestBorderMarginPadding_Test_003(); 51 void UIKit_UITestBorderMarginPadding_Test_004(); 52 void UIKit_UITestBorderMarginPadding_Test_005(); 53 void UIKit_UITestBorderMarginPadding_Test_006(); 54 void UIKit_UITestBorderMarginPadding_Test_007(); 55 void UIKit_UITestBorderMarginPadding_Test_008(); 56 void UIKit_UITestBorderMarginPadding_Test_009(); 57 void UIKit_UITestBorderMarginPadding_Test_010(); 58 void UIKit_UITestBorderMarginPadding_Test_011(); 59 void UIKit_UITestBorderMarginPadding_Test_012(); 60 void UIKit_UITestBorderMarginPadding_Test_013(); 61 void UIKit_UITestBorderMarginPadding_Test_014(); 62 void UIKit_UITestBorderMarginPadding_Test_015(); 63 void UIKit_UITestBorderMarginPadding_Test_016(); 64 void UIKit_UITestBorderMarginPadding_Test_017(); 65 void UIKit_UITestBorderMarginPadding_Test_018(); 66 Style style_; 67 68 private: 69 const int16_t TITLE_HEIGHT = 29; 70 const int16_t BUTTON_GROUP_WIDTH = 250; 71 UIScrollView* scroll_ = nullptr; 72 GridLayout* layoutButton_ = nullptr; 73 ListLayout* listScroll_ = nullptr; 74 UIViewGroup* container_ = nullptr; 75 MarginListener* marginListener_ = nullptr; 76 BorderListener* borderListener_ = nullptr; 77 PaddingListener* paddingListener_ = nullptr; 78 UIChartPolyline* chart_ = nullptr; 79 UIChartDataSerial* dataSerial_ = nullptr; 80 TextAdapter* adapter_ = nullptr; 81 List<const char*>* adapterData_ = nullptr; 82 UIPicker* picker_ = nullptr; 83 84 void AddTitle(const char* text); 85 }; 86 } // namespace OHOS 87 #endif // UI_TEST_BORDER_MARGIN_PADDING_H 88