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_VIEW_BITMAP_H
17 #define UI_TEST_VIEW_BITMAP_H
18 
19 #include "components/ui_image_view.h"
20 #include "components/ui_scroll_view.h"
21 #include "ui_test.h"
22 
23 namespace OHOS {
24 constexpr char* UI_TEST_COMPONENT_SCREENSHOT = "component_screenshot";
25 constexpr char* UI_TEST_FULL_SCREEN_CAPTURE = "full_screen_capture";
26 
27 class UITestViewBitmap : public UITest {
28 public:
UITestViewBitmap()29     UITestViewBitmap() {}
~UITestViewBitmap()30     ~UITestViewBitmap() {}
31     void SetUp() override;
32     void TearDown() override;
33     const UIView* GetTestView() override;
34     void UIKitBitmapTestGetViewBitmap001();
35     void UIKitBitmapTestGetViewBitmap002();
36     void UIKitBitmapTestGetViewBitmap003();
37     void UIKitBitmapTestGetViewBitmap004();
38 #if !(defined ENABLE_WINDOW && ENABLE_WINDOW)
39     void UIKitBitmapTestGetScreenBitmap001();
40 #endif
41 private:
42     UIScrollView* container_ = nullptr;
43     UIImageView* viewBitmap_ = nullptr;
44     UIImageView* viewBitmap2_ = nullptr;
45     UIImageView* viewBitmap3_ = nullptr;
46     UIImageView* viewBitmap4_ = nullptr;
47     UIImageView* screenBitmap_ = nullptr;
48     UIView::OnClickListener* viewBitmapListener_ = nullptr;
49     UIView::OnClickListener* viewBitmapListener2_ = nullptr;
50     UIView::OnClickListener* viewBitmapListener3_ = nullptr;
51     UIView::OnClickListener* viewBitmapListener4_ = nullptr;
52     UIView::OnClickListener* screenBitmapListener_ = nullptr;
53 };
54 } // namespace OHOS
55 #endif // UI_TEST_VIEW_BITMAP_H
56