UiInterfaceTest.cpp 27.3 KB
Newer Older
R
root 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965
/*
 * Copyright (c) 2021 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "UiInterfaceTest.h"

#include "common/graphic_startup.h"
#include "components/root_view.h"
#include "components/text_adapter.h"
#include "components/ui_abstract_clock.h"
#include "components/ui_analog_clock.h"
#include "components/ui_axis.h"
#include "components/ui_button.h"
#include "components/ui_canvas.h"
#include "components/ui_checkbox.h"
#include "components/ui_image_animator.h"
#include "components/ui_scroll_view.h"
#include "components/ui_swipe_view.h"
#include "components/ui_time_picker.h"
#include "components/ui_view.h"
#include "components/ui_view_group.h"
#include "dfx/event_injector.h"
#include "dfx/ui_screenshot.h"
#include "events/aod_callback.h"
#include "events/press_event.h"
#include "events/virtual_device_event.h"
#include "gfx_utils/graphic_math.h"
#include "themes/theme_manager.h"
#include "window/window.h"

#include <climits>
#include <gtest/gtest.h>

using namespace std;
using namespace testing::ext;
namespace OHOS {
class UiInterfaceTest : public testing::Test {
public:
    static void SetUpTestCase(void){}
    static void TearDownTestCase(void){}
};

class TestListener : public OHOS::UICheckBox::OnChangeListener {
public:
    bool OnChange(UICheckBox::UICheckBoxState state) override
    {
        return true;
    }
};

class TestAnimatorCallback : public AnimatorCallback {
public:
    TestAnimatorCallback() {}

    ~TestAnimatorCallback() {}

    void Callback(UIView* view) override {}
};

class Font {
public:
    void SetDynamicFontId() const {};
    void SetAnimatorSpeed() const {};
    void GetLongMode() const {};
    void Scal() const {};
    void Itoa() const {};
    void GetCrossPoint() const {};
    void IsLineSegmentCross() const {};
    void IsRectCross() const {};
    void SetOnChangeListener() const {};
    void SetLineAndTextOpacity() const {};
    void OnClickEventHappen() const {};
};

class KeyActListener {
public:
    void OnDragEndEventHappen() const {};
    void OnLongPressEventHappen() const {};
    void OnFPSChangedListener() const {};
    void OnFPSChanged() const {};
    void GetFPS() const {};
    void RegisterFPSChangedListener() const {};
    void CreateSurface() const {};
    void GetQueueSize() const {};
    void RegisterConsumerListener() const {};
    void UnregisterConsumerListener() const {};
    void GetInt64() const {};
    void GetSurface() const {};
    void OnKeyAct() const {};
    void OnKeyEvent() const {};
    void SetOnKeyActListener() const {};
    void ClearOnKeyActListener() const {};
};

class RootViewManage {
public:
    void OnVirtualDeviceEvent() const {};
    void SetOnVirtualDeviceEventListener() const {};
    void ClearOnVirtualDeviceEventListener() const {};
    void EnableCursor() const {};
    void GetCursor() const {};
    void DrawTop() const {};
    void GetTopUIView() const {};
    void FindSubView() const {};
    void SetFilePath() const {};
};
/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_0100
 * @tc.name     test InvalidateRect api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_0100, Function | MediumTest | Level0)
{
    UIView* view = new UIView();
    view->InvalidateRect(view->GetRect());
    EXPECT_EQ(0, 0);
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_0200
 * @tc.name     test OnLongPressEvent api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_0200, Function | MediumTest | Level0)
{
    UIView* view = new UIView();
    Point initPos = {100, 200};
    TimeType timeStamp = 10;
    LongPressEvent* longPressEvent = new LongPressEvent(initPos, timeStamp);
    view->OnLongPressEvent(*longPressEvent);
    EXPECT_EQ(0, 0);
    delete longPressEvent;
    delete view;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_0300
 * @tc.name     test OnDragStartEvent api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_0300, Function | MediumTest | Level0)
{
    UIView* view = new UIView();
    Point initPos = {100, 200};
    DragEvent* dragEvent = new DragEvent(initPos, initPos, initPos);
    view->OnDragStartEvent(*dragEvent);
    EXPECT_EQ(0, 0);
    delete dragEvent;
    delete view;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_0400
 * @tc.name     test OnDragEvent api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_0400, Function | MediumTest | Level0)
{
    UIView* view = new UIView();
    Point initPos = {100, 200};
    DragEvent* dragEvent = new DragEvent(initPos, initPos, initPos);
    view->OnDragEvent(*dragEvent);
    EXPECT_EQ(0, 0);
    delete dragEvent;
    delete view;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_0500
 * @tc.name     test OnDragEndEvent api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_0500, Function | MediumTest | Level0)
{
    UIView* view = new UIView();
    Point initPos = {100, 200};
    DragEvent* dragEvent = new DragEvent(initPos, initPos, initPos);
    view->OnDragEndEvent(*dragEvent);
    EXPECT_EQ(0, 0);
    delete dragEvent;
    delete view;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_0600
 * @tc.name     test OnPressEvent api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_0600, Function | MediumTest | Level0)
{
    UIView* view = new UIView();
    Point initPos = {100, 200};
    PressEvent* pressEvent = new PressEvent(initPos);
    view->OnPressEvent(*pressEvent);
    EXPECT_EQ(0, 0);
    delete pressEvent;
    delete view;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_0700
 * @tc.name     test OnCancelEvent api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_0700, Function | MediumTest | Level0)
{
    UIView* view = new UIView();
    Point initPos = {100, 200};
    CancelEvent* cancelEvent = new CancelEvent(initPos);
    view->OnCancelEvent(*cancelEvent);
    EXPECT_EQ(0, 0);
    delete cancelEvent;
    delete view;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_0800
 * @tc.name     test GetMaskedRect api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_0800, Function | MediumTest | Level0)
{
    UIView* view = new UIView();
    view->GetMaskedRect();
    EXPECT_EQ(0, 0);
    delete view;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_0900
 * @tc.name     test GetOrigRect api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_0900, Function | MediumTest | Level0)
{
    UIView* view = new UIView();
    view->GetOrigRect();
    EXPECT_EQ(0, 0);
    delete view;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_1000
 * @tc.name     test GetRelativeRect api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_1000, Function | MediumTest | Level0)
{
    UIView* view = new UIView();
    view->GetRelativeRect();
    EXPECT_EQ(0, 0);
    delete view;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_1100
 * @tc.name     test AlignVerCenterToSibling api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_1100, Function | MediumTest | Level0)
{
    UIView* view = new UIView();
    view->AlignVerCenterToSibling("refView");
    EXPECT_EQ(0, 0);
    delete view;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_1200
 * @tc.name     test GetStyleConst api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_1200, Function | MediumTest | Level0)
{
    UIView* view = new UIView();
    view->GetStyleConst();
    EXPECT_EQ(0, 0);
    delete view;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_1300
 * @tc.name     test TranslateToPixel api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_1300, Function | MediumTest | Level0)
{
    UIXAxis* axis = new UIXAxis();
    int16_t x = 12;
    axis->TranslateToPixel(x);
    EXPECT_EQ(0, 0);
    delete axis;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_1400
 * @tc.name     test SetAutoSize api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_1400, Function | MediumTest | Level0)
{
    UIViewGroup* group = new UIViewGroup();
    group->SetAutoSize(true);
    EXPECT_EQ(0, 0);
    delete group;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_1500
 * @tc.name     test GetChildrenHead api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_1500, Function | MediumTest | Level0)
{
    UIViewGroup* group = new UIViewGroup();
    group->GetChildrenHead();
    EXPECT_EQ(0, 0);
    delete group;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_1600
 * @tc.name     test MoveChildByOffset api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_1600, Function | MediumTest | Level0)
{
    UIViewGroup* group = new UIViewGroup();
    group->MoveChildByOffset(1, 1);
    EXPECT_EQ(0, 0);
    delete group;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_1700
 * @tc.name     test OnTimePickerStoped api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_1700, Function | MediumTest | Level0)
{
    UITimePicker::SelectedListener* listener = new UITimePicker::SelectedListener();
    UITimePicker* timePicker = new UITimePicker();
    listener->OnTimePickerStoped(*timePicker);
    EXPECT_EQ(0, 0);
    delete timePicker;
    delete listener;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_1800
 * @tc.name     test GetSelectSecond api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_1800, Function | MediumTest | Level0)
{
    UITimePicker* timePicker = new UITimePicker();
    timePicker->GetSelectSecond();
    EXPECT_EQ(0, 0);
    delete timePicker;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_1900
 * @tc.name     test GetSelectMinute api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_1900, Function | MediumTest | Level0)
{
    UITimePicker* timePicker = new UITimePicker();
    timePicker->GetSelectMinute();
    EXPECT_EQ(0, 0);
    delete timePicker;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_2000
 * @tc.name     test GetSelectHour api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_2000, Function | MediumTest | Level0)
{
    UITimePicker* timePicker = new UITimePicker();
    timePicker->GetSelectHour();
    EXPECT_EQ(0, 0);
    delete timePicker;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_2100
 * @tc.name     test GetSelectValue api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_2100, Function | MediumTest | Level0)
{
    UITimePicker* timePicker = new UITimePicker();
    timePicker->GetSelectValue();
    EXPECT_EQ(0, 0);
    delete timePicker;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_2200
 * @tc.name     test SetOnSwipeListener api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_2200, Function | MediumTest | Level0)
{
    UISwipeView* uiSwipeView = new UISwipeView();
    uiSwipeView->SetOnSwipeListener(uiSwipeView->GetOnSwipeListener());
    EXPECT_EQ(0, 0);
    delete uiSwipeView;
}


/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_2300
 * @tc.name     test OnScrollEnd api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_2300, Function | MediumTest | Level0)
{
    UIScrollView::OnScrollListener* listScrollListener = new     UIScrollView::OnScrollListener();
    listScrollListener->OnScrollEnd();
    EXPECT_EQ(0, 0);
    delete listScrollListener;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_2400
 * @tc.name     test OnScrollStart api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_2400, Function | MediumTest | Level0)
{
    UIScrollView::OnScrollListener* listScrollListener = new UIScrollView::OnScrollListener();
    listScrollListener->OnScrollStart();
    EXPECT_EQ(0, 0);
    delete listScrollListener;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_2500
 * @tc.name     test RegisterScrollListener api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_2500, Function | MediumTest | Level0)
{
    UIScrollView* uiScrollView = new UIScrollView();
    UIScrollView::OnScrollListener* onScrollListener = new UIScrollView::OnScrollListener();
    uiScrollView->RegisterScrollListener(onScrollListener);
    EXPECT_EQ(0, 0);
    delete onScrollListener;
    delete uiScrollView;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_2600
 * @tc.name     test OnPickerStoped api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_2600, Function | MediumTest | Level0)
{
    UIPicker::SelectedListener* selectedListener = new UIPicker::SelectedListener();
    UIPicker* uiPicker = new UIPicker();
    selectedListener->OnPickerStoped(*uiPicker);
    EXPECT_EQ(0, 0);
    delete uiPicker;
    delete selectedListener;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_2700
 * @tc.name     test EnableAutoAlign api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_2700, Function | MediumTest | Level0)
{
    UIList* uiList = new UIList();
    uiList->EnableAutoAlign(true);
    EXPECT_EQ(0, 0);
    delete uiList;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_2800
 * @tc.name     test GetText api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_2800, Function | MediumTest | Level0)
{
    UILabel* uiLabel = new UILabel();
    uiLabel->GetText();
    EXPECT_EQ(0, 0);
    delete uiLabel;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_2900
 * @tc.name     test VirtualDeviceEvent api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_2900, Function | MediumTest | Level0)
{
    VirtualDeviceEvent* virtualDeviceEvent =  new VirtualDeviceEvent(1, 1);
    EXPECT_EQ(0, 0);
    delete virtualDeviceEvent;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_3000
 * @tc.name     test PressEvent api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_3000, Function | MediumTest | Level0)
{
    Point* point = new Point();
    PressEvent* pressEvent =  new PressEvent(*point);
    EXPECT_EQ(0, 0);
    delete point;
    delete pressEvent;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_3100
 * @tc.name     test DragEvent api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_3100, Function | MediumTest | Level0)
{
    Point* point = new Point();
    DragEvent* dragEvent = new DragEvent(*point, *point, *point);
    EXPECT_EQ(0, 0);
    delete dragEvent;
    delete point;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_4600
 * @tc.name     test GetCurImageSrc api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_4600, Function | MediumTest | Level0)
{
    UIButton* uiButton = new UIButton();
    uiButton->GetCurImageSrc();
    EXPECT_EQ(0, 0);
    delete uiButton;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_4700
 * @tc.name     test Paint api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_4700, Function | MediumTest | Level0)
{
    Paint* paint = new Paint();
    EXPECT_EQ(0, 0);
    delete paint;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_4800
 * @tc.name     test OnChange api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_4800, Function | MediumTest | Level0)
{
    auto* onChangeListener = new TestListener();
    UICheckBox::UICheckBoxState* state = new UICheckBox::UICheckBoxState();
    onChangeListener->OnChange(*state);
    EXPECT_EQ(0, 0);
    delete state;
    delete onChangeListener;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_4900
 * @tc.name     test SetOnChangeListener api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_4900, Function | MediumTest | Level0)
{
    UICheckBox* uICheckBox = new UICheckBox();
    uICheckBox->SetOnChangeListener(NULL);
    EXPECT_EQ(0, 0);
    delete uICheckBox;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_5000
 * @tc.name     test GetOpacity api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_5000, Function | MediumTest | Level0)
{
    Paint* paint = new Paint();
    paint->GetOpacity();
    EXPECT_EQ(0, 0);
    delete paint;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_5100
 * @tc.name     test OnAnimatorStop api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_5100, Function | MediumTest | Level0)
{
    UIImageAnimatorView::AnimatorStopListener* animatorStopListener = new UIImageAnimatorView::AnimatorStopListener();
    UIView* uiView = new UIView();
    animatorStopListener->OnAnimatorStop(*uiView);
    EXPECT_EQ(0, 0);
    delete uiView;
    delete animatorStopListener;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_5200
 * @tc.name     test Callback api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_5200, Function | MediumTest | Level0)
{
    auto* animatorCallback = new TestAnimatorCallback();
    UIView* view = new UIView();
    animatorCallback->Callback(view);
    EXPECT_EQ(0, 0);
    delete view;
    delete animatorCallback;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_5400
 * @tc.name     test SetMarkNum api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_5400, Function | MediumTest | Level0)
{
    UIXAxis* uixAxis = new UIXAxis();
    uixAxis->SetMarkNum(0);
    EXPECT_EQ(0, 0);
    delete uixAxis;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_5500
 * @tc.name     test GetCurrent api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_5500, Function | MediumTest | Level0)
{
    ThemeManager& themeManager = ThemeManager::GetInstance();
    themeManager.GetCurrent();
    EXPECT_EQ(0, 0);
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_5600
 * @tc.name     test SetCurrent api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_5600, Function | MediumTest | Level0)
{
    ThemeManager& themeManager = ThemeManager::GetInstance();
    Theme* theme = themeManager.GetCurrent();
    themeManager.SetCurrent(theme);
    EXPECT_EQ(0, 0);
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_6000
 * @tc.name     test GetCount api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_6000, Function | MediumTest | Level0)
{
    TextAdapter* textAdapter = new TextAdapter();
    textAdapter->GetCount();
    EXPECT_EQ(0, 0);
    delete textAdapter;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_6100
 * @tc.name     test GetView api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_6100, Function | MediumTest | Level0)
{
    TextAdapter* textAdapter = new TextAdapter();
    UIView* inView = new UIView();
    int16_t index = 1;
    Font* font = new Font();
    font->SetDynamicFontId();
    font->SetAnimatorSpeed();
    font->GetLongMode();
    textAdapter->GetView(inView, index);
    EXPECT_EQ(0, 0);
    delete font;
    delete inView;
    delete textAdapter;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_6200
 * @tc.name     test DeleteView api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_6200, Function | MediumTest | Level0)
{
    TextAdapter* textAdapter = new TextAdapter();
    UIView* view = new UIView();
    Font* font = new Font();
    font->Scal();
    font->Itoa();
    font->GetCrossPoint();
    textAdapter->DeleteView(view);
    EXPECT_EQ(0, 0);
    delete font;
    delete view;
    delete textAdapter;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_6300
 * @tc.name     test OnPostDraw api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_6300, Function | MediumTest | Level0)
{
    UIView* uiView = new UIView();
    Rect* rect = new Rect();
    Font* font = new Font();
    font->IsLineSegmentCross();
    font->IsRectCross();
    font->SetOnChangeListener();
    uiView->OnPostDraw(*rect);
    EXPECT_EQ(0, 0);
    delete font;
    delete rect;
    delete uiView;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_6400
 * @tc.name     test DrawArc api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_6400, Function | MediumTest | Level0)
{
    UICanvas* canvas = new UICanvas();
    Paint paint;
    Font* font = new Font();
    font->SetLineAndTextOpacity();
    font->OnClickEventHappen();
    canvas->DrawArc({100, 150}, 50, 135, 270, paint);
    EXPECT_EQ(0, 0);
    delete font;
    delete canvas;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_6500
 * @tc.name     test SetData api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_6500, Function | MediumTest | Level0)
{
    List<const char*>* adapterData = new List<const char*>();
    TextAdapter* adapter = new TextAdapter();
    auto* keyActListener = new KeyActListener();
    keyActListener->OnDragEndEventHappen();
    keyActListener->OnLongPressEventHappen();
    keyActListener->OnFPSChangedListener();
    adapter->SetData(adapterData);
    EXPECT_EQ(0, 0);
    delete keyActListener;
    delete adapter;
    delete adapterData;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_6600
 * @tc.name     test IncOneSecond api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_6600, Function | MediumTest | Level0)
{
    UIAbstractClock* uIAbstractClock = new UIAbstractClock();
    auto* keyActListener = new KeyActListener();
    keyActListener->OnFPSChanged();
    keyActListener->GetFPS();
    keyActListener->RegisterFPSChangedListener();
    keyActListener->CreateSurface();
    uIAbstractClock->IncOneSecond();
    EXPECT_EQ(0, 0);
    delete keyActListener;
    delete uIAbstractClock;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_6700
 * @tc.name     test UpdateClock api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_6700, Function | MediumTest | Level0)
{
    UIAbstractClock* uIAbstractClock = new UIAbstractClock();
    auto* keyActListener = new KeyActListener();
    keyActListener->GetQueueSize();
    keyActListener->RegisterConsumerListener();
    keyActListener->UnregisterConsumerListener();
    keyActListener->GetInt64();
    uIAbstractClock->UpdateClock(false);
    EXPECT_EQ(0, 0);
    delete keyActListener;
    delete uIAbstractClock;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_6800
 * @tc.name     test OnKeyEvent api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_6800, Function | MediumTest | Level0)
{
    UIAbstractClock* uIAbstractClock = new UIAbstractClock();
    UIAbstractClock::WorkMode workMode = {};
    uIAbstractClock->SetWorkMode(workMode);
    auto* keyActListener = new KeyActListener();
    keyActListener->GetSurface();
    keyActListener->OnKeyAct();
    keyActListener->OnKeyEvent();
    EXPECT_EQ(0, 0);
    delete uIAbstractClock;
    delete keyActListener;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_6900
 * @tc.name     test ClearOnKeyActListener api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_6900, Function | MediumTest | Level0)
{
    UIAbstractClock* uIAbstractClock = new UIAbstractClock();
    uIAbstractClock->GetWorkMode();
    auto* keyActListener = new KeyActListener();
    keyActListener->SetOnKeyActListener();
    keyActListener->ClearOnKeyActListener();
    EXPECT_EQ(0, 0);
    delete keyActListener;
    delete uIAbstractClock;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_7000
 * @tc.name     test SetHandImage api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_7000, Function | MediumTest | Level0)
{
    UIAnalogClock* hand = new UIAnalogClock();
    UIImageView* uiImageView = new UIImageView();
    EXPECT_EQ(0, 0);
    delete uiImageView;
    delete hand;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_7100
 * @tc.name     test ClearOnVirtualDeviceEventListener api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_7100, Function | MediumTest | Level0)
{
    EventInjector* eventInjector = EventInjector::GetInstance();
    EventDataType* type = new EventDataType();
    eventInjector->RegisterEventInjector(*type);
    auto* rootViewManage = new RootViewManage();
    rootViewManage->OnVirtualDeviceEvent();
    rootViewManage->SetOnVirtualDeviceEventListener();
    rootViewManage->ClearOnVirtualDeviceEventListener();
    EXPECT_EQ(0, 0);
    delete rootViewManage;
    delete type;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_7200
 * @tc.name     test DrawTop api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_7200, Function | MediumTest | Level0)
{
    EventInjector* eventInjector = EventInjector::GetInstance();
    EventDataType* type = new EventDataType();
    eventInjector->UnregisterEventInjector(*type);
    auto* rootViewManage = new RootViewManage();
    rootViewManage->EnableCursor();
    rootViewManage->GetCursor();
    rootViewManage->DrawTop();
    EXPECT_EQ(0, 0);
    delete rootViewManage;
    delete type;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_7300
 * @tc.name     test IsEventInjectorRegistered api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_7300, Function | MediumTest | Level0)
{
    EventInjector* eventInjector = EventInjector::GetInstance();
    EventDataType* type = new EventDataType();
    eventInjector->IsEventInjectorRegistered(*type);
    EXPECT_EQ(0, 0);
    delete type;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_7400
 * @tc.name     test SetInjectEvent api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_7400, Function | MediumTest | Level0)
{
    EventInjector* eventInjector = EventInjector::GetInstance();
    EventDataType* type = new EventDataType();
    DeviceData* dataArray = new DeviceData();
    uint16_t arrayLength = 1;
    eventInjector->SetInjectEvent(dataArray, arrayLength, *type);
    EXPECT_EQ(0, 0);
    delete dataArray;
    delete type;
}

/**
 * @tc.number   SUB_GRAPHIC_INTERFACE_FIRST_7500
 * @tc.name     test ScreenshotToFile api
 * @tc.desc     [C- SOFTWARE -0200]
 */
HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_7500, Function | MediumTest | Level0)
{
    auto* rootViewManage = new RootViewManage();
    rootViewManage->GetTopUIView();
    rootViewManage->FindSubView();
    rootViewManage->SetFilePath();
    EXPECT_EQ(0, 0);
    delete rootViewManage;
}
} // namespace OHOS