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_ARC_LABEL_H 17 #define UI_TEST_ARC_LABEL_H 18 19 #include "components/ui_arc_label.h" 20 #include "components/ui_label.h" 21 #include "components/ui_scroll_view.h" 22 #include "components/ui_label_button.h" 23 #include "ui_test.h" 24 25 namespace OHOS { 26 class UITestArcLabel : public UITest { 27 public: UITestArcLabel()28 UITestArcLabel() {} ~UITestArcLabel()29 ~UITestArcLabel() {} 30 void SetUp() override; 31 void TearDown() override; 32 const UIView* GetTestView() override; 33 34 /** 35 * @brief Test display arc text from 0 to 270 INSIDE 36 */ 37 void UIKitUIArcLabelTestDisplay001(); 38 39 /** 40 * @brief Test display arc text from 270 to 0 INSIDE 41 */ 42 void UIKitUIArcLabelTestDisplay002(); 43 44 /** 45 * @brief Test display arc text from 0 to 270 OUTSIDE 46 */ 47 void UIKitUIArcLabelTestDisplay003(); 48 49 /** 50 * @brief Test display arc text from 270 to 0 OUTSIDE 51 */ 52 void UIKitUIArcLabelTestDisplay004(); 53 54 /** 55 * @brief Test arc text align LEFT 56 */ 57 void UIKitUIArcLabelTestAlign001(); 58 59 /** 60 * @brief Test arc text align CENTER 61 */ 62 void UIKitUIArcLabelTestAlign002(); 63 64 /** 65 * @brief Test arc text align RIGHT 66 */ 67 void UIKitUIArcLabelTestAlign003(); 68 69 /** 70 * @brief Test display arc text from 0 to 90 71 */ 72 void UIKitUIArcLabelTestIncompatible001(); 73 74 /** 75 * @brief Test display arc text from 90 to 0 76 */ 77 void UIKitUIArcLabelTestIncompatible002(); 78 79 /** 80 * @brief Test display arc text from 30 to 260 81 */ 82 void UIKitUIArcLabelTestIncompatible003(); 83 84 /** 85 * @brief Test display arc text from 260 to 30 86 */ 87 void UIKitUIArcLabelTestIncompatible004(); 88 89 private: 90 UIScrollView* container_ = nullptr; 91 92 void InnerTestTitle(const char* title, int16_t x, int16_t y) const; 93 94 // for direction and orientation 95 void TestArcLabelDisplay(const char* title, const int16_t startAngle, const int16_t endAngle, 96 const TextOrientation orientation, int16_t x, int16_t y); 97 98 UILabelButton* GetTestUIButton(const char* buttonText, int16_t x, int16_t y, const char* id); 99 }; 100 } // namespace OHOS 101 #endif // UI_TEST_ARC_LABEL_H 102