1 /*
2  * Copyright (c) 2022 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 ROSEN_MODULES_RENDER_SERVICE_CLIENT_TEST_UNITTEST_ANIMATION_RS_ANIMATION_BASE_TEST_H
17 #define ROSEN_MODULES_RENDER_SERVICE_CLIENT_TEST_UNITTEST_ANIMATION_RS_ANIMATION_BASE_TEST_H
18 
19 #include "gtest/gtest.h"
20 #include "ui/rs_canvas_node.h"
21 #include "ui/rs_surface_node.h"
22 #include "ui/rs_ui_director.h"
23 #include "ui/rs_root_node.h"
24 #include "wm/window.h"
25 
26 namespace OHOS {
27 namespace Rosen {
28 
29 class RSAnimationBaseTest : public testing::Test {
30 public:
31     static void SetUpTestCase();
32     static void TearDownTestCase();
33     void SetUp() override;
34     void TearDown() override;
35 protected:
36     static sptr<Window> window;
37     static std::shared_ptr<RSCanvasNode> canvasNode;
38     static std::shared_ptr<RSUIDirector> rsUiDirector;
39     static std::shared_ptr<RSSurfaceNode> animationSurfaceNode;
40     static std::shared_ptr<RSNode> rootNode;
41     static void InitAnimationWindow();
42     static void DestoryAnimationWindow();
43     static void InitNode(int width, int height);
44     void ResetAnimationCanvasNode();
45     void RemoveAnimationCanvasNode();
46     void NotifyStartAnimation();
47 };
48 } // namespace Rosen
49 } // namespace OHOS
50 #endif // ROSEN_MODULES_RENDER_SERVICE_CLIENT_TEST_UNITTEST_ANIMATION_RS_ANIMATION_BASE_TEST_H
51