• 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_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 "ui_test.h"
23 
24 namespace OHOS {
25 class UITestArcLabel : public UITest {
26 public:
UITestArcLabel()27     UITestArcLabel() {}
~UITestArcLabel()28     ~UITestArcLabel() {}
29     void SetUp() override;
30     void TearDown() override;
31     const UIView* GetTestView() override;
32 
33     /**
34      * @brief Test display arc text from 0 to 270 INSIDE
35      */
36     void UIKitUIArcLabelTestDisplay001();
37 
38     /**
39      * @brief Test display arc text from 270 to 0 INSIDE
40      */
41     void UIKitUIArcLabelTestDisplay002();
42 
43     /**
44      * @brief Test display arc text from 0 to 270 OUTSIDE
45      */
46     void UIKitUIArcLabelTestDisplay003();
47 
48     /**
49      * @brief Test display arc text from 270 to 0 OUTSIDE
50      */
51     void UIKitUIArcLabelTestDisplay004();
52 
53     /**
54      * @brief Test arc text align LEFT
55      */
56     void UIKitUIArcLabelTestAlign001();
57 
58     /**
59      * @brief Test arc text align CENTER
60      */
61     void UIKitUIArcLabelTestAlign002();
62 
63     /**
64      * @brief Test arc text align RIGHT
65      */
66     void UIKitUIArcLabelTestAlign003();
67 
68 private:
69     UIScrollView* container_ = nullptr;
70 
71     void InnerTestTitle(const char* title, int16_t x, int16_t y) const;
72 
73     // for direction and orientation
74     void TestArcLabelDisplay(const char* title, const int16_t startAngle, const int16_t endAngle,
75         const TextOrientation orientation, int16_t x, int16_t y);
76 };
77 } // namespace OHOS
78 #endif // UI_TEST_ARC_LABEL_H
79