Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
155448c7
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
155448c7
编写于
1月 26, 2022
作者:
R
r00559040
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
xts update
Signed-off-by:
N
r00559040
<
ry.renyi@huawei.com
>
上级
65f7cc95
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
152 addition
and
34 deletion
+152
-34
aafwk/aafwk_standard/amszipfileunzipfilest/entry/src/main/js/test/ContextJsunit.test.js
...eunzipfilest/entry/src/main/js/test/ContextJsunit.test.js
+45
-0
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/entry/src/main/js/test/ActsBmsFormsInfoTest.test.js
...stest/entry/src/main/js/test/ActsBmsFormsInfoTest.test.js
+1
-1
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/entry/src/main/js/test/ActsBmsQueryAbilityByWant.test.js
.../entry/src/main/js/test/ActsBmsQueryAbilityByWant.test.js
+10
-3
appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/test/ExampleJsunit.test.js
...emanagertest/entry/src/main/js/test/ExampleJsunit.test.js
+71
-29
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmssceneone/src/main/config.json
...ndlemanager/sceneProject/bmssceneone/src/main/config.json
+25
-1
未找到文件。
aafwk/aafwk_standard/amszipfileunzipfilest/entry/src/main/js/test/ContextJsunit.test.js
浏览文件 @
155448c7
...
...
@@ -1892,4 +1892,49 @@ it('FWK_ZipFile_5100', 0, async function (done) {
console
.
log
(
"
==================FWK_ZipFile_5100 end==================
"
);
})
/*
* @tc.number: FWK_ZipFile_5200
* @tc.name: zipFile
* @tc.desc: strategy.COMPRESS_STRATEGY_FIXED
*/
it
(
'
FWK_ZipFile_5200
'
,
0
,
async
function
(
done
)
{
console
.
log
(
"
==================FWK_ZipFile_5200 start==================
"
);
var
src
=
"
/data/test/ceshi.txt
"
;
var
zipDest
=
"
/data/testA/ceshi.zip
"
;
var
unzipDir
=
"
/data/testA/
"
;
var
unzipDest
=
"
/data/testA/ceshi.txt
"
;
try
{
var
options
=
{};
options
.
strategy
=
zlib
.
CompressStrategy
.
COMPRESS_STRATEGY_FIXED
,
await
zlib
.
zipFile
(
src
,
zipDest
,
options
,
(
err
,
data
)
=>
{
var
zipStat
=
fileio
.
statSync
(
zipDest
);
var
isFile
=
zipStat
.
isFile
();
expect
(
isFile
).
assertTrue
();
var
srcSize
=
fileio
.
statSync
(
src
).
size
;
var
destSize
=
zipStat
.
size
;
expect
(
srcSize
>
destSize
).
assertTrue
();
expect
(
data
).
assertEqual
(
zlib
.
ErrorCode
.
ERROR_CODE_OK
);
zlib
.
unzipFile
(
zipDest
,
unzipDir
,
options
,
(
err
,
data
)
=>
{
var
unzipStat
=
fileio
.
statSync
(
unzipDest
);
var
isFile
=
unzipStat
.
isFile
();
expect
(
isFile
).
assertTrue
();
var
destSize
=
unzipStat
.
size
;
var
originSize
=
fileio
.
statSync
(
src
).
size
;
var
result
=
(
originSize
==
destSize
);
expect
(
result
).
assertTrue
();
expect
(
data
).
assertEqual
(
zlib
.
ErrorCode
.
ERROR_CODE_OK
);
done
();
})
});
}
catch
(
err
)
{
console
.
error
(
'
FWK_ZipFile_5200 err:
'
+
err
);
done
();
}
console
.
log
(
"
==================FWK_ZipFile_5200 end==================
"
);
})
})
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/entry/src/main/js/test/ActsBmsFormsInfoTest.test.js
浏览文件 @
155448c7
...
...
@@ -1786,7 +1786,7 @@ describe('ActsBmsFormsInfoTest', function () {
expect
(
typeof
dataInfo
.
description
).
assertEqual
(
'
string
'
);
expect
(
typeof
dataInfo
.
descriptionId
).
assertEqual
(
'
number
'
);
expect
(
typeof
dataInfo
.
type
).
assertEqual
(
'
number
'
);
expect
(
typeof
dataInfo
.
colorMode
).
assertEqual
(
'
number
'
);
expect
(
dataInfo
.
colorMode
).
assertEqual
(
bundle
.
ColorMode
.
LIGHT_MODE
);
expect
(
typeof
dataInfo
.
defaultFlag
).
assertEqual
(
'
boolean
'
);
expect
(
typeof
dataInfo
.
jsComponentName
).
assertEqual
(
'
string
'
);
expect
(
typeof
dataInfo
.
formVisibleNotify
).
assertEqual
(
'
boolean
'
);
...
...
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/entry/src/main/js/test/ActsBmsQueryAbilityByWant.test.js
浏览文件 @
155448c7
...
...
@@ -39,7 +39,8 @@ describe('ActsBmsQueryAbilityByWant', function () {
action
:
[
'
action.system.home
'
],
entities
:
[
'
entity.system.home
'
],
bundleName
:
BUNDLE_NAME1
},
132
,
0
,
(
err
,
data
)
=>
{
},
bundle
.
BundleFlag
.
GET_ABILITY_INFO_WITH_APPLICATION
|
bundle
.
BundleFlag
.
GET_ABILITY_INFO_SYSTEMAPP_ONLY
,
0
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
'
bms_queryAbilityByWant_0100 test query system app err is
'
+
err
)
expect
(
err
).
assertEqual
(
1
);
...
...
@@ -51,6 +52,9 @@ describe('ActsBmsQueryAbilityByWant', function () {
isKeepData
:
false
}
,
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
}
...
...
@@ -78,8 +82,9 @@ describe('ActsBmsQueryAbilityByWant', function () {
{
action
:
[
'
action.system.home
'
],
entities
:
[
'
entity.system.home
'
]
}
,
132
,
0
).
then
(
data
=>
{
},
bundle
.
BundleFlag
.
GET_ABILITY_INFO_WITH_APPLICATION
|
bundle
.
BundleFlag
.
GET_ABILITY_INFO_SYSTEMAPP_ONLY
,
0
).
then
(
data
=>
{
for
(
let
i
=
0
;
i
<
data
.
length
;
++
i
)
{
var
jsondata
=
JSON
.
stringify
(
data
[
i
]);
console
.
log
(
'
bms_queryAbilityByWant_0200 test query system app
'
+
jsondata
)
...
...
@@ -89,6 +94,8 @@ describe('ActsBmsQueryAbilityByWant', function () {
}
).
catch
(
err
=>
{
console
.
log
(
'
bms_queryAbilityByWant_0200 test query system app err is
'
+
err
)
expect
(
err
).
assertFail
()
done
();
})
})
...
...
appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/test/ExampleJsunit.test.js
浏览文件 @
155448c7
...
...
@@ -84,7 +84,8 @@ describe('ActsBundleManagerTest', function () {
getInfo
();
});
async
function
getInfo
()
{
var
datainfo
=
await
demo
.
getBundleInfo
(
NAME1
,
demo
.
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
)
var
datainfo
=
await
demo
.
getBundleInfo
(
NAME1
,
demo
.
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
|
demo
.
BundleFlag
.
GET_BUNDLE_WITH_REQUESTED_PERMISSION
)
expect
(
datainfo
.
name
).
assertEqual
(
NAME1
)
expect
(
datainfo
.
vendor
).
assertEqual
(
"
example
"
)
expect
(
datainfo
.
versionCode
).
assertEqual
(
VERSIONCODE1
)
...
...
@@ -100,8 +101,11 @@ describe('ActsBundleManagerTest', function () {
expect
(
datainfo
.
appInfo
.
systemApp
).
assertEqual
(
true
)
expect
(
datainfo
.
appInfo
.
supportedModes
).
assertEqual
(
0
)
expect
(
datainfo
.
updateTime
).
assertLarger
(
0
)
expect
(
datainfo
.
reqPermissions
.
length
).
assertEqual
(
0
)
expect
(
datainfo
.
reqPermissionDetails
.
length
).
assertEqual
(
0
)
expect
(
datainfo
.
reqPermissions
[
0
]).
assertEqual
(
"
com.permission.PERMISSION_A
"
)
expect
(
datainfo
.
reqPermissionDetails
[
0
].
name
).
assertEqual
(
"
com.permission.PERMISSION_A
"
)
expect
(
datainfo
.
reqPermissionDetails
[
0
].
reason
).
assertEqual
(
"
Need PERMISSION_A
"
)
expect
(
datainfo
.
reqPermissionDetails
[
0
].
usedScene
.
abilities
[
0
]).
assertEqual
(
NAME1
+
"
.MainAbility
"
)
expect
(
datainfo
.
reqPermissionDetails
[
0
].
usedScene
.
when
).
assertEqual
(
"
always
"
)
expect
(
datainfo
.
compatibleVersion
).
assertEqual
(
5
)
expect
(
datainfo
.
targetVersion
).
assertEqual
(
5
)
expect
(
datainfo
.
isCompressNativeLibs
).
assertEqual
(
false
)
...
...
@@ -455,7 +459,9 @@ describe('ActsBundleManagerTest', function () {
getInfo
();
});
async
function
getInfo
()
{
await
demo
.
getApplicationInfo
(
NAME1
,
demo
.
BundleFlag
.
GET_APPLICATION_INFO_WITH_PERMISSION
,
0
).
then
(
datainfo
=>
{
await
demo
.
getApplicationInfo
(
NAME1
,
demo
.
BundleFlag
.
GET_APPLICATION_INFO_WITH_PERMISSION
|
demo
.
BundleFlag
.
GET_APPLICATION_INFO_WITH_METADATA
,
0
).
then
(
datainfo
=>
{
expect
(
typeof
datainfo
).
assertEqual
(
OBJECT
)
console
.
info
(
"
getApplicationInfo success:
"
+
JSON
.
stringify
(
datainfo
))
expect
(
datainfo
.
moduleSourceDirs
.
length
).
assertLarger
(
0
)
...
...
@@ -472,6 +478,9 @@ describe('ActsBundleManagerTest', function () {
expect
(
datainfo
.
process
).
assertEqual
(
""
)
expect
(
datainfo
.
enabled
).
assertEqual
(
true
)
expect
(
datainfo
.
flags
).
assertEqual
(
0
)
expect
(
datainfo
.
metaData
.
entry
[
0
].
name
).
assertEqual
(
"
metaDataName
"
)
expect
(
datainfo
.
metaData
.
entry
[
0
].
value
).
assertEqual
(
"
metaDataValue
"
)
expect
(
datainfo
.
metaData
.
entry
[
0
].
extra
).
assertEqual
(
"
$string:app_name
"
)
expect
(
datainfo
.
moduleSourceDirs
.
length
).
assertLarger
(
0
)
for
(
var
j
=
0
;
j
<
datainfo
.
moduleInfos
;
j
++
)
{
expect
(
datainfo
.
moduleInfos
[
j
].
moduleName
).
assertEqual
(
"
entry
"
)
...
...
@@ -2142,6 +2151,7 @@ describe('ActsBundleManagerTest', function () {
expect
(
datainfo
.
moduleName
).
assertEqual
(
"
entry
"
)
expect
(
datainfo
.
bundleName
).
assertEqual
(
NAME1
)
expect
(
datainfo
.
type
).
assertEqual
(
1
)
expect
(
datainfo
.
subType
).
assertEqual
(
demo
.
AbilitySubType
.
UNSPECIFIED
)
expect
(
datainfo
.
orientation
).
assertEqual
(
0
)
expect
(
datainfo
.
launchMode
).
assertEqual
(
demo
.
LaunchMode
.
STANDARD
)
expect
(
datainfo
.
permissions
[
0
]).
assertEqual
(
"
com.permission.BMS_PERMISSION_CAMERA
"
)
...
...
@@ -2245,24 +2255,37 @@ describe('ActsBundleManagerTest', function () {
*/
it
(
'
queryAbilityByWant_0300
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
()
installData
.
install
([
PATH
+
BMSJSTEST4
,
PATH
+
BMSJSTEST5
,
PATH
+
BMSJSTEST6
],
{
installData
.
install
([
PATH
+
BMSJSTEST4
],
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
-
1
);
expect
(
data
.
status
).
assertEqual
(
3
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
STATUS_INSTALL_FAILURE_INVALID
'
);
expect
(
data
.
status
).
assertEqual
(
0
);
installData
.
install
([
PATH
+
BMSJSTEST5
],
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
expect
(
data
.
status
).
assertEqual
(
0
);
installData
.
install
([
PATH
+
BMSJSTEST6
],
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
expect
(
data
.
status
).
assertEqual
(
0
);
getInfo
();
});
});
});
async
function
getInfo
()
{
demo
.
queryAbilityByWant
(
{
"
bundleName
"
:
"
com.example.myapplication4
"
,
"
abilityName
"
:
"
com.example.myapplication.MainAbility
"
,
entities
:
[
'
entity.system.home
'
,
'
entitiesentities
'
]
},
4
,
0
).
then
(
data
=>
{
let
queryResultCount
=
0
;
for
(
let
i
=
0
,
len
=
data
.
length
;
i
<
len
;
i
++
)
{
var
datainfo
=
data
[
i
];
if
(
datainfo
.
bundleName
==
NAME3
){
expect
(
datainfo
.
name
).
assertEqual
(
"
com.example.myapplication.MainAbility
"
)
expect
(
datainfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
expect
(
datainfo
.
description
).
assertEqual
(
"
$string:mainability_description
"
)
...
...
@@ -2278,27 +2301,46 @@ describe('ActsBundleManagerTest', function () {
expect
(
datainfo
.
applicationInfo
.
labelId
>=
0
).
assertTrue
()
expect
(
datainfo
.
applicationInfo
.
systemApp
).
assertEqual
(
true
)
expect
(
datainfo
.
applicationInfo
.
supportedModes
).
assertEqual
(
0
)
expect
(
datainfo
.
orientation
).
assertEqual
(
2
)
expect
(
datainfo
.
applicationInfo
.
enabled
).
assertEqual
(
true
)
for
(
var
j
=
0
;
j
<
datainfo
.
applicationInfo
.
moduleInfos
;
j
++
)
{
expect
(
datainfo
.
applicationInfo
.
moduleInfos
[
j
].
moduleName
).
assertEqual
(
"
entry
"
)
}
queryResultCount
++
}
if
(
datainfo
.
bundleName
==
NAME4
){
expect
(
datainfo
.
name
).
assertEqual
(
"
com.example.myapplication.MainAbility
"
)
expect
(
datainfo
.
bundleName
).
assertEqual
(
NAME4
)
expect
(
datainfo
.
orientation
).
assertEqual
(
3
)
queryResultCount
++
}
if
(
datainfo
.
bundleName
==
NAME5
){
expect
(
datainfo
.
name
).
assertEqual
(
"
com.example.myapplication.MainAbility
"
)
expect
(
datainfo
.
bundleName
).
assertEqual
(
NAME5
)
expect
(
datainfo
.
orientation
).
assertEqual
(
0
)
queryResultCount
++
}
}
expect
(
queryResultCount
).
assertEqual
(
3
)
})
installData
.
uninstall
(
NAME3
,
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
},
(
err
,
data
)
=>
{
expect
(
data
.
status
).
assertEqual
(
0
);
installData
.
uninstall
(
NAME4
,
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
},
(
err
,
data
)
=>
{
expect
(
data
.
status
).
assertEqual
(
0
);
installData
.
uninstall
(
NAME5
,
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
},
(
err
,
data
)
=>
{
expect
(
data
.
status
).
assertEqual
(
0
);
done
();
});
});
...
...
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmssceneone/src/main/config.json
浏览文件 @
155448c7
...
...
@@ -77,7 +77,31 @@
"name"
:
"com.permission.BMS_PERMISSION_CAMERA"
,
"description"
:
"BMS_PERMISSION_CAMERA permission in detail"
,
"label"
:
"BMS_PERMISSION_CAMERA permission"
},
{
"name"
:
"com.permission.PERMISSION_A"
,
"grantMode"
:
"system_grant"
,
"availableScope"
:
[
"signature"
]
}
],
"reqPermissions"
:
[
{
"name"
:
"com.permission.PERMISSION_A"
,
"reason"
:
"Need PERMISSION_A"
,
"usedScene"
:
{
"ability"
:
[
"com.example.myapplication1.MainAbility"
],
"when"
:
"always"
}
}
],
"metaData"
:{
"customizeData"
:[{
"name"
:
"metaDataName"
,
"value"
:
"metaDataValue"
,
"extra"
:
"$string:app_name"
}]
}
]
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录