Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
166d6a08
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
166d6a08
编写于
5月 26, 2023
作者:
O
openharmony_ci
提交者:
Gitee
5月 26, 2023
浏览文件
操作
浏览文件
下载
差异文件
!8687 【包管理子系统】【master】新增ActsBundleNativeNinthApiTest测试套
Merge pull request !8687 from ry/master
上级
92d32ea4
70abf964
变更
25
隐藏空白更改
内联
并排
Showing
25 changed file
with
646 addition
and
0 deletion
+646
-0
bundlemanager/bundle_standard/bundlemanager/BUILD.gn
bundlemanager/bundle_standard/bundlemanager/BUILD.gn
+1
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/BUILD.gn
...ndard/bundlemanager/actsbundlenativeninthapitest/BUILD.gn
+49
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/Test.json
...dard/bundlemanager/actsbundlenativeninthapitest/Test.json
+19
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/entry/node_modules/.package-lock.json
...enativeninthapitest/entry/node_modules/.package-lock.json
+14
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/entry/node_modules/libbundlendk1.so
...dlenativeninthapitest/entry/node_modules/libbundlendk1.so
+1
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/entry/package-lock.json
...ager/actsbundlenativeninthapitest/entry/package-lock.json
+24
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/entry/package.json
...lemanager/actsbundlenativeninthapitest/entry/package.json
+6
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/entry/src/main/config.json
...r/actsbundlenativeninthapitest/entry/src/main/config.json
+100
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/entry/src/main/cpp/BUILD.gn
.../actsbundlenativeninthapitest/entry/src/main/cpp/BUILD.gn
+45
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/entry/src/main/cpp/CMakeLists.txt
...undlenativeninthapitest/entry/src/main/cpp/CMakeLists.txt
+11
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/entry/src/main/cpp/bundlendk1.cpp
...undlenativeninthapitest/entry/src/main/cpp/bundlendk1.cpp
+61
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/entry/src/main/cpp/types/libbundlendk1/index.d.ts
...apitest/entry/src/main/cpp/types/libbundlendk1/index.d.ts
+1
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/entry/src/main/cpp/types/libbundlendk1/package.json
...itest/entry/src/main/cpp/types/libbundlendk1/package.json
+4
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/entry/src/main/cpp/types/libentry/index.d.ts
...ninthapitest/entry/src/main/cpp/types/libentry/index.d.ts
+1
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/entry/src/main/cpp/types/libentry/package.json
...nthapitest/entry/src/main/cpp/types/libentry/package.json
+4
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/entry/src/main/ets/MainAbility/app.ets
...nativeninthapitest/entry/src/main/ets/MainAbility/app.ets
+32
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/entry/src/main/ets/MainAbility/pages/index.ets
...nthapitest/entry/src/main/ets/MainAbility/pages/index.ets
+36
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/entry/src/main/ets/TestAbility/app.ets
...nativeninthapitest/entry/src/main/ets/TestAbility/app.ets
+32
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/entry/src/main/ets/TestAbility/pages/index.ets
...nthapitest/entry/src/main/ets/TestAbility/pages/index.ets
+49
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
...st/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
+77
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/entry/src/main/ets/test/BudnleNdkNativeTest.ets
...thapitest/entry/src/main/ets/test/BudnleNdkNativeTest.ets
+40
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/entry/src/main/ets/test/List.test.ets
...enativeninthapitest/entry/src/main/ets/test/List.test.ets
+19
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/entry/src/main/resources/base/element/string.json
...apitest/entry/src/main/resources/base/element/string.json
+20
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/entry/src/main/resources/base/media/icon.png
...ninthapitest/entry/src/main/resources/base/media/icon.png
+0
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/signature/openharmony_sx.p7b
...actsbundlenativeninthapitest/signature/openharmony_sx.p7b
+0
-0
未找到文件。
bundlemanager/bundle_standard/bundlemanager/BUILD.gn
浏览文件 @
166d6a08
...
...
@@ -29,6 +29,7 @@ group("bundlemanager") {
"actsbundlemanageroverlaytest:ActsBundleMgrOverlayEtsTest",
"actsbundlemanagerstagetest:ActsBundleMgrStageEtsTest",
"actsbundlemanagertest:ActsBundleManagerTest",
"actsbundlenativeninthapitest:ActsBundleNativeNinthApiTest",
"actsbundlenativetest:ActsBundleNativeTest",
"sceneProject/bmsaccesstokenfive:bmsAccessTokenTest5",
"sceneProject/bmsaccesstokenfour:bmsAccessTokenTest4",
...
...
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/BUILD.gn
0 → 100644
浏览文件 @
166d6a08
# Copyright (c) 2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//build/ohos.gni")
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsBundleNativeNinthApiTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":ace_third_ets_assets",
":ace_third_ets_resources",
":ace_third_ets_test_assets",
]
ets2abc = true
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsBundleNativeNinthApiTest"
subsystem_name = "bundlemanager"
part_name = "bundle_framework"
shared_libraries = [
"./entry/src/main/cpp:bundlendk1",
":libcppsharedso",
]
}
ohos_prebuilt_shared_library("libcppsharedso") {
source = rebase_path(libcxx_ndk_shared_file)
subsystem_name = "bundlemanager"
part_name = "bundle_framework"
}
ohos_js_assets("ace_third_ets_assets") {
source_dir = "./entry/src/main/ets/MainAbility"
}
ohos_js_assets("ace_third_ets_test_assets") {
source_dir = "./entry/src/main/ets/TestAbility"
}
ohos_resources("ace_third_ets_resources") {
sources = [ "./entry/src/main/resources" ]
hap_profile = "./entry/src/main/config.json"
}
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/Test.json
0 → 100755
浏览文件 @
166d6a08
{
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"type"
:
"OHJSUnitTest"
,
"test-timeout"
:
"600000"
,
"bundle-name"
:
"com.actsbundle.napitest"
,
"package-name"
:
"com.actsbundle.napitest"
,
"shell-timeout"
:
"600000"
},
"kits"
:
[
{
"test-file-name"
:
[
"ActsBundleNativeNinthApiTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
}
]
}
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/entry/node_modules/.package-lock.json
0 → 100644
浏览文件 @
166d6a08
{
"name"
:
"entry"
,
"lockfileVersion"
:
2
,
"requires"
:
true
,
"packages"
:
{
"node_modules/libbundlendk1.so"
:
{
"resolved"
:
"src/main/cpp/types/libbundlendk1"
,
"link"
:
true
},
"src/main/cpp/types/libbundlendk1"
:
{
"dev"
:
true
}
}
}
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/entry/node_modules/libbundlendk1.so
0 → 120000
浏览文件 @
166d6a08
../src/main/cpp/types/libbundlendk
\ No newline at end of file
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/entry/package-lock.json
0 → 100644
浏览文件 @
166d6a08
{
"name"
:
"entry"
,
"lockfileVersion"
:
2
,
"requires"
:
true
,
"packages"
:
{
""
:
{
"devDependencies"
:
{
"libbundlendk1.so"
:
"file:./src/main/cpp/types/libbundlendk1"
}
},
"node_modules/libbundlendk1.so"
:
{
"resolved"
:
"src/main/cpp/types/libbundlendk1"
,
"link"
:
true
},
"src/main/cpp/types/libbundlendk1"
:
{
"dev"
:
true
}
},
"dependencies"
:
{
"libbundlendk1.so"
:
{
"version"
:
"file:src/main/cpp/types/libbundlendk1"
}
}
}
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/entry/package.json
0 → 100644
浏览文件 @
166d6a08
{
"name"
:
"entry"
,
"devDependencies"
:
{
"libbundlendk1.so"
:
"file:./src/main/cpp/types/libbundlendk1"
}
}
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/entry/src/main/config.json
0 → 100755
浏览文件 @
166d6a08
{
"app"
:
{
"bundleName"
:
"com.actsbundle.napitest"
,
"vendor"
:
"open"
,
"version"
:
{
"code"
:
1000000
,
"name"
:
"1.0.0"
},
"apiVersion"
:
{
"compatible"
:
9
,
"releaseType"
:
"Release"
,
"target"
:
9
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"com.actsbundle.napitest"
,
"name"
:
".MyApplication"
,
"mainAbility"
:
"com.actsbundle.napitest.MainAbility"
,
"deviceType"
:
[
"default"
,
"tablet"
],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
,
"installationFree"
:
false
},
"abilities"
:
[
{
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
],
"orientation"
:
"unspecified"
,
"visible"
:
true
,
"srcPath"
:
"MainAbility"
,
"name"
:
".MainAbility"
,
"srcLanguage"
:
"ets"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:description_mainability"
,
"formsEnabled"
:
false
,
"label"
:
"$string:entry_MainAbility"
,
"type"
:
"page"
,
"launchType"
:
"standard"
},
{
"orientation"
:
"unspecified"
,
"visible"
:
true
,
"srcPath"
:
"TestAbility"
,
"name"
:
".TestAbility"
,
"srcLanguage"
:
"ets"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:TestAbility_desc"
,
"formsEnabled"
:
false
,
"label"
:
"$string:TestAbility_label"
,
"type"
:
"page"
,
"launchType"
:
"standard"
}
],
"js"
:
[
{
"mode"
:
{
"syntax"
:
"ets"
,
"type"
:
"pageAbility"
},
"pages"
:
[
"pages/index"
],
"name"
:
".MainAbility"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
},
{
"mode"
:
{
"syntax"
:
"ets"
,
"type"
:
"pageAbility"
},
"pages"
:
[
"pages/index"
],
"name"
:
".TestAbility"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
}
]
}
}
\ No newline at end of file
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/entry/src/main/cpp/BUILD.gn
0 → 100644
浏览文件 @
166d6a08
# Copyright (C) 2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//build/config/ohos/config.gni")
import("//build/ohos.gni")
config("config") {
visibility = [ ":*" ]
cflags = [
"-Wall",
"-Werror",
"-g3",
"-Wunused-variable",
]
}
config("public_config") {
}
ohos_shared_library("bundlendk1") {
sources = [ "./bundlendk1.cpp" ]
libs = [ rebase_path(libcxx_ndk_shared_file) ]
subsystem_name = "bundlemanager"
part_name = "bundle_framework"
include_dirs = [ "./" ]
configs = [ ":config" ]
deps = [
"../../../../../../../../../../../foundation/arkui/napi:ace_napi",
"../../../../../../../../../../../foundation/bundlemanager/bundle_framework/interfaces/kits/native/bundle:bundle_ndk",
]
output_extension = "so"
}
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/entry/src/main/cpp/CMakeLists.txt
0 → 100755
浏览文件 @
166d6a08
# the minimum version of CMake.
cmake_minimum_required
(
VERSION 3.4.1
)
project
(
XComponent
)
set
(
NATIVERENDER_ROOT_PATH
${
CMAKE_CURRENT_SOURCE_DIR
}
)
include_directories
(
${
NATIVERENDER_ROOT_PATH
}
${
NATIVERENDER_ROOT_PATH
}
/include
)
add_library
(
bundlendk SHARED bundlendk1.cpp
)
target_link_libraries
(
bundlendk PUBLIC libace_napi.z.so libc++.a libbundle_ndk.z.so
)
\ No newline at end of file
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/entry/src/main/cpp/bundlendk1.cpp
0 → 100755
浏览文件 @
166d6a08
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "napi/native_api.h"
#include "native_interface_bundle.h"
#include <cstdlib>
#include <js_native_api_types.h>
static
napi_value
GetCurrentApplicationInfo
(
napi_env
env
,
napi_callback_info
info
)
{
OH_NativeBundle_ApplicationInfo
nativeApplicationInfo
=
OH_NativeBundle_GetCurrentApplicationInfo
();
napi_value
result
=
nullptr
;
napi_create_object
(
env
,
&
result
);
napi_value
bundleName
;
napi_create_string_utf8
(
env
,
nativeApplicationInfo
.
bundleName
,
NAPI_AUTO_LENGTH
,
&
bundleName
);
napi_set_named_property
(
env
,
result
,
"bundleName"
,
bundleName
);
napi_value
fingerprint
;
napi_create_string_utf8
(
env
,
nativeApplicationInfo
.
fingerprint
,
NAPI_AUTO_LENGTH
,
&
fingerprint
);
napi_set_named_property
(
env
,
result
,
"fingerprint"
,
fingerprint
);
return
result
;
}
EXTERN_C_START
static
napi_value
Init
(
napi_env
env
,
napi_value
exports
)
{
napi_property_descriptor
desc
[]
=
{
{
"getCurrentApplicationInfo"
,
nullptr
,
GetCurrentApplicationInfo
,
nullptr
,
nullptr
,
nullptr
,
napi_default
,
nullptr
}
};
napi_define_properties
(
env
,
exports
,
sizeof
(
desc
)
/
sizeof
(
desc
[
0
]),
desc
);
return
exports
;
}
EXTERN_C_END
static
napi_module
demoModule
=
{
.
nm_version
=
1
,
.
nm_flags
=
0
,
.
nm_filename
=
nullptr
,
.
nm_register_func
=
Init
,
.
nm_modname
=
"libbundlendk1"
,
.
nm_priv
=
((
void
*
)
0
),
.
reserved
=
{
0
},
};
extern
"C"
__attribute__
((
constructor
))
void
RegisterModule
(
void
)
{
napi_module_register
(
&
demoModule
);
}
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/entry/src/main/cpp/types/libbundlendk1/index.d.ts
0 → 100755
浏览文件 @
166d6a08
export
const
getCurrentApplicationInfo
:
()
=>
any
;
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/entry/src/main/cpp/types/libbundlendk1/package.json
0 → 100755
浏览文件 @
166d6a08
{
"name"
:
"libbundlendk1.so"
,
"types"
:
"./index.d.ts"
}
\ No newline at end of file
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/entry/src/main/cpp/types/libentry/index.d.ts
0 → 100755
浏览文件 @
166d6a08
export
const
GetCurrentApplicationInfo
:
()
=>
object
;
\ No newline at end of file
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/entry/src/main/cpp/types/libentry/package.json
0 → 100755
浏览文件 @
166d6a08
{
"name"
:
"libbundlendk1.so"
,
"types"
:
"./index.d.ts"
}
\ No newline at end of file
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/entry/src/main/ets/MainAbility/app.ets
0 → 100755
浏览文件 @
166d6a08
/**
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from 'hypium/index'
import testsuite from '../test/List.test'
export default {
onCreate() {
console.info('Application onCreate')
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
},
onDestroy() {
console.info('Application onDestroy')
},
}
\ No newline at end of file
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/entry/src/main/ets/MainAbility/pages/index.ets
0 → 100755
浏览文件 @
166d6a08
/**
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@Entry
@Component
struct MyComponent {
aboutToAppear() {
}
build() {
Flex({
direction: FlexDirection.Column,
alignItems: ItemAlign.Center,
justifyContent: FlexAlign.Center
}) {
Text('BMS ETS TEST')
.fontSize(50)
.fontWeight(FontWeight.Bold)
}
.width('100%')
.height('100%')
}
}
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/entry/src/main/ets/TestAbility/app.ets
0 → 100755
浏览文件 @
166d6a08
/**
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from 'hypium/index'
import testsuite from '../test/List.test'
export default {
onCreate() {
console.info('Application onCreate')
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
},
onDestroy() {
console.info('Application onDestroy')
},
}
\ No newline at end of file
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/entry/src/main/ets/TestAbility/pages/index.ets
0 → 100755
浏览文件 @
166d6a08
/**
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import router from '@system.router';
@Entry
@Component
struct Index {
aboutToAppear() {
console.info('TestAbility index aboutToAppear')
}
@State message: string = 'Hello World'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.width('35%')
.height('5%')
.onClick(()=>{
})
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
0 → 100755
浏览文件 @
166d6a08
/**
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
TestRunner
from
'
@ohos.application.testRunner
'
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
var
abilityDelegator
=
undefined
var
abilityDelegatorArguments
=
undefined
function
translateParamsToString
(
parameters
)
{
const
keySet
=
new
Set
([
'
-s class
'
,
'
-s notClass
'
,
'
-s suite
'
,
'
-s itName
'
,
'
-s level
'
,
'
-s testType
'
,
'
-s size
'
,
'
-s timeout
'
,
'
-s package
'
])
let
targetParams
=
''
;
for
(
const
key
in
parameters
)
{
if
(
keySet
.
has
(
key
))
{
targetParams
+=
'
'
+
key
+
'
'
+
parameters
[
key
]
}
}
return
targetParams
.
trim
()
}
async
function
onAbilityCreateCallback
()
{
console
.
log
(
'
onAbilityCreateCallback
'
);
}
async
function
addAbilityMonitorCallback
(
err
:
any
)
{
console
.
info
(
'
addAbilityMonitorCallback :
'
+
JSON
.
stringify
(
err
))
}
export
default
class
OpenHarmonyTestRunner
implements
TestRunner
{
constructor
()
{
}
onPrepare
()
{
console
.
info
(
'
OpenHarmonyTestRunner OnPrepare
'
)
}
onRun
()
{
console
.
log
(
'
OpenHarmonyTestRunner onRun run
'
)
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
let
lMonitor
=
{
abilityName
:
testAbilityName
,
onAbilityCreate
:
onAbilityCreateCallback
,
};
var
testAbilityName
=
abilityDelegatorArguments
.
parameters
[
'
-p
'
]
+
'
.MainAbility
'
abilityDelegator
.
addAbilityMonitor
(
lMonitor
,
addAbilityMonitorCallback
)
var
cmd
=
'
aa start -d 0 -a
'
+
testAbilityName
+
'
-b
'
+
abilityDelegatorArguments
.
bundleName
cmd
+=
'
'
+
translateParamsToString
(
abilityDelegatorArguments
.
parameters
)
console
.
info
(
'
cmd :
'
+
cmd
)
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
:
any
,
d
:
any
)
=>
{
console
.
info
(
'
executeShellCommand : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
executeShellCommand : data :
'
+
d
.
stdResult
);
console
.
info
(
'
executeShellCommand : data :
'
+
d
.
exitCode
);
})
console
.
info
(
'
OpenHarmonyTestRunner onRun call abilityDelegator.getAppContext
'
)
var
context
=
abilityDelegator
.
getAppContext
()
console
.
info
(
'
getAppContext :
'
+
JSON
.
stringify
(
context
))
console
.
info
(
'
OpenHarmonyTestRunner onRun end
'
)
}
};
\ No newline at end of file
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/entry/src/main/ets/test/BudnleNdkNativeTest.ets
0 → 100755
浏览文件 @
166d6a08
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
// @ts-ignore
import bundlendk from 'libbundlendk1.so'
const BUNDLE_NAME = "com.actsbundle.napitest"
const FINGER_PRINT = "8E93863FC32EE238060BF69A9B37E2608FFFB21F93C862DD511CBAC9F30024B5"
export default function budnleNdkNativeTest() {
describe('BundleNdkTest', function () {
/**
* @tc.number SUB_BMS_BASIC_ETS_NATIVE_0200
* @tc.name budnleNdkNativeTest002
* @tc.desc budnleNdkNativeTest
*/
it('BundleNdkTest002', 0, async function (done) {
let data = bundlendk.getCurrentApplicationInfo();
console.info("Test NAPI data= " + JSON.stringify(data));
expect(data.bundleName).assertEqual(BUNDLE_NAME);
expect(data.fingerprint).assertEqual(FINGER_PRINT);
done()
});
})
}
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/entry/src/main/ets/test/List.test.ets
0 → 100755
浏览文件 @
166d6a08
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import budnleNdkNativeTest from './BudnleNdkNativeTest';
export default function testsuite() {
budnleNdkNativeTest()
}
\ No newline at end of file
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/entry/src/main/resources/base/element/string.json
0 → 100755
浏览文件 @
166d6a08
{
"string"
:
[
{
"name"
:
"entry_MainAbility"
,
"value"
:
"entry_MainAbility"
},
{
"name"
:
"description_mainability"
,
"value"
:
"ETS_Empty Ability"
},
{
"name"
:
"TestAbility_desc"
,
"value"
:
"description"
},
{
"name"
:
"TestAbility_label"
,
"value"
:
"label"
}
]
}
\ No newline at end of file
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/entry/src/main/resources/base/media/icon.png
0 → 100755
浏览文件 @
166d6a08
6.6 KB
bundlemanager/bundle_standard/bundlemanager/actsbundlenativeninthapitest/signature/openharmony_sx.p7b
0 → 100755
浏览文件 @
166d6a08
文件已添加
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录