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 #include <gtest/gtest.h>
17 #include "window_zorder_policy.h"
18
19 using namespace testing;
20 using namespace testing::ext;
21
22 namespace OHOS {
23 namespace Rosen {
24 class WindowZorderPolicyTest : public testing::Test {
25 public:
26 static void SetUpTestCase();
27 static void TearDownTestCase();
28 virtual void SetUp() override;
29 virtual void TearDown() override;
30 };
31
SetUpTestCase()32 void WindowZorderPolicyTest::SetUpTestCase()
33 {
34 }
35
TearDownTestCase()36 void WindowZorderPolicyTest::TearDownTestCase()
37 {
38 }
39
SetUp()40 void WindowZorderPolicyTest::SetUp()
41 {
42 }
43
TearDown()44 void WindowZorderPolicyTest::TearDown()
45 {
46 }
47 namespace {
48 /**
49 * @tc.name: GetWindowPriority01
50 * @tc.desc: get wallpaper window zorder
51 * @tc.type: FUNC
52 */
53 HWTEST_F(WindowZorderPolicyTest, GetWindowPriority01, Function | SmallTest | Level2)
54 {
55 sptr<WindowZorderPolicy> zorderPolicy = new WindowZorderPolicy();
56 int32_t zorder = zorderPolicy->GetWindowPriority(WindowType::WINDOW_TYPE_DESKTOP);
57 ASSERT_EQ(zorder, 1);
58 }
59
60 /**
61 * @tc.name: GetWindowPriority02
62 * @tc.desc: get invalid type window zorder
63 * @tc.type: FUNC
64 */
65 HWTEST_F(WindowZorderPolicyTest, GetWindowPriority02, Function | SmallTest | Level2)
66 {
67 sptr<WindowZorderPolicy> zorderPolicy = new WindowZorderPolicy();
68 int32_t zorder = zorderPolicy->GetWindowPriority(static_cast<WindowType>(3000));
69 ASSERT_EQ(zorder, 1);
70 }
71 }
72 }
73 }