• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024 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 #include <gtest/gtest.h>
17 
18 #include "ge_visual_effect_container.h"
19 
20 using namespace testing;
21 using namespace testing::ext;
22 
23 namespace OHOS {
24 namespace Rosen {
25 namespace Drawing {
26 
27 class GEVisualEffectContainerTest : public testing::Test {
28 public:
29     static void SetUpTestCase();
30     static void TearDownTestCase();
31     void SetUp() override;
32     void TearDown() override;
33 };
34 
SetUpTestCase(void)35 void GEVisualEffectContainerTest::SetUpTestCase(void) {}
36 
TearDownTestCase(void)37 void GEVisualEffectContainerTest::TearDownTestCase(void) {}
38 
SetUp()39 void GEVisualEffectContainerTest::SetUp() {}
40 
TearDown()41 void GEVisualEffectContainerTest::TearDown() {}
42 
43 /**
44  * @tc.name: AddToChainedFilter_001
45  * @tc.desc: Verify the AddToChainedFilter
46  * @tc.type: FUNC
47  */
48 HWTEST_F(GEVisualEffectContainerTest, AddToChainedFilter_001, TestSize.Level0)
49 {
50     GTEST_LOG_(INFO) << "GEVisualEffectContainerTest AddToChainedFilter_001 start";
51 
52     auto visualEffect = std::make_shared<GEVisualEffect>(GE_FILTER_KAWASE_BLUR);
53     visualEffect->SetParam(GE_FILTER_KAWASE_BLUR_RADIUS, 1);
54 
55     auto visualEffectContainer = std::make_shared<GEVisualEffectContainer>();
56     visualEffectContainer->AddToChainedFilter(visualEffect);
57 
58     GTEST_LOG_(INFO) << "GEVisualEffectContainerTest AddToChainedFilter_001 end";
59 }
60 
61 /**
62  * @tc.name: AddToChainedFilter_002
63  * @tc.desc: Verify the AddToChainedFilter
64  * @tc.type: FUNC
65  */
66 HWTEST_F(GEVisualEffectContainerTest, AddToChainedFilter_002, TestSize.Level0)
67 {
68     GTEST_LOG_(INFO) << "GEVisualEffectContainerTest AddToChainedFilter_002 start";
69 
70     auto visualEffectContainer = std::make_shared<GEVisualEffectContainer>();
71     visualEffectContainer->AddToChainedFilter(nullptr);
72 
73     GTEST_LOG_(INFO) << "GEVisualEffectContainerTest AddToChainedFilter_002 end";
74 }
75 
76 } // namespace Drawing
77 } // namespace Rosen
78 } // namespace OHOS
79