Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
5b3f7afb
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看板
提交
5b3f7afb
编写于
8月 26, 2021
作者:
O
openharmony_ci
提交者:
Gitee
8月 26, 2021
浏览文件
操作
浏览文件
下载
差异文件
!463 修改测试用例
Merge pull request !463 from chensi10/master
上级
c51fd777
0e57b121
变更
20
显示空白变更内容
内联
并排
Showing
20 changed file
with
1258 addition
and
28 deletion
+1258
-28
appexecfwk/bundle_standard/bundlemanager/hap/napi_test_suite_scene1.hap
...dle_standard/bundlemanager/hap/napi_test_suite_scene1.hap
+0
-0
appexecfwk/bundle_standard/bundlemanager/hap/napi_test_suite_scene2.hap
...dle_standard/bundlemanager/hap/napi_test_suite_scene2.hap
+0
-0
appexecfwk/bundle_standard/bundlemanager/hap/napi_test_suite_scene3.hap
...dle_standard/bundlemanager/hap/napi_test_suite_scene3.hap
+0
-0
appexecfwk/bundle_standard/bundlemanager/hap/napi_test_suite_scene4.hap
...dle_standard/bundlemanager/hap/napi_test_suite_scene4.hap
+0
-0
appexecfwk/bundle_standard/bundlemanager/project/napi_test_suite_scene1/src/main/config.json
...nager/project/napi_test_suite_scene1/src/main/config.json
+34
-7
appexecfwk/bundle_standard/bundlemanager/project/napi_test_suite_scene1/src/main/js/test/ExampleJsunit.test.js
..._test_suite_scene1/src/main/js/test/ExampleJsunit.test.js
+322
-1
appexecfwk/bundle_standard/bundlemanager/project/napi_test_suite_scene2/src/main/config.json
...nager/project/napi_test_suite_scene2/src/main/config.json
+34
-7
appexecfwk/bundle_standard/bundlemanager/project/napi_test_suite_scene2/src/main/js/test/ExampleJsunit.test.js
..._test_suite_scene2/src/main/js/test/ExampleJsunit.test.js
+165
-3
appexecfwk/bundle_standard/bundlemanager/project/napi_test_suite_scene3/src/main/config.json
...nager/project/napi_test_suite_scene3/src/main/config.json
+34
-7
appexecfwk/bundle_standard/bundlemanager/project/napi_test_suite_scene3/src/main/js/test/ExampleJsunit.test.js
..._test_suite_scene3/src/main/js/test/ExampleJsunit.test.js
+187
-3
appexecfwk/bundle_standard/bundlemanager/project/napi_test_suite_scene4/package.json
...bundlemanager/project/napi_test_suite_scene4/package.json
+1
-0
appexecfwk/bundle_standard/bundlemanager/project/napi_test_suite_scene4/src/main/config.json
...nager/project/napi_test_suite_scene4/src/main/config.json
+86
-0
appexecfwk/bundle_standard/bundlemanager/project/napi_test_suite_scene4/src/main/js/default/app.js
...project/napi_test_suite_scene4/src/main/js/default/app.js
+8
-0
appexecfwk/bundle_standard/bundlemanager/project/napi_test_suite_scene4/src/main/js/default/i18n/en-US.json
...api_test_suite_scene4/src/main/js/default/i18n/en-US.json
+6
-0
appexecfwk/bundle_standard/bundlemanager/project/napi_test_suite_scene4/src/main/js/default/i18n/zh-CN.json
...api_test_suite_scene4/src/main/js/default/i18n/zh-CN.json
+6
-0
appexecfwk/bundle_standard/bundlemanager/project/napi_test_suite_scene4/src/main/js/default/pages/index/index.css
...st_suite_scene4/src/main/js/default/pages/index/index.css
+9
-0
appexecfwk/bundle_standard/bundlemanager/project/napi_test_suite_scene4/src/main/js/default/pages/index/index.hml
...st_suite_scene4/src/main/js/default/pages/index/index.hml
+5
-0
appexecfwk/bundle_standard/bundlemanager/project/napi_test_suite_scene4/src/main/js/default/pages/index/index.js
...est_suite_scene4/src/main/js/default/pages/index/index.js
+32
-0
appexecfwk/bundle_standard/bundlemanager/project/napi_test_suite_scene4/src/main/js/test/ExampleJsunit.test.js
..._test_suite_scene4/src/main/js/test/ExampleJsunit.test.js
+328
-0
appexecfwk/bundle_standard/bundlemanager/project/napi_test_suite_scene4/src/main/js/test/List.test.js
...ject/napi_test_suite_scene4/src/main/js/test/List.test.js
+1
-0
未找到文件。
appexecfwk/bundle_standard/bundlemanager/hap/napi_test_suite_scene1.hap
浏览文件 @
5b3f7afb
无法预览此类型文件
appexecfwk/bundle_standard/bundlemanager/hap/napi_test_suite_scene2.hap
浏览文件 @
5b3f7afb
无法预览此类型文件
appexecfwk/bundle_standard/bundlemanager/hap/napi_test_suite_scene3.hap
浏览文件 @
5b3f7afb
无法预览此类型文件
appexecfwk/bundle_standard/bundlemanager/hap/napi_test_suite_scene4.hap
0 → 100644
浏览文件 @
5b3f7afb
文件已添加
appexecfwk/bundle_standard/bundlemanager/project/napi_test_suite_scene1/src/main/config.json
浏览文件 @
5b3f7afb
{
{
"app"
:
{
"app"
:
{
"bundleName"
:
"com.example.
napi_test_suite
"
,
"bundleName"
:
"com.example.
myapplication
"
,
"vendor"
:
"example"
,
"vendor"
:
"example"
,
"version"
:
{
"version"
:
{
"code"
:
1
,
"code"
:
1
,
...
@@ -14,9 +14,7 @@
...
@@ -14,9 +14,7 @@
},
},
"deviceConfig"
:
{},
"deviceConfig"
:
{},
"module"
:
{
"module"
:
{
"package"
:
"com.example.myapplication"
,
"package"
:
"com.example.napi_test_suite"
,
"name"
:
".MyApplication"
,
"name"
:
".MyApplication"
,
"deviceType"
:
[
"deviceType"
:
[
"phone"
"phone"
...
@@ -31,18 +29,45 @@
...
@@ -31,18 +29,45 @@
"skills"
:
[
"skills"
:
[
{
{
"entities"
:
[
"entities"
:
[
"entity.system.home"
"entity.system.home"
,
"flag.home.intent.from.system"
],
],
"actions"
:
[
"actions"
:
[
"action.system.home"
"action.system.home"
]
]
}
}
],
],
"name"
:
"com.example.
napi_test_suite
.MainAbility"
,
"name"
:
"com.example.
myapplication
.MainAbility"
,
"icon"
:
"$media:icon"
,
"icon"
:
"$media:icon"
,
"theme"
:
"$media:icon"
,
"description"
:
"$string:mainability_description"
,
"description"
:
"$string:mainability_description"
,
"label"
:
"
$string:app_name
"
,
"label"
:
"
MyApplication
"
,
"type"
:
"page"
,
"type"
:
"page"
,
"formEntity"
:
[
"homeScreen"
,
"searchbox"
],
"defaultFormHeight"
:
100
,
"minFormHeight"
:
200
,
"defaultFormWidth"
:
300
,
"minFormWidth"
:
400
,
"metaData"
:
{
"parameters"
:
[{
"name"
:
"string"
,
"type"
:
"Float"
,
"description"
:
"string_parameters_description"
}],
"results"
:
[{
"name"
:
"string"
,
"type"
:
"Float"
,
"description"
:
"string_results_description"
}],
"customizeData"
:
[{
"name"
:
"string"
,
"value"
:
"string"
,
"extra"
:
""
}]
},
"launchType"
:
"standard"
"launchType"
:
"standard"
}
}
],
],
...
@@ -69,11 +94,13 @@
...
@@ -69,11 +94,13 @@
"description"
:
"WeChat permission in detail"
"description"
:
"WeChat permission in detail"
}
}
],
],
"colorMode"
:
"light"
,
"js"
:
[
"js"
:
[
{
{
"pages"
:
[
"pages"
:
[
"pages/index/index"
"pages/index/index"
],
],
"colorMode"
:
"light"
,
"name"
:
"default"
,
"name"
:
"default"
,
"window"
:
{
"window"
:
{
"designWidth"
:
720
,
"designWidth"
:
720
,
...
...
appexecfwk/bundle_standard/bundlemanager/project/napi_test_suite_scene1/src/main/js/test/ExampleJsunit.test.js
浏览文件 @
5b3f7afb
...
@@ -124,4 +124,325 @@ describe('appInfoTest', function () {
...
@@ -124,4 +124,325 @@ describe('appInfoTest', function () {
done
()
done
()
})
})
it
(
'
getBundleInfo_0100
'
,
0
,
async
function
(
done
)
{
var
datainfo
=
await
demo
.
getBundleInfo
(
'
com.example.myapplication1
'
,
1
)
expect
(
datainfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
vendor
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
versionCode
).
assertEqual
(
1
)
expect
(
datainfo
.
versionName
).
assertEqual
(
1.0
)
expect
(
datainfo
.
appInfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
appInfo
.
description
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
appInfo
.
label
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
appInfo
.
icon
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
appInfo
.
descriptionId
).
assertEqual
(
16777217
)
done
()
})
it
(
'
getBundleInfo_0400
'
,
0
,
async
function
(
done
)
{
var
datainfo
=
await
demo
.
getBundleInfo
(
'
error
'
,
1
);
expect
(
datainfo
.
name
.
length
).
assertEqual
(
0
)
done
();
})
it
(
'
getBundleInfo_0500
'
,
0
,
async
function
(
done
)
{
var
datainfo
=
await
demo
.
getBundleInfo
();
expect
(
datainfo
.
name
.
length
).
assertEqual
(
0
)
done
();
})
it
(
'
getBundleInfo_0600
'
,
0
,
async
function
(
done
)
{
await
demo
.
getBundleInfo
(
'
com.example.myapplication1
'
,
1
,
OnReceiveEvent
)
function
OnReceiveEvent
(
err
,
datainfo
)
{
expect
(
datainfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
vendor
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
versionCode
).
assertEqual
(
1
)
expect
(
datainfo
.
versionName
).
assertEqual
(
1.0
)
expect
(
datainfo
.
appInfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
appInfo
.
description
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
appInfo
.
label
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
appInfo
.
icon
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
appInfo
.
descriptionId
).
assertEqual
(
16777217
)
}
done
()
})
it
(
'
getBundleInfo_0900
'
,
0
,
async
function
(
done
)
{
await
demo
.
getBundleInfo
(
'
error
'
,
1
,
OnReceiveEvent
)
function
OnReceiveEvent
(
err
,
datainfo
)
{
expect
(
datainfo
.
name
.
length
).
assertEqual
(
0
)
}
done
()
})
it
(
'
getBundleInfo_1000
'
,
0
,
async
function
(
done
)
{
await
demo
.
getBundleInfo
(
OnReceiveEvent
)
function
OnReceiveEvent
(
err
,
datainfo
)
{
expect
(
datainfo
.
name
.
length
).
assertEqual
(
0
)
}
done
()
})
it
(
'
getBundleArchiveInfo_0100
'
,
0
,
async
function
(
done
)
{
var
datainfo
=
await
demo
.
getBundleArchiveInfo
(
'
/data/bmsJstest1.hap
'
,
1
)
expect
(
datainfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
vendor
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
versionCode
).
assertEqual
(
1
)
expect
(
datainfo
.
versionName
).
assertEqual
(
1.0
)
expect
(
datainfo
.
appInfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
appInfo
.
description
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
appInfo
.
label
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
appInfo
.
icon
.
length
).
assertLarger
(
0
)
done
()
})
it
(
'
getBundleArchiveInfo_0400
'
,
0
,
async
function
(
done
)
{
var
datainfo
=
await
demo
.
getBundleArchiveInfo
(
'
/data/error.hap
'
,
1
)
expect
(
datainfo
.
name
.
length
).
assertEqual
(
0
)
done
()
})
it
(
'
getBundleArchiveInfo_0500
'
,
0
,
async
function
(
done
)
{
var
datainfo
=
await
demo
.
getBundleArchiveInfo
(
'
'
,
1
)
expect
(
datainfo
.
name
.
length
).
assertEqual
(
0
)
done
()
})
it
(
'
getBundleArchiveInfo_0600
'
,
0
,
async
function
(
done
)
{
await
demo
.
getBundleArchiveInfo
(
'
/data/bmsJstest1.hap
'
,
1
,
OnReceiveEvent
)
function
OnReceiveEvent
(
err
,
datainfo
)
{
expect
(
datainfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
vendor
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
versionCode
).
assertEqual
(
1
)
expect
(
datainfo
.
versionName
).
assertEqual
(
1.0
)
expect
(
datainfo
.
appInfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
appInfo
.
description
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
appInfo
.
label
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
appInfo
.
icon
.
length
).
assertLarger
(
0
)
}
done
()
})
it
(
'
getBundleArchiveInfo_0900
'
,
0
,
async
function
(
done
)
{
await
demo
.
getBundleArchiveInfo
(
'
/data/error.
'
,
1
,
OnReceiveEvent
)
function
OnReceiveEvent
(
err
,
datainfo
)
{
expect
(
datainfo
.
name
.
length
).
assertEqual
(
0
)
}
done
()
})
it
(
'
getBundleArchiveInfo_1000
'
,
0
,
async
function
(
done
)
{
await
demo
.
getBundleArchiveInfo
(
'
'
,
1
,
OnReceiveEvent
)
function
OnReceiveEvent
(
err
,
datainfo
)
{
expect
(
datainfo
.
name
.
length
).
assertEqual
(
0
)
}
done
()
})
it
(
'
queryAbilityByWant_0100
'
,
0
,
async
function
(
done
)
{
var
datainfo
=
await
demo
.
queryAbilityByWant
({
want
:{
action
:
"
action.system.home
"
,
entities
:[
"
entity.system.home
"
],
elementName
:
{
deviceId
:
"
0
"
,
bundleName
:
"
com.example.myapplication1
"
,
abilityName
:
"
.MainAbility
"
,
},}},{
params
:{
flags
:
8
,
userId
:
"
0
"
,
}
})
expect
(
datainfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
label
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
description
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
icon
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
moduleName
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
bundleName
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
applicationInfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
applicationInfo
.
description
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
applicationInfo
.
icon
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
applicationInfo
.
label
.
length
).
assertLarger
(
0
)
done
();
})
it
(
'
queryAbilityByWant_0400
'
,
0
,
async
function
(
done
)
{
var
datainfo
=
await
demo
.
queryAbilityByWant
({
want
:{
action
:
"
action.system.home
"
,
entities
:[
"
entity.system.home
"
],
elementName
:
{
deviceId
:
"
0
"
,
bundleName
:
"
com.example.myapplication1
"
,
abilityName
:
""
,
},}},{
params
:{
flags
:
8
,
userId
:
"
0
"
,
}
})
expect
(
datainfo
.
name
.
length
).
assertEqual
(
0
)
done
();
})
it
(
'
queryAbilityByWant_0500
'
,
0
,
async
function
(
done
)
{
var
datainfo
=
await
demo
.
queryAbilityByWant
({
want
:{
action
:
"
action.system.home
"
,
entities
:[
"
entity.system.home
"
],
elementName
:
{
deviceId
:
"
0
"
,
bundleName
:
""
,
abilityName
:
""
,
},}},{
params
:{
flags
:
8
,
userId
:
"
0
"
,
}
})
expect
(
datainfo
.
name
.
length
).
assertEqual
(
0
)
done
();
})
it
(
'
queryAbilityByWant_0600
'
,
0
,
async
function
(
done
)
{
await
demo
.
queryAbilityByWant
({
want
:
{
action
:
"
action.system.home
"
,
entities
:
[
"
entity.system.home
"
],
elementName
:
{
deviceId
:
"
0
"
,
bundleName
:
"
com.example.myapplication1
"
,
abilityName
:
"
.MainAbility
"
,
},
}
},
{
params
:
{
flags
:
8
,
userId
:
"
0
"
,
}
},
OnReceiveEvent
)
function
OnReceiveEvent
(
err
,
datainfo
)
{
expect
(
datainfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
label
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
description
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
icon
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
moduleName
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
bundleName
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
applicationInfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
applicationInfo
.
description
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
applicationInfo
.
icon
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
applicationInfo
.
label
.
length
).
assertLarger
(
0
)
done
()
}
})
it
(
'
queryAbilityByWant_0900
'
,
0
,
async
function
(
done
)
{
await
demo
.
queryAbilityByWant
({
want
:
{
action
:
"
action.system.home
"
,
entities
:
[
"
entity.system.home
"
],
elementName
:
{
deviceId
:
"
0
"
,
bundleName
:
"
com.example.myapplication1
"
,
abilityName
:
""
,
},
}
},
{
params
:
{
flags
:
8
,
userId
:
"
0
"
,
}
},
OnReceiveEvent
)
function
OnReceiveEvent
(
err
,
datainfo
)
{
expect
(
datainfo
.
name
.
length
).
assertEqual
(
0
)
done
();
}
})
it
(
'
queryAbilityByWant_1000
'
,
0
,
async
function
(
done
)
{
await
demo
.
queryAbilityByWant
({
want
:
{
action
:
"
action.system.home
"
,
entities
:
[
"
entity.system.home
"
],
elementName
:
{
deviceId
:
"
0
"
,
bundleName
:
""
,
abilityName
:
""
,
},
}
},
{
params
:
{
flags
:
8
,
userId
:
"
0
"
,
}
},
OnReceiveEvent
)
function
OnReceiveEvent
(
err
,
datainfo
)
{
expect
(
datainfo
.
name
.
length
).
assertEqual
(
0
)
done
()
}
})
it
(
'
getPermissionDef_0100
'
,
0
,
async
function
(
done
){
await
demo
.
getPermissionDef
(
'
com.permission.CAMERA
'
).
then
((
infos
)
=>
{
expect
(
typeof
infos
).
assertEqual
(
"
object
"
);
expect
(
infos
.
name
).
assertEqual
(
"
com.permission.CAMERA
"
);
expect
(
infos
.
grantMode
).
assertEqual
(
1
);
expect
(
infos
.
availableScope
).
assertEqual
(
2
);
expect
(
infos
.
label
).
assertEqual
(
"
CAMERA permission
"
);
expect
(
infos
.
description
).
assertEqual
(
"
CAMERA permission in detail
"
);
});
done
();
})
it
(
'
getPermissionDef_0600
'
,
0
,
async
function
(
done
){
console
.
info
(
"
neu========================getPermissionDef_0100: for begin
"
);
await
demo
.
getPermissionDef
(
'
com.permission.CAMERA
'
,
OnReceiveEvent
);
function
OnReceiveEvent
(
err
,
data
)
{
expect
(
data
.
name
).
assertEqual
(
"
com.permission.CAMERA
"
);
expect
(
data
.
grantMode
).
assertEqual
(
1
);
expect
(
data
.
availableScope
).
assertEqual
(
2
);
expect
(
data
.
label
).
assertEqual
(
"
CAMERA permission
"
);
expect
(
data
.
description
).
assertEqual
(
"
CAMERA permission in detail
"
);
}
done
();
})
it
(
'
getPermissionDef_0400
'
,
0
,
async
function
(
done
){
await
demo
.
getPermissionDef
(
''
).
then
((
infos
)
=>
{
expect
(
typeof
infos
).
assertEqual
(
"
object
"
);
expect
(
infos
.
name
).
assertEqual
(
""
);
expect
(
infos
.
grantMode
).
assertEqual
(
""
);
expect
(
infos
.
availableScope
).
assertEqual
(
0
);
expect
(
infos
.
label
).
assertEqual
(
""
);
expect
(
infos
.
description
).
assertEqual
(
""
);
});
done
();
})
it
(
'
getPermissionDef_0900
'
,
0
,
async
function
(
done
)
{
await
demo
.
getPermissionDef
(
''
,
OnReceiveEvent
);
function
OnReceiveEvent
(
err
,
data
)
{
expect
(
typeof
data
).
assertEqual
(
"
object
"
);
expect
(
data
.
name
).
assertEqual
(
""
);
expect
(
data
.
availableScope
).
assertEqual
(
0
);
expect
(
data
.
grantMode
).
assertEqual
(
""
);
expect
(
data
.
label
).
assertEqual
(
""
);
expect
(
data
.
description
).
assertEqual
(
""
);
}
done
();
})
})
})
appexecfwk/bundle_standard/bundlemanager/project/napi_test_suite_scene2/src/main/config.json
浏览文件 @
5b3f7afb
{
{
"app"
:
{
"app"
:
{
"bundleName"
:
"com.example.
napi_test_suite
"
,
"bundleName"
:
"com.example.
myapplication_2
"
,
"vendor"
:
"example"
,
"vendor"
:
"example"
,
"version"
:
{
"version"
:
{
"code"
:
1
,
"code"
:
1
,
...
@@ -14,9 +14,7 @@
...
@@ -14,9 +14,7 @@
},
},
"deviceConfig"
:
{},
"deviceConfig"
:
{},
"module"
:
{
"module"
:
{
"package"
:
"com.example.myapplication"
,
"package"
:
"com.example.napi_test_suite"
,
"name"
:
".MyApplication"
,
"name"
:
".MyApplication"
,
"deviceType"
:
[
"deviceType"
:
[
"phone"
"phone"
...
@@ -31,18 +29,45 @@
...
@@ -31,18 +29,45 @@
"skills"
:
[
"skills"
:
[
{
{
"entities"
:
[
"entities"
:
[
"entity.system.home"
"entity.system.home"
,
"flag.home.intent.from.system"
],
],
"actions"
:
[
"actions"
:
[
"action.system.home"
"action.system.home"
]
]
}
}
],
],
"name"
:
"com.example.
napi_test_suite
.MainAbility"
,
"name"
:
"com.example.
myapplication
.MainAbility"
,
"icon"
:
"$media:icon"
,
"icon"
:
"$media:icon"
,
"theme"
:
"$media:icon"
,
"description"
:
"$string:mainability_description"
,
"description"
:
"$string:mainability_description"
,
"label"
:
"
$string:app_name
"
,
"label"
:
"
MyApplication
"
,
"type"
:
"page"
,
"type"
:
"page"
,
"formEntity"
:
[
"homeScreen"
,
"searchbox"
],
"defaultFormHeight"
:
100
,
"minFormHeight"
:
200
,
"defaultFormWidth"
:
300
,
"minFormWidth"
:
400
,
"metaData"
:
{
"parameters"
:
[{
"name"
:
"string"
,
"type"
:
"Float"
,
"description"
:
"string_parameters_description"
}],
"results"
:
[{
"name"
:
"string"
,
"type"
:
"Float"
,
"description"
:
"string_results_description"
}],
"customizeData"
:
[{
"name"
:
"string"
,
"value"
:
"string"
,
"extra"
:
""
}]
},
"launchType"
:
"standard"
"launchType"
:
"standard"
}
}
],
],
...
@@ -69,11 +94,13 @@
...
@@ -69,11 +94,13 @@
"description"
:
"WeChat permission in detail"
"description"
:
"WeChat permission in detail"
}
}
],
],
"colorMode"
:
"light"
,
"js"
:
[
"js"
:
[
{
{
"pages"
:
[
"pages"
:
[
"pages/index/index"
"pages/index/index"
],
],
"colorMode"
:
"light"
,
"name"
:
"default"
,
"name"
:
"default"
,
"window"
:
{
"window"
:
{
"designWidth"
:
720
,
"designWidth"
:
720
,
...
...
appexecfwk/bundle_standard/bundlemanager/project/napi_test_suite_scene2/src/main/js/test/ExampleJsunit.test.js
浏览文件 @
5b3f7afb
...
@@ -129,7 +129,7 @@ describe('appInfoTest', function () {
...
@@ -129,7 +129,7 @@ describe('appInfoTest', function () {
})
})
it
(
'
getApplicationInfo_0200
'
,
0
,
async
function
(
done
)
{
it
(
'
getApplicationInfo_0200
'
,
0
,
async
function
(
done
)
{
var
datainfo
=
await
demo
.
getApplicationInfo
(
'
com.example.myapplication
1
'
,
8
,
1
)
var
datainfo
=
await
demo
.
getApplicationInfo
(
'
com.example.myapplication
2
'
,
8
,
1
)
expect
(
typeof
datainfo
).
assertEqual
(
"
object
"
)
expect
(
typeof
datainfo
).
assertEqual
(
"
object
"
)
expect
(
datainfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
description
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
description
.
length
).
assertLarger
(
0
)
...
@@ -142,7 +142,7 @@ describe('appInfoTest', function () {
...
@@ -142,7 +142,7 @@ describe('appInfoTest', function () {
})
})
it
(
'
getApplicationInfo_0700
'
,
0
,
async
function
(
done
)
{
it
(
'
getApplicationInfo_0700
'
,
0
,
async
function
(
done
)
{
await
demo
.
getApplicationInfo
(
'
com.example.myapplication
1
'
,
8
,
1
,
(
error
,
datainfo
)
=>
{
await
demo
.
getApplicationInfo
(
'
com.example.myapplication
2
'
,
8
,
1
,
(
error
,
datainfo
)
=>
{
expect
(
typeof
datainfo
).
assertEqual
(
"
object
"
)
expect
(
typeof
datainfo
).
assertEqual
(
"
object
"
)
expect
(
datainfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
description
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
description
.
length
).
assertLarger
(
0
)
...
@@ -155,4 +155,166 @@ describe('appInfoTest', function () {
...
@@ -155,4 +155,166 @@ describe('appInfoTest', function () {
done
()
done
()
})
})
it
(
'
getBundleInfo_0200
'
,
0
,
async
function
(
done
)
{
var
datainfo
=
await
demo
.
getBundleInfo
(
'
com.example.myapplication2
'
,
1
)
expect
(
datainfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
vendor
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
versionCode
).
assertEqual
(
1
)
expect
(
datainfo
.
versionName
).
assertEqual
(
1.0
)
expect
(
datainfo
.
appInfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
appInfo
.
description
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
appInfo
.
label
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
appInfo
.
icon
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
appInfo
.
descriptionId
).
assertEqual
(
16777217
)
done
()
})
it
(
'
getBundleInfo_0700
'
,
0
,
async
function
(
done
)
{
await
demo
.
getBundleInfo
(
'
com.example.myapplication2
'
,
1
,
OnReceiveEvent
)
function
OnReceiveEvent
(
err
,
datainfo
)
{
expect
(
datainfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
vendor
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
versionCode
).
assertEqual
(
1
)
expect
(
datainfo
.
versionName
).
assertEqual
(
1.0
)
expect
(
datainfo
.
appInfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
appInfo
.
description
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
appInfo
.
label
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
appInfo
.
icon
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
appInfo
.
descriptionId
).
assertEqual
(
16777217
)
}
done
()
})
it
(
'
getBundleArchiveInfo_0200
'
,
0
,
async
function
(
done
)
{
var
datainfo
=
await
demo
.
getBundleArchiveInfo
(
'
/data/bmsJstest2.hap
'
,
1
)
expect
(
datainfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
vendor
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
versionCode
).
assertEqual
(
1
)
expect
(
datainfo
.
versionName
).
assertEqual
(
1.0
)
expect
(
datainfo
.
appInfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
appInfo
.
description
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
appInfo
.
label
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
appInfo
.
icon
.
length
).
assertLarger
(
0
)
done
()
})
it
(
'
getBundleArchiveInfo_0700
'
,
0
,
async
function
(
done
)
{
await
demo
.
getBundleArchiveInfo
(
'
/data/bmsJstest2.hap
'
,
1
,
OnReceiveEvent
)
function
OnReceiveEvent
(
err
,
datainfo
)
{
expect
(
datainfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
vendor
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
versionCode
).
assertEqual
(
1
)
expect
(
datainfo
.
versionName
).
assertEqual
(
1.0
)
expect
(
datainfo
.
appInfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
appInfo
.
description
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
appInfo
.
label
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
appInfo
.
icon
.
length
).
assertLarger
(
0
)
}
done
()
})
it
(
'
queryAbilityByWant_0200
'
,
0
,
async
function
(
done
)
{
var
datainfo
=
await
demo
.
queryAbilityByWant
({
want
:{
action
:
"
action.system.home
"
,
entities
:[
"
entity.system.home
"
],
elementName
:
{
deviceId
:
"
0
"
,
bundleName
:
"
com.example.myapplication2
"
,
abilityName
:
"
.MainAbility
"
,
},}},{
params
:{
flags
:
8
,
userId
:
"
0
"
,
}
})
expect
(
datainfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
label
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
description
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
icon
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
moduleName
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
bundleName
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
applicationInfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
applicationInfo
.
description
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
applicationInfo
.
icon
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
applicationInfo
.
label
.
length
).
assertLarger
(
0
)
done
();
})
it
(
'
queryAbilityByWant_0700
'
,
0
,
async
function
(
done
)
{
await
demo
.
queryAbilityByWant
({
want
:
{
action
:
"
action.system.home
"
,
entities
:
[
"
entity.system.home
"
],
elementName
:
{
deviceId
:
"
0
"
,
bundleName
:
"
com.example.myapplication2
"
,
abilityName
:
"
.MainAbility
"
,
},
}
},
{
params
:
{
flags
:
8
,
userId
:
"
0
"
,
}
},
OnReceiveEvent
)
function
OnReceiveEvent
(
err
,
datainfo
)
{
expect
(
datainfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
label
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
description
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
icon
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
moduleName
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
bundleName
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
applicationInfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
applicationInfo
.
description
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
applicationInfo
.
icon
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
applicationInfo
.
label
.
length
).
assertLarger
(
0
)
done
()
}
})
it
(
'
getPermissionDef_0200
'
,
0
,
async
function
(
done
){
await
demo
.
getPermissionDef
(
'
com.permission.CAMERA
'
).
then
((
infos
)
=>
{
expect
(
typeof
infos
).
assertEqual
(
"
object
"
);
expect
(
infos
.
name
).
assertEqual
(
"
com.permission.CAMERA
"
);
expect
(
infos
.
grantMode
).
assertEqual
(
1
);
expect
(
infos
.
availableScope
).
assertEqual
(
2
);
expect
(
infos
.
label
).
assertEqual
(
"
CAMERA permission
"
);
expect
(
infos
.
description
).
assertEqual
(
"
CAMERA permission in detail
"
);
});
await
demo
.
getPermissionDef
(
'
com.permission.music
'
).
then
((
infos
)
=>
{
expect
(
typeof
infos
).
assertEqual
(
"
object
"
);
expect
(
infos
.
name
).
assertEqual
(
"
com.permission.music
"
);
expect
(
infos
.
grantMode
).
assertEqual
(
1
);
expect
(
infos
.
availableScope
).
assertEqual
(
2
);
expect
(
infos
.
label
).
assertEqual
(
"
music permission
"
);
expect
(
infos
.
description
).
assertEqual
(
"
music permission in detail
"
);
});
done
();
})
it
(
'
getPermissionDef_0700
'
,
0
,
async
function
(
done
){
await
demo
.
getPermissionDef
(
'
com.permission.CAMERA
'
,
OnReceiveEvent1
);
await
demo
.
getPermissionDef
(
'
com.permission.music
'
,
OnReceiveEvent2
);
function
OnReceiveEvent1
(
err
,
data
)
{
expect
(
data
.
name
).
assertEqual
(
"
com.permission.CAMERA
"
);
expect
(
data
.
grantMode
).
assertEqual
(
1
);
expect
(
data
.
availableScope
).
assertEqua
(
2
);
expect
(
data
.
label
).
assertEqual
(
"
CAMERA permission
"
);
expect
(
data
.
description
).
assertEqual
(
"
CAMERA permission in detail
"
);
}
function
OnReceiveEvent2
(
err
,
data
)
{
expect
(
data
.
name
).
assertEqual
(
"
com.permission.music
"
);
expect
(
data
.
grantMode
).
assertEqual
(
1
);
expect
(
data
.
availableScope
).
assertEqual
(
2
);
expect
(
data
.
label
).
assertEqual
(
"
music permission
"
);
expect
(
data
.
description
).
assertEqual
(
"
music permission in detail
"
);
}
done
();
})
})
})
appexecfwk/bundle_standard/bundlemanager/project/napi_test_suite_scene3/src/main/config.json
浏览文件 @
5b3f7afb
{
{
"app"
:
{
"app"
:
{
"bundleName"
:
"com.example.
napi_test_suite
"
,
"bundleName"
:
"com.example.
myapplication_3
"
,
"vendor"
:
"example"
,
"vendor"
:
"example"
,
"version"
:
{
"version"
:
{
"code"
:
1
,
"code"
:
1
,
...
@@ -14,9 +14,7 @@
...
@@ -14,9 +14,7 @@
},
},
"deviceConfig"
:
{},
"deviceConfig"
:
{},
"module"
:
{
"module"
:
{
"package"
:
"com.example.myapplication"
,
"package"
:
"com.example.napi_test_suite"
,
"name"
:
".MyApplication"
,
"name"
:
".MyApplication"
,
"deviceType"
:
[
"deviceType"
:
[
"phone"
"phone"
...
@@ -31,18 +29,45 @@
...
@@ -31,18 +29,45 @@
"skills"
:
[
"skills"
:
[
{
{
"entities"
:
[
"entities"
:
[
"entity.system.home"
"entity.system.home"
,
"flag.home.intent.from.system"
],
],
"actions"
:
[
"actions"
:
[
"action.system.home"
"action.system.home"
]
]
}
}
],
],
"name"
:
"com.example.
napi_test_suite
.MainAbility"
,
"name"
:
"com.example.
myapplication
.MainAbility"
,
"icon"
:
"$media:icon"
,
"icon"
:
"$media:icon"
,
"theme"
:
"$media:icon"
,
"description"
:
"$string:mainability_description"
,
"description"
:
"$string:mainability_description"
,
"label"
:
"
$string:app_name
"
,
"label"
:
"
MyApplication
"
,
"type"
:
"page"
,
"type"
:
"page"
,
"formEntity"
:
[
"homeScreen"
,
"searchbox"
],
"defaultFormHeight"
:
100
,
"minFormHeight"
:
200
,
"defaultFormWidth"
:
300
,
"minFormWidth"
:
400
,
"metaData"
:
{
"parameters"
:
[{
"name"
:
"string"
,
"type"
:
"Float"
,
"description"
:
"string_parameters_description"
}],
"results"
:
[{
"name"
:
"string"
,
"type"
:
"Float"
,
"description"
:
"string_results_description"
}],
"customizeData"
:
[{
"name"
:
"string"
,
"value"
:
"string"
,
"extra"
:
""
}]
},
"launchType"
:
"standard"
"launchType"
:
"standard"
}
}
],
],
...
@@ -69,11 +94,13 @@
...
@@ -69,11 +94,13 @@
"description"
:
"WeChat permission in detail"
"description"
:
"WeChat permission in detail"
}
}
],
],
"colorMode"
:
"light"
,
"js"
:
[
"js"
:
[
{
{
"pages"
:
[
"pages"
:
[
"pages/index/index"
"pages/index/index"
],
],
"colorMode"
:
"light"
,
"name"
:
"default"
,
"name"
:
"default"
,
"window"
:
{
"window"
:
{
"designWidth"
:
720
,
"designWidth"
:
720
,
...
...
appexecfwk/bundle_standard/bundlemanager/project/napi_test_suite_scene3/src/main/js/test/ExampleJsunit.test.js
浏览文件 @
5b3f7afb
...
@@ -129,7 +129,7 @@ describe('appInfoTest', function () {
...
@@ -129,7 +129,7 @@ describe('appInfoTest', function () {
})
})
it
(
'
getApplicationInfo_0300
'
,
0
,
async
function
(
done
)
{
it
(
'
getApplicationInfo_0300
'
,
0
,
async
function
(
done
)
{
var
datainfo
=
await
demo
.
getApplicationInfo
(
'
com.example.myapplication
1
'
,
8
,
1
)
var
datainfo
=
await
demo
.
getApplicationInfo
(
'
com.example.myapplication
4
'
,
8
,
1
)
expect
(
typeof
datainfo
).
assertEqual
(
"
object
"
)
expect
(
typeof
datainfo
).
assertEqual
(
"
object
"
)
expect
(
datainfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
description
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
description
.
length
).
assertLarger
(
0
)
...
@@ -142,7 +142,7 @@ describe('appInfoTest', function () {
...
@@ -142,7 +142,7 @@ describe('appInfoTest', function () {
})
})
it
(
'
getApplicationInfo_0800
'
,
0
,
async
function
(
done
)
{
it
(
'
getApplicationInfo_0800
'
,
0
,
async
function
(
done
)
{
await
demo
.
getApplicationInfo
(
'
com.example.myapplication
1
'
,
8
,
1
,
(
error
,
datainfo
)
=>
{
await
demo
.
getApplicationInfo
(
'
com.example.myapplication
4
'
,
8
,
1
,
(
error
,
datainfo
)
=>
{
expect
(
typeof
datainfo
).
assertEqual
(
"
object
"
)
expect
(
typeof
datainfo
).
assertEqual
(
"
object
"
)
expect
(
datainfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
description
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
description
.
length
).
assertLarger
(
0
)
...
@@ -155,4 +155,188 @@ describe('appInfoTest', function () {
...
@@ -155,4 +155,188 @@ describe('appInfoTest', function () {
done
()
done
()
})
})
it
(
'
getBundleInfo_0300
'
,
0
,
async
function
(
done
)
{
var
datainfo
=
await
demo
.
getBundleInfo
(
'
com.example.myapplication4
'
,
1
)
expect
(
datainfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
vendor
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
versionCode
).
assertEqual
(
1
)
expect
(
datainfo
.
versionName
).
assertEqual
(
1.0
)
expect
(
datainfo
.
appInfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
appInfo
.
description
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
appInfo
.
label
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
appInfo
.
icon
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
appInfo
.
descriptionId
).
assertEqual
(
16777217
)
done
()
})
it
(
'
getBundleInfo_0800
'
,
0
,
async
function
(
done
)
{
await
demo
.
getBundleInfo
(
'
com.example.myapplication4
'
,
1
,
OnReceiveEvent
)
function
OnReceiveEvent
(
err
,
datainfo
)
{
expect
(
datainfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
vendor
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
versionCode
).
assertEqual
(
1
)
expect
(
datainfo
.
versionName
).
assertEqual
(
1.0
)
expect
(
datainfo
.
appInfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
appInfo
.
description
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
appInfo
.
label
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
appInfo
.
icon
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
appInfo
.
descriptionId
).
assertEqual
(
16777217
)
}
done
()
})
it
(
'
getBundleArchiveInfo_0300
'
,
0
,
async
function
(
done
)
{
var
datainfo
=
await
demo
.
getBundleArchiveInfo
(
'
/data/bmsJstest4.hap
'
,
1
)
expect
(
datainfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
vendor
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
versionCode
).
assertEqual
(
1
)
expect
(
datainfo
.
versionName
).
assertEqual
(
1.0
)
expect
(
datainfo
.
appInfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
appInfo
.
description
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
appInfo
.
label
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
appInfo
.
icon
.
length
).
assertLarger
(
0
)
done
()
})
it
(
'
getBundleArchiveInfo_0800
'
,
0
,
async
function
(
done
)
{
await
demo
.
getBundleArchiveInfo
(
'
/data/bmsJstest4.hap
'
,
1
,
OnReceiveEvent
)
function
OnReceiveEvent
(
err
,
datainfo
)
{
expect
(
datainfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
vendor
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
versionCode
).
assertEqual
(
1
)
expect
(
datainfo
.
versionName
).
assertEqual
(
1.0
)
expect
(
datainfo
.
appInfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
appInfo
.
description
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
appInfo
.
label
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
appInfo
.
icon
.
length
).
assertLarger
(
0
)
}
done
()
})
it
(
'
queryAbilityByWant_0300
'
,
0
,
async
function
(
done
)
{
var
datainfo
=
await
demo
.
queryAbilityByWant
({
want
:{
action
:
"
action.system.home
"
,
entities
:[
"
entity.system.home
"
],
elementName
:
{
deviceId
:
"
0
"
,
bundleName
:
"
com.example.myapplication4
"
,
abilityName
:
"
.MainAbility
"
,
},}},{
params
:{
flags
:
8
,
userId
:
"
0
"
,
}
})
expect
(
datainfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
label
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
description
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
icon
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
moduleName
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
bundleName
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
applicationInfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
applicationInfo
.
description
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
applicationInfo
.
icon
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
applicationInfo
.
label
.
length
).
assertLarger
(
0
)
done
();
})
it
(
'
queryAbilityByWant_0800
'
,
0
,
async
function
(
done
)
{
await
demo
.
queryAbilityByWant
({
want
:
{
action
:
"
action.system.home
"
,
entities
:
[
"
entity.system.home
"
],
elementName
:
{
deviceId
:
"
0
"
,
bundleName
:
"
com.example.myapplication4
"
,
abilityName
:
"
.MainAbility
"
,
},
}
},
{
params
:
{
flags
:
8
,
userId
:
"
0
"
,
}
},
OnReceiveEvent
)
function
OnReceiveEvent
(
err
,
datainfo
)
{
expect
(
datainfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
label
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
description
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
icon
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
moduleName
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
bundleName
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
applicationInfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
applicationInfo
.
description
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
applicationInfo
.
icon
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
applicationInfo
.
label
.
length
).
assertLarger
(
0
)
done
()
}
})
it
(
'
getPermissionDef_0300
'
,
0
,
async
function
(
done
){
await
demo
.
getPermissionDef
(
'
com.permission.CAMERA
'
).
then
((
infos
)
=>
{
expect
(
typeof
infos
).
assertEqual
(
"
object
"
);
expect
(
infos
.
name
).
assertEqual
(
"
com.permission.CAMERA
"
);
expect
(
infos
.
grantMode
).
assertEqual
(
1
);
expect
(
infos
.
availableScope
).
assertEqual
(
2
);
expect
(
infos
.
label
).
assertEqual
(
"
CAMERA permission
"
);
expect
(
infos
.
description
).
assertEqual
(
"
CAMERA permission in detail
"
);
});
await
demo
.
getPermissionDef
(
'
com.permission.music
'
).
then
((
infos
)
=>
{
expect
(
typeof
infos
).
assertEqual
(
"
object
"
);
expect
(
infos
.
name
).
assertEqual
(
"
com.permission.music
"
);
expect
(
infos
.
grantMode
).
assertEqual
(
1
);
expect
(
infos
.
availableScope
).
assertEqual
(
2
);
expect
(
infos
.
label
).
assertEqual
(
"
music permission
"
);
expect
(
infos
.
description
).
assertEqual
(
"
music permission in detail
"
);
});
await
demo
.
getPermissionDef
(
'
com.permission.WeChat
'
).
then
((
infos
)
=>
{
expect
(
typeof
infos
).
assertEqual
(
"
object
"
);
expect
(
infos
.
name
).
assertEqual
(
"
com.permission.WeChat
"
);
expect
(
infos
.
grantMode
).
assertEqual
(
1
);
expect
(
infos
.
availableScope
).
assertEqual
(
2
);
expect
(
infos
.
label
).
assertEqual
(
"
WeChat permission
"
);
expect
(
infos
.
description
).
assertEqual
(
"
WeChat permission in detail
"
);
});
done
();
})
it
(
'
getPermissionDef_0800
'
,
0
,
async
function
(
done
){
await
demo
.
getPermissionDef
(
'
com.permission.CAMERA
'
,
OnReceiveEvent1
);
await
demo
.
getPermissionDef
(
'
com.permission.music
'
,
OnReceiveEvent2
);
await
demo
.
getPermissionDef
(
'
com.permission.WeChat
'
,
OnReceiveEvent3
);
function
OnReceiveEvent1
(
err
,
data
)
{
expect
(
data
.
name
).
assertEqual
(
"
com.permission.CAMERA
"
);
expect
(
data
.
grantMode
).
assertEqual
(
1
);
expect
(
data
.
availableScope
).
assertEqual
(
2
);
expect
(
data
.
label
).
assertEqual
(
"
CAMERA permission
"
);
expect
(
data
.
description
).
assertEqual
(
"
CAMERA permission in detail
"
);
}
function
OnReceiveEvent2
(
err
,
data
)
{
expect
(
data
.
name
).
assertEqual
(
"
com.permission.music
"
);
expect
(
data
.
grantMode
).
assertEqual
(
1
);
expect
(
data
.
availableScope
).
assertEqual
(
2
);
expect
(
data
.
label
).
assertEqual
(
"
music permission
"
);
expect
(
data
.
description
).
assertEqual
(
"
music permission in detail
"
);
}
function
OnReceiveEvent3
(
err
,
data
)
{
expect
(
data
.
name
).
assertEqual
(
"
com.permission.WeChat
"
);
expect
(
data
.
grantMode
).
assertEqual
(
1
);
expect
(
data
.
availableScope
).
assertEqual
(
2
);
expect
(
data
.
label
).
assertEqual
(
"
WeChat permission
"
);
expect
(
data
.
description
).
assertEqual
(
"
WeChat permission in detail
"
);
}
done
();
})
})
})
appexecfwk/bundle_standard/bundlemanager/project/napi_test_suite_scene4/package.json
0 → 100644
浏览文件 @
5b3f7afb
{}
appexecfwk/bundle_standard/bundlemanager/project/napi_test_suite_scene4/src/main/config.json
0 → 100644
浏览文件 @
5b3f7afb
{
"app"
:
{
"bundleName"
:
"com.example.napi_test_suite"
,
"vendor"
:
"example"
,
"version"
:
{
"code"
:
1
,
"name"
:
"1.0"
},
"apiVersion"
:
{
"compatible"
:
5
,
"target"
:
5
,
"releaseType"
:
"Beta1"
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"com.example.napi_test_suite"
,
"name"
:
".MyApplication"
,
"deviceType"
:
[
"phone"
],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
},
"abilities"
:
[
{
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
,
"flag.home.intent.from.system"
],
"actions"
:
[
"action.system.home"
]
}
],
"name"
:
"com.example.napi_test_suite.MainAbility"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:mainability_description"
,
"label"
:
"$string:app_name"
,
"type"
:
"page"
,
"launchType"
:
"standard"
}
],
"defPermissions"
:
[
{
"name"
:
"com.permission.CAMERA"
,
"grantMode"
:
"system_grant"
,
"availableScope"
:
[
"signature"
],
"label"
:
"CAMERA permission"
,
"description"
:
"CAMERA permission in detail"
},
{
"name"
:
"com.permission.music"
,
"grantMode"
:
"system_grant"
,
"availableScope"
:
[
"signature"
],
"label"
:
"music permission"
,
"description"
:
"music permission in detail"
},
{
"name"
:
"com.permission.WeChat"
,
"grantMode"
:
"system_grant"
,
"availableScope"
:
[
"signature"
],
"label"
:
"WeChat permission"
,
"description"
:
"WeChat permission in detail"
}
],
"js"
:
[
{
"pages"
:
[
"pages/index/index"
],
"name"
:
"default"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
}
]
}
}
\ No newline at end of file
appexecfwk/bundle_standard/bundlemanager/project/napi_test_suite_scene4/src/main/js/default/app.js
0 → 100644
浏览文件 @
5b3f7afb
export
default
{
onCreate
()
{
console
.
info
(
'
AceApplication onCreate
'
);
},
onDestroy
()
{
console
.
info
(
'
AceApplication onDestroy
'
);
}
};
appexecfwk/bundle_standard/bundlemanager/project/napi_test_suite_scene4/src/main/js/default/i18n/en-US.json
0 → 100644
浏览文件 @
5b3f7afb
{
"strings"
:
{
"hello"
:
"Hello"
,
"world"
:
"World"
}
}
\ No newline at end of file
appexecfwk/bundle_standard/bundlemanager/project/napi_test_suite_scene4/src/main/js/default/i18n/zh-CN.json
0 → 100644
浏览文件 @
5b3f7afb
{
"strings"
:
{
"hello"
:
"您好"
,
"world"
:
"世界"
}
}
\ No newline at end of file
appexecfwk/bundle_standard/bundlemanager/project/napi_test_suite_scene4/src/main/js/default/pages/index/index.css
0 → 100644
浏览文件 @
5b3f7afb
.container
{
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
}
.title
{
font-size
:
100px
;
}
appexecfwk/bundle_standard/bundlemanager/project/napi_test_suite_scene4/src/main/js/default/pages/index/index.hml
0 → 100644
浏览文件 @
5b3f7afb
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
appexecfwk/bundle_standard/bundlemanager/project/napi_test_suite_scene4/src/main/js/default/pages/index/index.js
0 → 100644
浏览文件 @
5b3f7afb
import
file
from
'
@system.file
'
import
app
from
'
@system.app
'
import
device
from
'
@system.device
'
import
router
from
'
@system.router
'
import
{
Core
,
ExpectExtend
,
ReportExtend
}
from
'
deccjsunit/index
'
export
default
{
data
:
{
title
:
""
},
onInit
()
{
this
.
title
=
this
.
$t
(
'
strings.world
'
);
},
onShow
()
{
console
.
info
(
'
onShow finish
'
)
const
core
=
Core
.
getInstance
()
const
expectExtend
=
new
ExpectExtend
({
'
id
'
:
'
extend
'
})
const
reportExtend
=
new
ReportExtend
(
file
)
core
.
addService
(
'
expect
'
,
expectExtend
)
core
.
addService
(
'
report
'
,
reportExtend
)
core
.
init
()
const
configService
=
core
.
getDefaultService
(
'
config
'
)
configService
.
setConfig
(
this
)
require
(
'
../../../test/List.test
'
)
core
.
execute
()
},
onReady
()
{
},
}
\ No newline at end of file
appexecfwk/bundle_standard/bundlemanager/project/napi_test_suite_scene4/src/main/js/test/ExampleJsunit.test.js
0 → 100644
浏览文件 @
5b3f7afb
import
app
from
'
@system.app
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
import
demo
from
'
@ohos.bundle
'
describe
(
'
appInfoTest
'
,
function
()
{
it
(
'
getPermissionDef_0500
'
,
0
,
async
function
(
done
){
await
demo
.
getPermissionDef
(
'
error
'
).
then
((
infos
)
=>
{
expect
(
typeof
infos
).
assertEqual
(
"
object
"
);
expect
(
infos
.
name
).
assertEqual
(
""
);
expect
(
infos
.
grantMode
).
assertEqual
(
""
);
expect
(
infos
.
availableScope
).
assertEqual
(
0
);
expect
(
infos
.
label
).
assertEqual
(
""
);
expect
(
infos
.
description
).
assertEqual
(
""
);
});
done
();
})
it
(
'
getPermissionDef_1000
'
,
0
,
async
function
(
done
){
await
demo
.
getPermissionDef
(
'
error
'
,
OnReceiveEvent
);
function
OnReceiveEvent
(
err
,
data
)
{
expect
(
typeof
data
).
assertEqual
(
"
object
"
);
expect
(
data
.
name
).
assertEqual
(
""
);
expect
(
data
.
availableScope
).
assertEqual
(
0
);
expect
(
data
.
grantMode
).
assertEqual
(
""
);
expect
(
data
.
label
).
assertEqual
(
""
);
3
.
expect
(
data
.
description
).
assertEqual
(
""
);
}
done
();
})
it
(
'
install_0100
'
,
0
,
async
function
(
done
)
{
await
demo
.
getBundleInstaller
().
then
((
data
)
=>
{
data
.
uninstall
(
'
com.example.myapplication1
'
,
{
param
:
{
userId
:
0
,
isKeepData
:
false
}
});
data
.
uninstall
(
'
com.example.myapplication2
'
,
{
param
:
{
userId
:
0
,
isKeepData
:
false
}
});
data
.
uninstall
(
'
com.example.myapplication4
'
,
{
param
:
{
userId
:
0
,
isKeepData
:
false
}
});
data
.
uninstall
(
'
com.example.myapplication5
'
,
{
param
:
{
userId
:
0
,
isKeepData
:
false
}
});
data
.
uninstall
(
'
com.example.myapplication6
'
,
{
param
:
{
userId
:
0
,
isKeepData
:
false
}
});
data
.
install
([
'
/data/bmsJstest1.hap
'
],
{
param
:
{
userId
:
0
,
isKeepData
:
false
}
},
OnReceiveinstallEvent
);
data
.
uninstall
(
'
com.example.myapplication1
'
,
{
param
:
{
userId
:
0
,
isKeepData
:
false
}
});
function
OnReceiveinstallEvent
(
err
,
data
)
{
expect
(
typeof
data
).
assertEqual
(
"
object
"
);
expect
(
data
.
statusMessage
).
assertEqual
(
"
SUCCESS
"
);
}
});
done
();
})
it
(
'
install_0200
'
,
0
,
async
function
(
done
)
{
await
demo
.
getBundleInstaller
().
then
((
data
)
=>
{
data
.
install
([
'
/data/bmsJstest2.hap
'
],
{
param
:
{
userId
:
0
,
isKeepData
:
false
}
},
OnReceiveinstallEvent
);
data
.
install
([
'
/data/bmsJstest3.hap
'
],
{
param
:
{
userId
:
0
,
isKeepData
:
false
}
},
OnReceiveinstallEvent
);
data
.
uninstall
(
'
com.example.myapplication2
'
,
{
param
:
{
userId
:
0
,
isKeepData
:
false
}
});
function
OnReceiveinstallEvent
(
err
,
data
)
{
expect
(
typeof
data
).
assertEqual
(
"
object
"
);
expect
(
data
.
statusMessage
).
assertEqual
(
"
SUCCESS
"
);
}
});
done
();
})
it
(
'
install_0300
'
,
0
,
async
function
(
done
)
{
await
demo
.
getBundleInstaller
().
then
((
data
)
=>
{
data
.
install
([
'
/data/bmsJstest4.hap
'
],
{
param
:
{
userId
:
0
,
isKeepData
:
false
}
},
OnReceiveinstallEvent
);
data
.
install
([
'
/data/bmsJstest5.hap
'
],
{
param
:
{
userId
:
0
,
isKeepData
:
false
}
},
OnReceiveinstallEvent
);
data
.
install
([
'
/data/bmsJstest6.hap
'
],
{
param
:
{
userId
:
0
,
isKeepData
:
false
}
},
OnReceiveinstallEvent
);
data
.
uninstall
(
'
com.example.myapplication4
'
,
{
param
:
{
userId
:
0
,
isKeepData
:
false
}
});
data
.
uninstall
(
'
com.example.myapplication5
'
,
{
param
:
{
userId
:
0
,
isKeepData
:
false
}
});
data
.
uninstall
(
'
com.example.myapplication6
'
,
{
param
:
{
userId
:
0
,
isKeepData
:
false
}
});
function
OnReceiveinstallEvent
(
err
,
data
)
{
expect
(
typeof
data
).
assertEqual
(
"
object
"
);
expect
(
data
.
statusMessage
).
assertEqual
(
"
SUCCESS
"
);
}
});
done
();
})
it
(
'
install_0400
'
,
0
,
async
function
(
done
)
{
await
demo
.
getBundleInstaller
().
then
((
data
)
=>
{
data
.
install
([
'
error
'
],
{
param
:
{
userId
:
0
,
isKeepData
:
false
}
},
OnReceiveinstallEvent
);
function
OnReceiveinstallEvent
(
err
,
data
)
{
expect
(
typeof
data
).
assertEqual
(
"
object
"
);
expect
(
data
.
statusMessage
).
assertEqual
(
"
STATUS_INSTALL_FAILURE_INVALID
"
);
}
});
done
();
})
it
(
'
install_0500
'
,
0
,
async
function
(
done
)
{
await
demo
.
getBundleInstaller
().
then
((
data
)
=>
{
data
.
install
([
''
],
{
param
:
{
userId
:
0
,
isKeepData
:
false
}
},
OnReceiveinstallEvent
);
function
OnReceiveinstallEvent
(
err
,
data
)
{
expect
(
typeof
data
).
assertEqual
(
"
object
"
);
expect
(
data
.
statusMessage
).
assertEqual
(
"
STATUS_INSTALL_FAILURE_INVALID
"
);
}
});
done
();
})
it
(
'
uninstall_0100
'
,
0
,
async
function
(
done
)
{
await
demo
.
getBundleInstaller
().
then
((
data
)
=>
{
data
.
install
([
'
/data/bmsJstest1.hap
'
],
{
param
:
{
userId
:
0
,
isKeepData
:
false
}
});
data
.
uninstall
(
'
com.example.myapplication1
'
,
{
param
:
{
userId
:
0
,
isKeepData
:
false
}
},
OnReceiveinstallEvent
);
function
OnReceiveinstallEvent
(
err
,
data
)
{
expect
(
typeof
data
).
assertEqual
(
"
object
"
);
expect
(
data
.
statusMessage
).
assertEqual
(
"
SUCCESS
"
);
}
});
done
();
})
it
(
'
uninstall_0200
'
,
0
,
async
function
(
done
)
{
await
demo
.
getBundleInstaller
().
then
((
data
)
=>
{
data
.
install
([
'
/data/bmsJstest1.hap
'
],
{
param
:
{
userId
:
0
,
isKeepData
:
false
}
});
data
.
install
([
'
/data/bmsJstest2.hap
'
],
{
param
:
{
userId
:
0
,
isKeepData
:
false
}
});
data
.
uninstall
(
'
com.example.myapplication1
'
,
{
param
:
{
userId
:
0
,
isKeepData
:
false
}
},
OnReceiveinstallEvent
);
data
.
uninstall
(
'
com.example.myapplication2
'
,
{
param
:
{
userId
:
0
,
isKeepData
:
false
}
},
OnReceiveinstallEvent
);
function
OnReceiveinstallEvent
(
err
,
data
)
{
expect
(
typeof
data
).
assertEqual
(
"
object
"
);
expect
(
data
.
statusMessage
).
assertEqual
(
"
SUCCESS
"
);
}
});
done
();
})
it
(
'
uninstall_0300
'
,
0
,
async
function
(
done
)
{
await
demo
.
getBundleInstaller
().
then
((
data
)
=>
{
data
.
install
([
'
/data/bmsJstest4.hap
'
],
{
param
:
{
userId
:
0
,
isKeepData
:
false
}
});
data
.
install
([
'
/data/bmsJstest5.hap
'
],
{
param
:
{
userId
:
0
,
isKeepData
:
false
}
});
data
.
install
([
'
/data/bmsJstest6.hap
'
],
{
param
:
{
userId
:
0
,
isKeepData
:
false
}
});
data
.
uninstall
(
'
com.example.myapplication4
'
,
{
param
:
{
userId
:
0
,
isKeepData
:
false
}
},
OnReceiveinstallEvent
);
data
.
uninstall
(
'
com.example.myapplication5
'
,
{
param
:
{
userId
:
0
,
isKeepData
:
false
}
},
OnReceiveinstallEvent
);
data
.
uninstall
(
'
com.example.myapplication6
'
,
{
param
:
{
userId
:
0
,
isKeepData
:
false
}
},
OnReceiveinstallEvent
);
function
OnReceiveinstallEvent
(
err
,
data
)
{
expect
(
typeof
data
).
assertEqual
(
"
object
"
);
expect
(
data
.
statusMessage
).
assertEqual
(
"
SUCCESS
"
);
}
});
done
();
})
it
(
'
uninstall_0400
'
,
0
,
async
function
(
done
)
{
await
demo
.
getBundleInstaller
().
then
((
data
)
=>
{
data
.
uninstall
(
''
,
{
param
:
{
userId
:
0
,
isKeepData
:
false
}
},
OnReceiveinstallEvent
);
function
OnReceiveinstallEvent
(
err
,
data
)
{
expect
(
typeof
data
).
assertEqual
(
"
object
"
);
expect
(
data
.
statusMessage
).
assertEqual
(
"
STATUS_UNINSTALL_FAILURE_ABORTED
"
);
}
});
done
();
})
it
(
'
uninstall_0500
'
,
0
,
async
function
(
done
)
{
await
demo
.
getBundleInstaller
().
then
((
data
)
=>
{
data
.
uninstall
(
''
,
{
param
:
{
userId
:
0
,
isKeepData
:
false
}
},
OnReceiveinstallEvent
);
function
OnReceiveinstallEvent
(
err
,
data
)
{
expect
(
typeof
data
).
assertEqual
(
"
object
"
);
expect
(
data
.
statusMessage
).
assertEqual
(
"
STATUS_UNINSTALL_FAILURE_ABORTED
"
);
}
});
done
();
})
})
\ No newline at end of file
appexecfwk/bundle_standard/bundlemanager/project/napi_test_suite_scene4/src/main/js/test/List.test.js
0 → 100644
浏览文件 @
5b3f7afb
require
(
'
./ExampleJsunit.test.js
'
)
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录