Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
7c24fe0f
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看板
未验证
提交
7c24fe0f
编写于
1月 14, 2022
作者:
O
openharmony_ci
提交者:
Gitee
1月 14, 2022
浏览文件
操作
浏览文件
下载
差异文件
!1572 XTS代码适配
Merge pull request !1572 from ry/master
上级
9c02dfe3
04a6a191
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
72 addition
and
58 deletion
+72
-58
appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/test/ExampleJsunit.test.js
...emanagertest/entry/src/main/js/test/ExampleJsunit.test.js
+48
-49
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageruninstall/entry/src/main/js/test/ExampleJsunit.test.js
...geruninstall/entry/src/main/js/test/ExampleJsunit.test.js
+24
-9
未找到文件。
appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/test/ExampleJsunit.test.js
浏览文件 @
7c24fe0f
...
...
@@ -1685,19 +1685,19 @@ describe('ActsBundleManagerTest', function () {
*/
it
(
'
getApplicationInfo_0700
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
();
installData
.
install
([
PATH
+
BMSJSTEST2
,
PATH
+
BMSJSTEST3
],
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
installData
.
install
([
PATH
+
BMSJSTEST2
,
PATH
+
BMSJSTEST3
],
installParam
,
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
getInfo
();
});
async
function
getInfo
()
{
await
demo
.
getApplicationInfo
(
NAME2
,
demo
.
BundleFlag
.
GET_APPLICATION_INFO_WITH_PERMISSION
,
demo
.
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
,
(
error
,
datainfo
)
=>
{
await
demo
.
getApplicationInfo
(
NAME2
,
BundleFlag
.
GET_APPLICATION_INFO_WITH_PERMISSION
,
0
,
(
error
,
datainfo
)
=>
{
if
(
error
)
{
console
.
info
(
"
getApplicationInfo error
"
+
JSON
.
stringify
(
error
))
expect
(
error
).
assertFail
()
}
console
.
info
(
"
getApplicationInfo success
"
+
JSON
.
stringify
(
datainfo
))
expect
(
typeof
datainfo
).
assertEqual
(
OBJECT
)
expect
(
datainfo
.
name
).
assertEqual
(
NAME2
)
expect
(
datainfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
...
...
@@ -1712,11 +1712,7 @@ describe('ActsBundleManagerTest', function () {
expect
(
datainfo
.
labelId
>=
0
).
assertTrue
()
expect
(
datainfo
.
systemApp
).
assertEqual
(
true
)
expect
(
datainfo
.
supportedModes
).
assertEqual
(
0
)
installData
.
uninstall
(
NAME2
,
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
},
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME2
,
installParam
,
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
...
...
@@ -2030,7 +2026,7 @@ describe('ActsBundleManagerTest', function () {
it
(
'
getApplicationInfo_0900
'
,
0
,
async
function
(
done
)
{
demo
.
getApplicationInfo
(
ERROR
,
BundleFlag
.
GET_APPLICATION_INFO_WITH_PERMISSION
,
0
,
(
error
,
datainfo
)
=>
{
if
(
error
)
{
console
.
error
(
"
getApplicationInfo fail
"
+
JSON
.
stringify
(
error
));
console
.
info
(
"
getApplicationInfo fail
"
+
JSON
.
stringify
(
error
));
expect
(
error
).
assertEqual
(
1
);
done
()
return
;
...
...
@@ -2740,47 +2736,50 @@ describe('ActsBundleManagerTest', function () {
*/
it
(
'
install_0300
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
()
installData
.
install
([
PATH
+
BMSJSTEST4
,
PATH
+
BMSJSTEST5
,
PATH
+
BMSJSTEST6
],
{
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
'
);
getInfo
();
installData
.
install
([
PATH
+
BMSJSTEST4
],
installParam
,
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
installData
.
install
([
PATH
+
BMSJSTEST5
],
installParam
,
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
installData
.
install
([
PATH
+
BMSJSTEST6
],
installParam
,
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
getInfo
();
});
});
});
async
function
getInfo
()
{
var
datainfo1
=
await
demo
.
getBundleInfo
(
NAME3
,
demo
.
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
);
expect
(
datainfo1
.
name
).
assertEqual
(
''
);
expect
(
datainfo1
.
uid
<
UIDMINVALUE
).
assertTrue
();
var
datainfo2
=
await
demo
.
getBundleInfo
(
NAME4
,
demo
.
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
);
expect
(
datainfo2
.
name
).
assertEqual
(
''
);
expect
(
datainfo2
.
uid
<
UIDMINVALUE
).
assertTrue
();
var
datainfo3
=
await
demo
.
getBundleInfo
(
NAME5
,
demo
.
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
);
expect
(
datainfo3
.
name
).
assertEqual
(
''
);
expect
(
datainfo3
.
uid
<
UIDMINVALUE
).
assertTrue
();
installData
.
uninstall
(
NAME3
,
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
},
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME4
,
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
},
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME5
,
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
},
(
err
,
data
)
=>
{
await
demo
.
getBundleInfo
(
NAME3
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
).
then
(
dataInfo1
=>
{
expect
(
dataInfo1
.
name
).
assertEqual
(
NAME3
);
}).
catch
(
errInfo
=>
{
expect
(
errInfo
).
assertFail
()
});
await
demo
.
getBundleInfo
(
NAME4
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
).
then
(
dataInfo2
=>
{
expect
(
dataInfo2
.
name
).
assertEqual
(
NAME4
);
}).
catch
(
errInfo
=>
{
expect
(
errInfo
).
assertFail
()
});
await
demo
.
getBundleInfo
(
NAME5
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
).
then
(
dataInfo3
=>
{
expect
(
dataInfo3
.
name
).
assertEqual
(
NAME5
);
}).
catch
(
errInfo
=>
{
expect
(
errInfo
).
assertFail
()
});
installData
.
uninstall
(
NAME3
,
installParam
,
(
err
,
data
)
=>
{
console
.
info
(
"
uninstall----result1
"
+
JSON
.
stringify
(
data
))
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
installData
.
uninstall
(
NAME4
,
installParam
,
(
err
,
data
)
=>
{
console
.
info
(
"
uninstall----result2
"
+
JSON
.
stringify
(
data
))
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
installData
.
uninstall
(
NAME5
,
installParam
,
(
err
,
data
)
=>
{
console
.
info
(
"
uninstall----result3
"
+
JSON
.
stringify
(
data
))
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
});
expect
(
err
.
code
).
assertEqual
(
-
1
);
expect
(
data
.
status
).
assertEqual
(
7
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
STATUS_UNINSTALL_FAILURE
'
);
});
}
})
...
...
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageruninstall/entry/src/main/js/test/ExampleJsunit.test.js
浏览文件 @
7c24fe0f
...
...
@@ -67,9 +67,16 @@ describe('ActsBundleManagerUninstall', function () {
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
var
datainfo2
=
await
demo
.
getBundleInfo
(
NAME1
,
1
);
expect
(
datainfo2
.
name
).
assertEqual
(
''
);
done
();
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
await
demo
.
getBundleInfo
(
NAME1
,
1
).
then
(
datainfo
=>
{
expect
(
datainfo
).
assertFail
()
done
();
}).
catch
(
err
=>
{
expect
(
err
).
assertEqual
(
1
)
done
()
});
})
});
})
...
...
@@ -178,8 +185,8 @@ describe('ActsBundleManagerUninstall', function () {
function
OnReceiveinstallEvent
(
err
,
data
)
{
expect
(
typeof
data
).
assertEqual
(
OBJECT
);
expect
(
data
.
statusMessage
).
assertEqual
(
"
STATUS_UNINSTALL_FAILURE
"
);
done
();
}
done
();
});
})
...
...
@@ -242,16 +249,24 @@ describe('ActsBundleManagerUninstall', function () {
async
function
OnReceiveinstallEvent
(
err
,
data
)
{
expect
(
typeof
data
).
assertEqual
(
OBJECT
);
expect
(
data
.
statusMessage
).
assertEqual
(
SUCCESS
);
var
datainfo1
=
await
demo
.
getBundleInfo
(
NAME1
,
1
);
expect
(
datainfo1
.
name
).
assertEqual
(
NAME1
);
await
demo
.
getBundleInfo
(
NAME1
,
1
).
then
(
datainfo1
=>
{
expect
(
datainfo1
.
name
).
assertEqual
(
NAME1
);
}).
catch
(
err
=>
{
expect
(
err
).
assertFail
();
});
result
.
uninstall
(
NAME1
,
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
var
datainfo2
=
await
demo
.
getBundleInfo
(
NAME1
,
1
);
expect
(
datainfo2
.
name
).
assertEqual
(
''
);
done
();
expect
(
data
.
statusMessage
).
assertEqual
(
SUCCESS
);
await
demo
.
getBundleInfo
(
NAME1
,
1
).
then
(
datainfo2
=>
{
expect
(
datainfo2
).
assertFail
();
done
();
}).
catch
(
err
=>
{
expect
(
err
).
assertEqual
(
1
);
done
();
});
});
}
})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录