1 /*
2 * Copyright (c) 2025 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 #include "window_session_property.h"
18 #include "wm_common.h"
19
20 using namespace testing;
21 using namespace testing::ext;
22
23 namespace OHOS {
24 namespace Rosen {
25
26 class WindowSessionPropertyAnimationTest : public testing::Test {
27 public:
28 static void SetUpTestCase();
29 static void TearDownTestCase();
30 };
31
SetUpTestCase()32 void WindowSessionPropertyAnimationTest::SetUpTestCase() {}
33
TearDownTestCase()34 void WindowSessionPropertyAnimationTest::TearDownTestCase() {}
35
36 namespace {
37 /**
38 * @tc.name: SetWindowCornerRadius
39 * @tc.desc: SetWindowCornerRadius
40 * @tc.type: FUNC
41 */
42 HWTEST_F(WindowSessionPropertyAnimationTest, SetWindowCornerRadius, TestSize.Level1)
43 {
44 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
45 float cornerRadius = 1.0f;
46 property->SetWindowCornerRadius(cornerRadius);
47 ASSERT_EQ(cornerRadius, property->GetWindowCornerRadius());
48 }
49
50 /**
51 * @tc.name: SetWindowShadows
52 * @tc.desc: SetWindowShadows
53 * @tc.type: FUNC
54 */
55 HWTEST_F(WindowSessionPropertyAnimationTest, SetWindowShadows, TestSize.Level1)
56 {
57 sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
58 ShadowsInfo shadowsInfo = { 20.0, "#FF0000", 0.0, 0.0, true, true, true, true };
59 property->SetWindowShadows(shadowsInfo);
60 ASSERT_EQ(shadowsInfo, property->GetWindowShadows());
61 }
62 } // namespace
63 } // namespace Rosen
64 } // namespace OHOS