• 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, Hardware
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 "EGL/egl_system_layers_manager.h"
19 
20 #include "egl_defs.h"
21 
22 using namespace testing;
23 using namespace testing::ext;
24 
25 namespace OHOS::Rosen {
26 class EglSystemLayersManagerTest : public testing::Test {
27 public:
SetUpTestCase()28     static void SetUpTestCase() {}
TearDownTestCase()29     static void TearDownTestCase() {}
SetUp()30     void SetUp() {}
TearDown()31     void TearDown() {}
32 };
33 
34 /**
35  * @tc.name: getJsonConfigtTest001
36  * @tc.desc:
37  * @tc.type: FUNC
38  */
HWTEST_F(EglSystemLayersManagerTest,getJsonConfigtTest001,Level1)39 HWTEST_F(EglSystemLayersManagerTest, getJsonConfigtTest001, Level1)
40 {
41     EglSystemLayersManager manager;
42     Json::Value val{Json::nullValue};
43     EXPECT_TRUE(manager.GetJsonConfig(val));
44 }
45 
46 /**
47  * @tc.name: getSystemLayersFromConfigTest
48  * @tc.desc:
49  * @tc.type: FUNC
50  */
HWTEST_F(EglSystemLayersManagerTest,getSystemLayersFromConfigTest,Level1)51 HWTEST_F(EglSystemLayersManagerTest, getSystemLayersFromConfigTest, Level1)
52 {
53     EglSystemLayersManager manager;
54     Json::Value val{Json::nullValue};
55     std::vector<std::string> config = manager.GetSystemLayersFromConfig(val, "testName");
56     EXPECT_TRUE(config.empty());
57 }
58 
59 /**
60  * @tc.name: getSystemLayersTest
61  * @tc.desc:
62  * @tc.type: FUNC
63  */
HWTEST_F(EglSystemLayersManagerTest,getSystemLayersTest,Level1)64 HWTEST_F(EglSystemLayersManagerTest, getSystemLayersTest, Level1)
65 {
66     EglSystemLayersManager manager;
67     manager.GetSystemLayers();
68     Json::Value val{true};
69     EXPECT_TRUE(manager.GetStringVectorFromJson(val).empty());
70 }
71 } // OHOS::Rosen