Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
814b412c
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看板
提交
814b412c
编写于
3月 01, 2022
作者:
D
dy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add actsbundlemanageretstest tests
Signed-off-by:
N
dy
<
dingyao5@huawei.com
>
上级
3dab1c1f
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
44 addition
and
38 deletion
+44
-38
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/MainAbility/test/getAllApplicationInfoJsunit.test.ets
...ets/MainAbility/test/getAllApplicationInfoJsunit.test.ets
+19
-18
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/MainAbility/test/getApplicationInfoJsunit.test.ets
...in/ets/MainAbility/test/getApplicationInfoJsunit.test.ets
+25
-20
未找到文件。
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/MainAbility/test/getAllApplicationInfoJsunit.test.ets
浏览文件 @
814b412c
...
...
@@ -26,7 +26,7 @@ const TAG_TEST_0300_001 = ' bundle_getAllApplicationInfo_test_0300_007 ';
const TAG_TEST_0400_001 = ' bundle_getAllApplicationInfo_test_0400_008 ';
const TAG_TEST_0500_001 = ' bundle_getAllApplicationInfo_test_0500_009 ';
const TAG_TEST_0500_002 = ' bundle_getAllApplicationInfo_test_0500_0010 ';
const USER_ID_100 = 10
1
;
const USER_ID_100 = 10
0
;
const SLEEP_TIME_1000 = 1000;
const SLEEP_TIME_2000 = 2000;
...
...
@@ -52,7 +52,7 @@ export default function applicationBundleJsunit() {
console.info(TAG_TEST_0100_001 + 'promise START');
await Utils.sleep(SLEEP_TIME_1000);
var startTime = await Utils.getNowTime();
let data = await Bundle.getAllApplicationInfo(Bundle.GET_APPLICATION_INFO_WITH_PERMISSION, USER_ID_100)
let data = await Bundle.getAllApplicationInfo(Bundle.
BundleFlag.
GET_APPLICATION_INFO_WITH_PERMISSION, USER_ID_100)
.catch((error) => {
console.info(TAG_TEST_0100_001 + 'UserId promise error is: ' + error);
});
...
...
@@ -75,7 +75,7 @@ export default function applicationBundleJsunit() {
console.info(TAG_TEST_0100_002 + 'promise START');
await Utils.sleep(SLEEP_TIME_1000);
var startTime = await Utils.getNowTime();
let data = await Bundle.getAllApplicationInfo(Bundle.GET_ALL_APPLICATION_INFO, USER_ID_100)
let data = await Bundle.getAllApplicationInfo(Bundle.
BundleFlag.
GET_ALL_APPLICATION_INFO, USER_ID_100)
.catch((error) => {
console.info(TAG_TEST_0100_002 + 'UserId promise error is: ' + error);
});
...
...
@@ -98,7 +98,7 @@ export default function applicationBundleJsunit() {
console.info(TAG_TEST_0100_003 + 'promise START');
await Utils.sleep(SLEEP_TIME_1000);
var startTime = await Utils.getNowTime();
let data = await Bundle.getAllApplicationInfo(Bundle.GET_APPLICATION_INFO_WITH_DISABLE, USER_ID_100)
let data = await Bundle.getAllApplicationInfo(Bundle.
BundleFlag.
GET_APPLICATION_INFO_WITH_DISABLE, USER_ID_100)
.catch((error) => {
console.info(TAG_TEST_0100_003 + 'UserId promise error is: ' + error);
});
...
...
@@ -122,7 +122,7 @@ export default function applicationBundleJsunit() {
console.info(TAG_TEST_0200_001 + 'promise START');
await Utils.sleep(SLEEP_TIME_1000);
var startTime = await Utils.getNowTime();
let data = await Bundle.getAllApplicationInfo(Bundle.GET_APPLICATION_INFO_WITH_PERMISSION)
let data = await Bundle.getAllApplicationInfo(Bundle.
BundleFlag.
GET_APPLICATION_INFO_WITH_PERMISSION)
.catch((error) => {
console.info(TAG_TEST_0200_001 + 'onUserId promise error is: ' + error);
});
...
...
@@ -145,7 +145,7 @@ export default function applicationBundleJsunit() {
console.info(TAG_TEST_0200_002 + 'promise START');
await Utils.sleep(SLEEP_TIME_1000);
var startTime = await Utils.getNowTime();
let data = await Bundle.getAllApplicationInfo(Bundle.GET_ALL_APPLICATION_INFO)
let data = await Bundle.getAllApplicationInfo(Bundle.
BundleFlag.
GET_ALL_APPLICATION_INFO)
.catch((error) => {
console.info(TAG_TEST_0200_002 + 'onUserId promise error is: ' + error);
});
...
...
@@ -168,7 +168,7 @@ export default function applicationBundleJsunit() {
console.info(TAG_TEST_0200_003 + 'promise START');
await Utils.sleep(SLEEP_TIME_1000);
var startTime = await Utils.getNowTime();
let data = await Bundle.getAllApplicationInfo(Bundle.GET_APPLICATION_INFO_WITH_DISABLE)
let data = await Bundle.getAllApplicationInfo(Bundle.
BundleFlag.
GET_APPLICATION_INFO_WITH_DISABLE)
.catch((error) => {
console.info(TAG_TEST_0200_003 + 'onUserId promise error is: ' + error);
});
...
...
@@ -192,14 +192,15 @@ export default function applicationBundleJsunit() {
await Utils.sleep(SLEEP_TIME_1000);
let datas;
var startTime = await Utils.getNowTime();
Bundle.getAllApplicationInfo(Bundle.GET_APPLICATION_INFO_WITH_PERMISSION, USER_ID_100, (error, data) => {
var endTime = Utils.getNowTime();
Utils.getDurationTime(TAG_TEST_0300_001, startTime, endTime);
console.info(TAG_TEST_0300_001 + 'UserId callBack in');
console.info(TAG_TEST_0300_001 + 'UserId callBack error: ' + error);
console.info(TAG_TEST_0300_001 + 'UserId callBack data is:' + JSON.stringify(data));
datas = data;
});
Bundle.getAllApplicationInfo(Bundle.BundleFlag.GET_APPLICATION_INFO_WITH_PERMISSION, USER_ID_100,
(error, data) => {
var endTime = Utils.getNowTime();
Utils.getDurationTime(TAG_TEST_0300_001, startTime, endTime);
console.info(TAG_TEST_0300_001 + 'UserId callBack in');
console.info(TAG_TEST_0300_001 + 'UserId callBack error: ' + error);
console.info(TAG_TEST_0300_001 + 'UserId callBack data is:' + JSON.stringify(data));
datas = data;
});
await Utils.sleep(2000);
console.info(TAG_TEST_0300_001 + 'UserId callBack datas is:' + JSON.stringify(datas));
commonTest(TAG_TEST_0300_001, datas)
...
...
@@ -218,7 +219,7 @@ export default function applicationBundleJsunit() {
console.info(TAG_TEST_0400_001 + 'callBack START');
let datas;
var startTime = await Utils.getNowTime();
Bundle.getAllApplicationInfo(Bundle.GET_APPLICATION_INFO_WITH_PERMISSION, (error, data) => {
Bundle.getAllApplicationInfo(Bundle.
BundleFlag.
GET_APPLICATION_INFO_WITH_PERMISSION, (error, data) => {
var endTime = Utils.getNowTime();
Utils.getDurationTime(TAG_TEST_0400_001, startTime, endTime);
console.info(TAG_TEST_0400_001 + 'noUserId callBack in');
...
...
@@ -269,7 +270,7 @@ export default function applicationBundleJsunit() {
await Utils.sleep(SLEEP_TIME_1000);
let errors;
var startTime = await Utils.getNowTime();
let data = await Bundle.getAllApplicationInfo('
', 0
, USER_ID_100)
let data = await Bundle.getAllApplicationInfo('
0'
, USER_ID_100)
.catch((error) => {
console.info(TAG_TEST_0500_002 + 'UserId promise error is: ' + error);
errors = error;
...
...
@@ -290,7 +291,7 @@ export default function applicationBundleJsunit() {
function commonTest(msg, data) {
console.info(msg + 'commonTest data length [' + data.length + ']');
for (var i = 0; i < data.length; i++) {
console.info(msg + i +' [ + data[i] + ] :' + JSON.stringify(data[i]));
console.info(msg + i +
' [ + data[i] + ] :' + JSON.stringify(data[i]));
console.info(msg + '[' + i + '].name:' + data[i].name);
console.info(msg + '[' + i + '].codePath:' + data[i].codePath);
console.info(msg + '[' + i + '].accessTokenId:' + data[i].accessTokenId);
...
...
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/MainAbility/test/getApplicationInfoJsunit.test.ets
浏览文件 @
814b412c
...
...
@@ -31,7 +31,7 @@ const TAG_TEST_0600_002 = ' bundle_getApplicationInfo_test_0600_0012 ';
const TAG_TEST_0600_003 = ' bundle_getApplicationInfo_test_0600_0013 ';
const BUNDLE_NAME = 'com.open.harmony.packagemag';
const BUNDLE_NAME_OTHER = 'com.ohos.acepackage';
const USER_ID_100 = 10
1
;
const USER_ID_100 = 10
0
;
const SLEEP_TIME_1000 = 1000;
const SLEEP_TIME_2000 = 2000;
...
...
@@ -58,7 +58,8 @@ export default function applicationBundleJsunit() {
await Utils.sleep(SLEEP_TIME_1000);
let errors;
var startTime = await Utils.getNowTime();
let data = await Bundle.getApplicationInfo(BUNDLE_NAME, Bundle.GET_APPLICATION_INFO_WITH_PERMISSION, USER_ID_100)
let data = await Bundle.getApplicationInfo(BUNDLE_NAME, Bundle.BundleFlag.GET_APPLICATION_INFO_WITH_PERMISSION,
USER_ID_100)
.catch((error) => {
console.info(TAG_TEST_0100_001 + 'UserId promise error is: ' + error);
errors = error;
...
...
@@ -87,7 +88,7 @@ export default function applicationBundleJsunit() {
await Utils.sleep(SLEEP_TIME_1000);
let errors;
var startTime = await Utils.getNowTime();
let data = await Bundle.getApplicationInfo(BUNDLE_NAME, Bundle.GET_ALL_APPLICATION_INFO, USER_ID_100)
let data = await Bundle.getApplicationInfo(BUNDLE_NAME, Bundle.
BundleFlag.
GET_ALL_APPLICATION_INFO, USER_ID_100)
.catch((error) => {
console.info(TAG_TEST_0100_002 + 'UserId promise error is: ' + error);
errors = error;
...
...
@@ -116,7 +117,8 @@ export default function applicationBundleJsunit() {
await Utils.sleep(SLEEP_TIME_1000);
let errors;
var startTime = await Utils.getNowTime();
let data = await Bundle.getApplicationInfo(BUNDLE_NAME, Bundle.GET_APPLICATION_INFO_WITH_DISABLE, USER_ID_100)
let data = await Bundle.getApplicationInfo(BUNDLE_NAME, Bundle.BundleFlag.GET_APPLICATION_INFO_WITH_DISABLE,
USER_ID_100)
.catch((error) => {
console.info(TAG_TEST_0100_003 + 'UserId promise error is: ' + error);
errors = error;
...
...
@@ -150,7 +152,7 @@ export default function applicationBundleJsunit() {
let errors;
await Utils.sleep(SLEEP_TIME_1000);
var startTime = await Utils.getNowTime();
let data = await Bundle.getApplicationInfo(BUNDLE_NAME, Bundle.GET_APPLICATION_INFO_WITH_PERMISSION)
let data = await Bundle.getApplicationInfo(BUNDLE_NAME, Bundle.
BundleFlag.
GET_APPLICATION_INFO_WITH_PERMISSION)
.catch((error) => {
console.info(TAG_TEST_0200_001 + 'onUserId promise error is: ' + error);
errors = error;
...
...
@@ -179,7 +181,7 @@ export default function applicationBundleJsunit() {
await Utils.sleep(SLEEP_TIME_1000);
let errors;
var startTime = await Utils.getNowTime();
let data = await Bundle.getApplicationInfo(BUNDLE_NAME, Bundle.GET_ALL_APPLICATION_INFO)
let data = await Bundle.getApplicationInfo(BUNDLE_NAME, Bundle.
BundleFlag.
GET_ALL_APPLICATION_INFO)
.catch((error) => {
console.info(TAG_TEST_0200_002 + 'onUserId promise error is: ' + error);
errors = error;
...
...
@@ -208,7 +210,7 @@ export default function applicationBundleJsunit() {
await Utils.sleep(SLEEP_TIME_1000);
let errors;
var startTime = await Utils.getNowTime();
let data = await Bundle.getApplicationInfo(BUNDLE_NAME, Bundle.GET_APPLICATION_INFO_WITH_DISABLE)
let data = await Bundle.getApplicationInfo(BUNDLE_NAME, Bundle.
BundleFlag.
GET_APPLICATION_INFO_WITH_DISABLE)
.catch((error) => {
console.info(TAG_TEST_0200_003 + 'onUserId promise error is: ' + error);
errors = error;
...
...
@@ -238,15 +240,16 @@ export default function applicationBundleJsunit() {
let errors;
let datas;
var startTime = await Utils.getNowTime();
Bundle.getApplicationInfo(BUNDLE_NAME, Bundle.GET_APPLICATION_INFO_WITH_PERMISSION, USER_ID_100, (error, data) => {
var endTime = Utils.getNowTime();
Utils.getDurationTime(TAG_TEST_0300_001, startTime, endTime);
console.info(TAG_TEST_0300_001 + 'UserId callBack in');
console.info(TAG_TEST_0300_001 + 'UserId callBack error: ' + error);
errors = error;
console.info(TAG_TEST_0300_001 + 'UserId callBack data is:' + JSON.stringify(data));
datas = data;
});
Bundle.getApplicationInfo(BUNDLE_NAME, Bundle.BundleFlag.GET_APPLICATION_INFO_WITH_PERMISSION,
USER_ID_100, (error, data) => {
var endTime = Utils.getNowTime();
Utils.getDurationTime(TAG_TEST_0300_001, startTime, endTime);
console.info(TAG_TEST_0300_001 + 'UserId callBack in');
console.info(TAG_TEST_0300_001 + 'UserId callBack error: ' + error);
errors = error;
console.info(TAG_TEST_0300_001 + 'UserId callBack data is:' + JSON.stringify(data));
datas = data;
});
await Utils.sleep(2000);
console.info(TAG_TEST_0300_001 + 'UserId callBack data is: ' + JSON.stringify(datas));
if (1 === errors) {
...
...
@@ -270,7 +273,7 @@ export default function applicationBundleJsunit() {
let errors;
let datas;
var startTime = await Utils.getNowTime();
Bundle.getApplicationInfo(BUNDLE_NAME, Bundle.GET_APPLICATION_INFO_WITH_PERMISSION, (error, data) => {
Bundle.getApplicationInfo(BUNDLE_NAME, Bundle.
BundleFlag.
GET_APPLICATION_INFO_WITH_PERMISSION, (error, data) => {
var endTime = Utils.getNowTime();
Utils.getDurationTime(TAG_TEST_0400_001, startTime, endTime);
console.info(TAG_TEST_0400_001 + 'noUserId callBack in');
...
...
@@ -354,7 +357,8 @@ export default function applicationBundleJsunit() {
await Utils.sleep(SLEEP_TIME_1000);
let errors;
var startTime = await Utils.getNowTime();
let data = await Bundle.getApplicationInfo(BUNDLE_NAME_OTHER, Bundle.GET_APPLICATION_INFO_WITH_PERMISSION)
let data = await Bundle.getApplicationInfo(BUNDLE_NAME_OTHER,
Bundle.BundleFlag.GET_APPLICATION_INFO_WITH_PERMISSION)
.catch((error) => {
console.info(TAG_TEST_0600_001 + 'other bundleName noUserId promise error is: ' + error);
errors = error;
...
...
@@ -385,7 +389,8 @@ export default function applicationBundleJsunit() {
let errors;
var startTime = await Utils.getNowTime();
let data =
await Bundle.getApplicationInfo(BUNDLE_NAME_OTHER, Bundle.GET_APPLICATION_INFO_WITH_PERMISSION, USER_ID_100)
await Bundle.getApplicationInfo(BUNDLE_NAME_OTHER, Bundle.BundleFlag.GET_APPLICATION_INFO_WITH_PERMISSION,
USER_ID_100)
.catch((error) => {
console.info(TAG_TEST_0600_002 + 'other bundleName UserId promise error is: ' + error);
errors = error;
...
...
@@ -425,7 +430,7 @@ export default function applicationBundleJsunit() {
console.info(TAG_TEST_0600_003 + ' noUserId promise data is: ' + JSON.stringify(data));
if (1 === errors) {
expect(errors).assertEqual(1);
}else {
}
else {
commonTest(TAG_TEST_0600_003, data);
getApplicationInfoSuccess(TAG_TEST_0600_003, data);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录