1 /*
2 * Copyright (c) 2022-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 #include <memory>
18 #include <string>
19 #define private public
20 #include "privacy_window_manager_client.h"
21 #undef private
22
23 using namespace testing::ext;
24
25 namespace OHOS {
26 namespace Security {
27 namespace AccessToken {
28 class WindowManagerTest : public testing::Test {
29 public:
30 static void SetUpTestCase(void);
31 static void TearDownTestCase(void);
32 void SetUp();
33 void TearDown();
34 };
35
SetUpTestCase()36 void WindowManagerTest::SetUpTestCase() {}
TearDownTestCase()37 void WindowManagerTest::TearDownTestCase() {}
SetUp()38 void WindowManagerTest::SetUp() {}
TearDown()39 void WindowManagerTest::TearDown() {}
40
41 /**
42 * @tc.name: GetWMSProxy001
43 * @tc.desc: GetWMSProxy.
44 * @tc.type: FUNC
45 * @tc.require:
46 */
47 HWTEST_F(WindowManagerTest, GetWMSProxy001, TestSize.Level1) {
48 PrivacyWindowManagerClient::GetInstance().GetWMSProxy();
49 EXPECT_NE(nullptr, PrivacyWindowManagerClient::GetInstance().wmsProxy_);
50 }
51
52 /**
53 * @tc.name: OnRemoteDiedHandle001
54 * @tc.desc: OnRemoteDiedHandle.
55 * @tc.type: FUNC
56 * @tc.require:
57 */
58 HWTEST_F(WindowManagerTest, OnRemoteDiedHandle001, TestSize.Level1) {
59 PrivacyWindowManagerClient::GetInstance().OnRemoteDiedHandle();
60 EXPECT_EQ(nullptr, PrivacyWindowManagerClient::GetInstance().wmsProxy_);
61 }
62
63 } // namespace AccessToken
64 } // namespace Security
65 } // namespace OHOS
66