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
18 #include "extension_module_loader.h"
19 #include "hilog_wrapper.h"
20
21 using namespace testing::ext;
22
23 namespace OHOS {
24 namespace AbilityRuntime {
25 class AbilityExtensionModuleLoaderTest : public testing::Test {
26 public:
27 static void SetUpTestCase();
28 static void TearDownTestCase();
29 void SetUp() override;
30 void TearDown() override;
31 };
32
SetUpTestCase(void)33 void AbilityExtensionModuleLoaderTest::SetUpTestCase(void)
34 {}
35
TearDownTestCase(void)36 void AbilityExtensionModuleLoaderTest::TearDownTestCase(void)
37 {}
38
SetUp()39 void AbilityExtensionModuleLoaderTest::SetUp()
40 {}
41
TearDown()42 void AbilityExtensionModuleLoaderTest::TearDown()
43 {}
44
45 /**
46 * @tc.name: ExtensionModuleLoader_0100
47 * @tc.desc: basic function test.
48 * @tc.type: FUNC
49 */
50 HWTEST_F(AbilityExtensionModuleLoaderTest, ExtensionModuleLoader_0100, TestSize.Level1)
51 {
52 HILOG_INFO("ExtensionModuleLoader start");
53
54 Runtime::Options options;
55 auto runtime = AbilityRuntime::Runtime::Create(options);
56 Extension *extension = ExtensionModuleLoader::GetLoader(nullptr).Create(runtime);
57 EXPECT_EQ(extension, nullptr);
58
59 HILOG_INFO("ExtensionModuleLoader end");
60 }
61
62 /**
63 * @tc.name: GetParams_0100
64 * @tc.desc: basic function test.
65 * @tc.type: FUNC
66 */
67 HWTEST_F(AbilityExtensionModuleLoaderTest, GetParams_0100, TestSize.Level1)
68 {
69 HILOG_INFO("ExtensionModuleLoader start");
70
71 auto params = ExtensionModuleLoader::GetLoader(nullptr).GetParams();
72 bool ret = params.empty();
73 EXPECT_TRUE(ret);
74
75 HILOG_INFO("ExtensionModuleLoader end");
76 }
77
78 } // namespace AbilityRuntime
79 } // namespace OHOS
80