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_DRAW_RECT_H 17 #define UI_TEST_DRAW_RECT_H 18 19 #include "components/ui_button.h" 20 #include "components/ui_label.h" 21 #include "components/ui_scroll_view.h" 22 #include "ui_test.h" 23 24 namespace OHOS { 25 class UITestDrawRect : public UITest { 26 public: UITestDrawRect()27 UITestDrawRect() {} ~UITestDrawRect()28 ~UITestDrawRect() {} 29 void SetUp() override; 30 void TearDown() override; 31 const UIView* GetTestView() override; 32 33 void UIKit_DrawRect_Test_RectNoBorder_001(); 34 void UIKit_DrawRect_Test_RectNoBorder_002(); 35 void UIKit_DrawRect_Test_RectNoBorder_003(); 36 void UIKit_DrawRect_Test_RectNoBorder_004(); 37 void UIKit_DrawRect_Test_RectNoBorder_005(); 38 void UIKit_DrawRect_Test_RectNoBorder_006(); 39 void UIKit_DrawRect_Test_RectNoBorder_007(); 40 void UIKit_DrawRect_Test_RectNoBorder_008(); 41 void UIKit_DrawRect_Test_RectNoBorder_009(); 42 void UIKit_DrawRect_Test_RectNoBorder_0010(); 43 void UIKit_DrawRect_Test_RectBorderNoRadius_001(); 44 void UIKit_DrawRect_Test_RectBorderNoRadius_002(); 45 void UIKit_DrawRect_Test_RectBorderRadius_001(); 46 void UIKit_DrawRect_Test_RectBorderRadius_002(); 47 void UIKit_DrawRect_Test_RectBorderRadius_003(); 48 void UIKit_DrawRect_Test_RectBorderRadius_004(); 49 void UIKit_DrawRect_Test_RectBorderRadius_005(); 50 void UIKit_DrawRect_Test_RectBorderRadius_006(); 51 void UIKit_DrawRect_Test_RectBorderRadius_007(); 52 void UIKit_DrawRect_Test_RectBorderRadius_008(); 53 void UIKit_DrawRect_Test_RectBorderRadius_009(); 54 void UIKit_DrawRect_Test_RectBorderRadius_010(); 55 void UIKit_DrawRect_Test_RectBorderRadius_011(); 56 57 /** 58 * @brief Test draw rect function 59 */ 60 void UIKit_DrawRect_Test_Rect_001(); 61 62 /** 63 * @brief Test draw rect background color 64 */ 65 void UIKit_DrawRect_Test_RectColor_001(); 66 67 /** 68 * @brief Test draw rect radius is 0 69 */ 70 void UIKit_DrawRect_Test_RectRadius_001(); 71 72 /** 73 * @brief Test draw rect radius 74 */ 75 void UIKit_DrawRect_Test_RectRadius_002(); 76 77 /** 78 * @brief Test draw rect radius equal width 79 */ 80 void UIKit_DrawRect_Test_RectRadius_003(); 81 82 /** 83 * @brief Test draw rect radius equal width and height 84 */ 85 void UIKit_DrawRect_Test_RectRadius_004(); 86 87 /** 88 * @brief Test draw rect opacity is not transparent 89 */ 90 void UIKit_DrawRect_Test_RectOpacity_001(); 91 92 /** 93 * @brief Test draw rect opacity is transparent 94 */ 95 void UIKit_DrawRect_Test_RectOpacity_002(); 96 97 /** 98 * @brief Test draw rect opacity with different value 99 */ 100 void UIKit_DrawRect_Test_RectOpacity_003(); 101 102 /** 103 * @brief Test draw rect border color with different value 104 */ 105 void UIKit_DrawRect_Test_RectBorderColor_001(); 106 107 /** 108 * @brief Test draw rect border width is 0 109 */ 110 void UIKit_DrawRect_Test_RectBorderWidth_001(); 111 112 /** 113 * @brief Test draw rect border with different value 114 */ 115 void UIKit_DrawRect_Test_RectBorderWidth_002(); 116 117 /** 118 * @brief Test draw rect border opacity is not transparent 119 */ 120 void UIKit_DrawRect_Test_RectBorderOpacity_001(); 121 122 /** 123 * @brief Test draw rect border opacity is transparent 124 */ 125 void UIKit_DrawRect_Test_RectBorderOpacity_002(); 126 127 /** 128 * @brief Test draw rect border opacity with different value 129 */ 130 void UIKit_DrawRect_Test_RectBorderOpacity_003(); 131 132 /** 133 * @brief Test draw rect padding is 0 134 */ 135 void UIKit_DrawRect_Test_RectPadding_001(); 136 137 /** 138 * @brief Test draw rect padding with different value 139 */ 140 void UIKit_DrawRect_Test_RectPadding_002(); 141 142 /** 143 * @brief Test draw rect margin is 0 144 */ 145 void UIKit_DrawRect_Test_RectMargin_001(); 146 147 /** 148 * @brief Test draw rect margin is not 0 149 */ 150 void UIKit_DrawRect_Test_RectMargin_002(); 151 152 /** 153 * @brief Test draw rect padding and margin is 0 154 */ 155 void UIKit_DrawRect_Test_RectPaddingMargin_001(); 156 157 /** 158 * @brief Test draw rect padding and margin with different value 159 */ 160 void UIKit_DrawRect_Test_RectPaddingMargin_002(); 161 162 /** 163 * @brief Test rect width is 0 164 */ 165 void UIKit_DrawRect_Test_RectWidthAndHeight_001(); 166 167 /** 168 * @brief Test rect height is 0 169 */ 170 void UIKit_DrawRect_Test_RectWidthAndHeight_002(); 171 172 /** 173 * @brief Test rect width and height is 0 174 */ 175 void UIKit_DrawRect_Test_RectWidthAndHeight_003(); 176 177 private: 178 UIViewGroup* CreateTestCaseGroup() const; 179 UILabel* CreateTitleLabel() const; 180 UIView* CreateUIView() const; 181 UIScrollView* container_ = nullptr; 182 }; 183 } // namespace OHOS 184 #endif // UI_TEST_DRAW_RECT_H 185