• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023 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 "session/host/include/system_session.h"
18 #include "common/include/session_permission.h"
19 #include "session/host/include/session.h"
20 #include "window_helper.h"
21 #include "window_manager_hilog.h"
22 
23 
24 using namespace testing;
25 using namespace testing::ext;
26 
27 namespace OHOS {
28 namespace Rosen {
29 class SystemSessionTest : public testing::Test {
30 public:
31     static void SetUpTestCase();
32     static void TearDownTestCase();
33     void SetUp() override;
34     void TearDown() override;
35     SessionInfo info;
36     sptr<SystemSession::SpecificSessionCallback> specificCallback = nullptr;
37     sptr<SystemSession> systemSession_;
38 };
39 
SetUpTestCase()40 void SystemSessionTest::SetUpTestCase()
41 {
42 }
43 
TearDownTestCase()44 void SystemSessionTest::TearDownTestCase()
45 {
46 }
47 
SetUp()48 void SystemSessionTest::SetUp()
49 {
50     systemSession_ = new SystemSession(info, specificCallback);
51 }
52 
TearDown()53 void SystemSessionTest::TearDown()
54 {
55     systemSession_ = nullptr;
56 }
57 
58 namespace {
59 /**
60  * @tc.name: Show
61  * @tc.desc: test function : Show
62  * @tc.type: FUNC
63  */
64 HWTEST_F(SystemSessionTest, Show, Function | SmallTest | Level1)
65 {
66     sptr<WindowSessionProperty> property = new WindowSessionProperty();
67 
68     ASSERT_TRUE((systemSession_ != nullptr));
69     ASSERT_EQ(WSError::WS_OK, systemSession_->Show(property));
70 }
71 
72 }
73 }
74 }