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 #ifndef UI_TEST_DIALOG_H 16 #define UI_TEST_DIALOG_H 17 18 #include "components/ui_dialog.h" 19 #include "components/ui_scroll_view.h" 20 #include "graphic_config.h" 21 #include "ui_test.h" 22 23 #if defined(ENABLE_WINDOW) && ENABLE_WINDOW 24 namespace OHOS { 25 class TestUIDialogButtonListener; 26 class TestUIDialogOnCancelListener; 27 28 class UITestDialog : public UITest, public UIView::OnClickListener { 29 public: UITestDialog()30 UITestDialog() {} ~UITestDialog()31 ~UITestDialog() {} 32 void SetUp() override; 33 void TearDown() override; 34 void InnerTestTitle(const char* title); 35 const UIView* GetTestView() override; 36 37 bool OnClick(UIView &view, const ClickEvent& event) override; 38 bool ClickExpand(UIView &view, const ClickEvent& event); 39 40 void UIKitDialogTest001(); 41 void UIKitDialogTest002(); 42 void UIKitDialogTest003(); 43 void UIKitDialogTest004(); 44 void UIKitDialogTest005(); 45 void UIKitDialogTest006(); 46 void UIKitDialogTest007(); 47 void UIKitDialogTest008(); 48 void UIKitDialogTest009(); 49 void UIKitDialogTest010(); 50 51 private: 52 void SetShowInfo001(); 53 void SetShowInfo002(); 54 void SetShowInfo003(); 55 void SetShowInfo006(); 56 void SetShowInfo007(); 57 UIScrollView* container_ = nullptr; 58 UILabel* label_ = nullptr; 59 UILabelButton* button1_ = nullptr; 60 UILabelButton* button2_ = nullptr; 61 UILabelButton* button3_ = nullptr; 62 UILabelButton* button4_ = nullptr; 63 UILabelButton* button5_ = nullptr; 64 UILabelButton* button6_ = nullptr; 65 UILabelButton* button7_ = nullptr; 66 UILabelButton* button8_ = nullptr; 67 UILabelButton* button9_ = nullptr; 68 UILabelButton* button10_ = nullptr; 69 UIDialog* dialog_ = nullptr; 70 TestUIDialogButtonListener* listener1_ = nullptr; 71 TestUIDialogButtonListener* listener2_ = nullptr; 72 TestUIDialogButtonListener* listener3_ = nullptr; 73 TestUIDialogOnCancelListener* listener_ = nullptr; 74 }; 75 } // namespace OHOS 76 #endif // UI_TEST_DIALOG_H 77 #endif // ENABLE_WINDOW 78