Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
465d48d2
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看板
提交
465d48d2
编写于
11月 02, 2021
作者:
Z
zhaoyuan17
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Modify test code
Signed-off-by:
N
zhaoyuan17
<
zhaoyuan17@huawei.com
>
上级
057edcb9
变更
9
展开全部
隐藏空白更改
内联
并排
Showing
9 changed file
with
1251 addition
and
1047 deletion
+1251
-1047
appexecfwk/bundle_standard/bundlemanager/BUILD.gn
appexecfwk/bundle_standard/bundlemanager/BUILD.gn
+2
-1
appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/entry/src/main/js/test/ActsBmsAllShortcutInfoTest.test.js
...entry/src/main/js/test/ActsBmsAllShortcutInfoTest.test.js
+376
-249
appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/entry/src/main/js/test/ActsBmsCheckPermissionTest.test.js
...entry/src/main/js/test/ActsBmsCheckPermissionTest.test.js
+0
-49
appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/test/ActsBmsHapModuleTest.test.js
...etest/entry/src/main/js/test/ActsBmsHapModuleTest.test.js
+204
-166
appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/test/ActsBmsJsTest.test.js
...ctsbmsjstest/entry/src/main/js/test/ActsBmsJsTest.test.js
+133
-86
appexecfwk/bundle_standard/bundlemanager/actsbmskittest/Test.json
...wk/bundle_standard/bundlemanager/actsbmskittest/Test.json
+2
-2
appexecfwk/bundle_standard/bundlemanager/actsbmskittest/entry/src/main/js/test/ActsBmsKitTest.test.js
...sbmskittest/entry/src/main/js/test/ActsBmsKitTest.test.js
+5
-24
appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/entry/src/main/js/test/ActsBmsMetaDataTest.test.js
...tatest/entry/src/main/js/test/ActsBmsMetaDataTest.test.js
+171
-184
appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/test/ActsBmsModuleUsageRecordTest.test.js
...try/src/main/js/test/ActsBmsModuleUsageRecordTest.test.js
+358
-286
未找到文件。
appexecfwk/bundle_standard/bundlemanager/BUILD.gn
浏览文件 @
465d48d2
...
...
@@ -26,7 +26,8 @@ group("bundlemanager") {
"actsbmsmoduleusagerecordtest:ActsBmsModuleUsageRecordTest",
"actsbundlemanagertest:ActsBundleManagerTest",
"actsbundlemanageruninstall:ActsBundleManagerUninstall",
"bmscheckpermissiontest:BmsCheckPermissionTest",
# "bmscheckpermissiontest:BmsCheckPermissionTest",
"sceneProject/bmsgetinfosfifthscene:bmsThirdBundleTest5",
"sceneProject/bmsgetinfosfirstscene:bmsThirdBundleTest1",
"sceneProject/bmsgetinfosfirstsceneupdate:bmsThirdBundleTestA1",
...
...
appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/entry/src/main/js/test/ActsBmsAllShortcutInfoTest.test.js
浏览文件 @
465d48d2
此差异已折叠。
点击以展开。
appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/entry/src/main/js/test/ActsBmsCheckPermissionTest.test.js
浏览文件 @
465d48d2
...
...
@@ -19,7 +19,6 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
const
BUNDLE_NAME
=
'
com.example.actsbmscheckpermissiontest
'
;
const
PERMISSION_ONE
=
'
com.permission.PERMISSION_A
'
;
const
PERMISSION_TWO
=
'
com.permission.PERMISSION_B
'
;
const
TIMEOUT
=
1000
;
const
NAMECOUNT
=
10000
;
describe
(
'
ActsBmsCheckPermissionTest
'
,
function
()
{
...
...
@@ -34,9 +33,6 @@ describe('ActsBmsCheckPermissionTest', function () {
var
data
=
await
bundle
.
checkPermission
(
BUNDLE_NAME
,
PERMISSION_ONE
)
expect
(
data
).
assertEqual
(
0
);
done
();
setTimeout
(
function
()
{
console
.
info
(
'
=====================bms_checkPermission_0100==================end
'
);
},
TIMEOUT
)
})
/*
...
...
@@ -51,9 +47,6 @@ describe('ActsBmsCheckPermissionTest', function () {
expect
(
data
).
assertEqual
(
0
);
done
();
})
setTimeout
(
function
()
{
console
.
info
(
'
=====================bms_checkPermission_0200==================end
'
);
},
TIMEOUT
)
})
/*
...
...
@@ -67,9 +60,6 @@ describe('ActsBmsCheckPermissionTest', function () {
var
data
=
await
bundle
.
checkPermission
(
''
,
PERMISSION_ONE
)
expect
(
data
).
assertEqual
(
-
1
);
done
();
setTimeout
(
function
()
{
console
.
info
(
'
=====================bms_checkPermission_0300==================end
'
);
},
TIMEOUT
)
})
/*
...
...
@@ -85,9 +75,6 @@ describe('ActsBmsCheckPermissionTest', function () {
expect
(
data
).
assertEqual
(
-
1
);
done
();
})
setTimeout
(
function
()
{
console
.
info
(
'
=====================bms_checkPermission_0400==================end
'
);
},
TIMEOUT
)
})
/*
...
...
@@ -101,9 +88,6 @@ describe('ActsBmsCheckPermissionTest', function () {
var
data
=
await
bundle
.
checkPermission
(
BUNDLE_NAME
,
''
)
expect
(
data
).
assertEqual
(
-
1
);
done
();
setTimeout
(
function
()
{
console
.
info
(
'
=====================bms_checkPermission_0500==================end
'
);
},
TIMEOUT
)
})
/*
...
...
@@ -119,9 +103,6 @@ describe('ActsBmsCheckPermissionTest', function () {
expect
(
data
).
assertEqual
(
-
1
);
done
();
})
setTimeout
(
function
()
{
console
.
info
(
'
=====================bms_checkPermission_0600==================end
'
);
},
TIMEOUT
)
})
/*
...
...
@@ -135,9 +116,6 @@ describe('ActsBmsCheckPermissionTest', function () {
var
data
=
await
bundle
.
checkPermission
(
BUNDLE_NAME
,
'
@
\n
,. 。测试@abc1^%12345
'
)
expect
(
data
).
assertEqual
(
-
1
);
done
();
setTimeout
(
function
()
{
console
.
info
(
'
=====================bms_checkPermission_0700==================end
'
);
},
TIMEOUT
)
})
/*
...
...
@@ -153,9 +131,6 @@ describe('ActsBmsCheckPermissionTest', function () {
expect
(
data
).
assertEqual
(
-
1
);
done
();
})
setTimeout
(
function
()
{
console
.
info
(
'
=====================bms_checkPermission_0800==================end
'
);
},
TIMEOUT
)
})
/*
...
...
@@ -169,9 +144,6 @@ describe('ActsBmsCheckPermissionTest', function () {
var
data
=
await
bundle
.
checkPermission
(
'
@
\n
,. 。测试@abc1^%12345
'
,
PERMISSION_ONE
)
expect
(
data
).
assertEqual
(
-
1
);
done
();
setTimeout
(
function
()
{
console
.
info
(
'
=====================bms_checkPermission_0900==================end
'
);
},
TIMEOUT
)
})
/*
...
...
@@ -187,9 +159,6 @@ describe('ActsBmsCheckPermissionTest', function () {
expect
(
data
).
assertEqual
(
-
1
);
done
();
})
setTimeout
(
function
()
{
console
.
info
(
'
=====================bms_checkPermission_1000==================end
'
);
},
TIMEOUT
)
})
/*
...
...
@@ -207,9 +176,6 @@ describe('ActsBmsCheckPermissionTest', function () {
var
data
=
await
bundle
.
checkPermission
(
BUNDLE_NAME
,
permissionName
)
expect
(
data
).
assertEqual
(
-
1
);
done
();
setTimeout
(
function
()
{
console
.
info
(
'
=====================bms_checkPermission_1100==================end
'
);
},
TIMEOUT
)
})
/*
...
...
@@ -229,9 +195,6 @@ describe('ActsBmsCheckPermissionTest', function () {
expect
(
data
).
assertEqual
(
-
1
);
done
();
})
setTimeout
(
function
()
{
console
.
info
(
'
=====================bms_checkPermission_1200==================end
'
);
},
TIMEOUT
)
})
/*
...
...
@@ -249,9 +212,6 @@ describe('ActsBmsCheckPermissionTest', function () {
var
data
=
await
bundle
.
checkPermission
(
bundleName
,
PERMISSION_ONE
)
expect
(
data
).
assertEqual
(
-
1
);
done
();
setTimeout
(
function
()
{
console
.
info
(
'
=====================bms_checkPermission_1300==================end
'
);
},
TIMEOUT
)
})
/*
...
...
@@ -271,9 +231,6 @@ describe('ActsBmsCheckPermissionTest', function () {
expect
(
data
).
assertEqual
(
-
1
);
done
();
})
setTimeout
(
function
()
{
console
.
info
(
'
=====================bms_checkPermission_1400==================end
'
);
},
TIMEOUT
)
})
/*
...
...
@@ -287,9 +244,6 @@ describe('ActsBmsCheckPermissionTest', function () {
var
data
=
await
bundle
.
checkPermission
(
BUNDLE_NAME
,
PERMISSION_TWO
)
expect
(
data
).
assertEqual
(
0
);
done
();
setTimeout
(
function
()
{
console
.
info
(
'
=====================bms_checkPermission_1500==================end
'
);
},
TIMEOUT
)
})
/*
...
...
@@ -305,8 +259,5 @@ describe('ActsBmsCheckPermissionTest', function () {
expect
(
data
).
assertEqual
(
0
);
done
();
})
setTimeout
(
function
()
{
console
.
info
(
'
=====================bms_checkPermission_1600==================end
'
);
},
TIMEOUT
)
})
})
\ No newline at end of file
appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/test/ActsBmsHapModuleTest.test.js
浏览文件 @
465d48d2
此差异已折叠。
点击以展开。
appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/test/ActsBmsJsTest.test.js
浏览文件 @
465d48d2
...
...
@@ -14,11 +14,7 @@
*/
import
bundle
from
'
@ohos.bundle
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
const
TIMEOUT
=
3000
;
describe
(
'
ActsBmsJsTest
'
,
function
()
{
/*
* @tc.number: bms_getJsAbility_0100
* @tc.name: test the multi js ability
...
...
@@ -29,20 +25,43 @@ describe('ActsBmsJsTest', function () {
console
.
info
(
'
=====================bms_getJsAbility_0100==================
'
);
let
bundleName
=
'
com.example.third2
'
;
let
abilityName
=
'
com.example.third2.MainAbility
'
;
await
install
([
'
/data/test/bmsThirdBundleTest2.hap
'
]);
let
data
=
await
bundle
.
getBundleInfo
(
bundleName
,
1
);
expect
(
data
.
abilityInfo
.
length
).
assertEqual
(
1
);
if
(
data
.
abilityInfo
.
length
==
1
){
console
.
debug
(
'
========check abilityName ========
'
+
JSON
.
stringify
(
data
.
abilityInfo
));
expect
(
data
.
abilityInfo
[
0
].
name
).
assertEqual
(
abilityName
);
expect
(
data
.
abilityInfo
[
0
].
srcLanguage
).
assertEqual
(
'
js
'
);
expect
(
data
.
abilityInfo
[
0
].
srcPath
).
assertEqual
(
''
);
var
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest2.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
onReceiveInstallEvent
);
async
function
onReceiveInstallEvent
(
err
,
data
)
{
console
.
info
(
'
========install Finish========
'
);
expect
(
typeof
err
).
assertEqual
(
'
object
'
);
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
typeof
data
).
assertEqual
(
'
object
'
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
let
result
=
await
bundle
.
getBundleInfo
(
bundleName
,
1
);
expect
(
result
.
abilityInfo
.
length
).
assertEqual
(
1
);
if
(
result
.
abilityInfo
.
length
==
1
)
{
console
.
debug
(
'
========check abilityName ========
'
+
JSON
.
stringify
(
result
.
abilityInfo
));
expect
(
result
.
abilityInfo
[
0
].
name
).
assertEqual
(
abilityName
);
expect
(
result
.
abilityInfo
[
0
].
srcLanguage
).
assertEqual
(
'
js
'
);
expect
(
result
.
abilityInfo
[
0
].
srcPath
).
assertEqual
(
''
);
}
installer
.
uninstall
(
bundleName
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
console
.
info
(
'
========uninstall Finish========
'
);
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
}
await
uninstall
(
bundleName
);
done
();
setTimeout
(
function
()
{
console
.
info
(
'
=====================bms_getJsAbility_0100==================end
'
);
},
TIMEOUT
)
})
/*
...
...
@@ -56,24 +75,46 @@ describe('ActsBmsJsTest', function () {
var
bundleName
=
'
com.example.third5
'
;
let
abilityName1
=
'
com.example.third5.AMainAbility
'
;
let
abilityName2
=
'
com.example.third5.BMainAbility
'
;
await
install
([
'
/data/test/bmsThirdBundleTest5.hap
'
]);
let
data
=
await
bundle
.
getBundleInfo
(
bundleName
,
1
)
console
.
debug
(
'
==========bundleInfo==========
'
+
JSON
.
stringify
(
data
))
expect
(
data
.
abilityInfo
.
length
).
assertEqual
(
2
);
if
(
data
.
abilityInfo
.
length
==
2
){
console
.
debug
(
'
========check abilityName ========
'
+
JSON
.
stringify
(
data
.
abilityInfo
));
expect
(
data
.
abilityInfo
[
0
].
name
).
assertEqual
(
abilityName1
);
expect
(
data
.
abilityInfo
[
0
].
srcLanguage
).
assertEqual
(
'
js
'
);
expect
(
data
.
abilityInfo
[
0
].
srcPath
).
assertEqual
(
''
);
expect
(
data
.
abilityInfo
[
1
].
name
).
assertEqual
(
abilityName2
);
expect
(
data
.
abilityInfo
[
1
].
srcLanguage
).
assertEqual
(
'
js
'
);
expect
(
data
.
abilityInfo
[
1
].
srcPath
).
assertEqual
(
''
);
var
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest5.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
onReceiveInstallEvent
);
async
function
onReceiveInstallEvent
(
err
,
data
)
{
console
.
info
(
'
========install Finish========
'
);
expect
(
typeof
err
).
assertEqual
(
'
object
'
);
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
typeof
data
).
assertEqual
(
'
object
'
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
let
result
=
await
bundle
.
getBundleInfo
(
bundleName
,
1
)
console
.
debug
(
'
==========bundleInfo==========
'
+
JSON
.
stringify
(
result
))
expect
(
result
.
abilityInfo
.
length
).
assertEqual
(
2
);
if
(
result
.
abilityInfo
.
length
==
2
)
{
console
.
debug
(
'
========check abilityName ========
'
+
JSON
.
stringify
(
result
.
abilityInfo
));
expect
(
result
.
abilityInfo
[
0
].
name
).
assertEqual
(
abilityName1
);
expect
(
result
.
abilityInfo
[
0
].
srcLanguage
).
assertEqual
(
'
js
'
);
expect
(
result
.
abilityInfo
[
0
].
srcPath
).
assertEqual
(
''
);
expect
(
result
.
abilityInfo
[
1
].
name
).
assertEqual
(
abilityName2
);
expect
(
result
.
abilityInfo
[
1
].
srcLanguage
).
assertEqual
(
'
js
'
);
expect
(
result
.
abilityInfo
[
1
].
srcPath
).
assertEqual
(
''
);
}
installer
.
uninstall
(
bundleName
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
}
await
uninstall
(
bundleName
);
done
();
setTimeout
(
function
()
{
console
.
info
(
'
=====================bms_getJsAbility_0200==================end
'
);
},
TIMEOUT
)
})
/*
...
...
@@ -86,20 +127,43 @@ describe('ActsBmsJsTest', function () {
console
.
info
(
'
=====================bms_getJsAbility_0300==================
'
);
let
bundleName
=
'
com.example.js
'
;
let
abilityName
=
'
com.example.js.MainAbility
'
;
await
install
([
'
/data/test/bmsThirdBundleJs.hap
'
]);
let
data
=
await
bundle
.
getBundleInfo
(
bundleName
,
1
);
expect
(
data
.
abilityInfo
.
length
).
assertEqual
(
1
);
if
(
data
.
abilityInfo
.
length
==
1
){
console
.
debug
(
'
========check abilityName ========
'
+
JSON
.
stringify
(
data
.
abilityInfo
));
expect
(
data
.
abilityInfo
[
0
].
name
).
assertEqual
(
abilityName
);
expect
(
data
.
abilityInfo
[
0
].
srcLanguage
).
assertEqual
(
'
js
'
);
expect
(
data
.
abilityInfo
[
0
].
srcPath
).
assertEqual
(
'
default
'
);
var
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleJs.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
onReceiveInstallEvent
);
async
function
onReceiveInstallEvent
(
err
,
data
)
{
console
.
info
(
'
========install Finish========
'
);
expect
(
typeof
err
).
assertEqual
(
'
object
'
);
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
typeof
data
).
assertEqual
(
'
object
'
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
let
result
=
await
bundle
.
getBundleInfo
(
bundleName
,
1
);
expect
(
result
.
abilityInfo
.
length
).
assertEqual
(
1
);
if
(
result
.
abilityInfo
.
length
==
1
)
{
console
.
debug
(
'
========check abilityName ========
'
+
JSON
.
stringify
(
result
.
abilityInfo
));
expect
(
result
.
abilityInfo
[
0
].
name
).
assertEqual
(
abilityName
);
expect
(
result
.
abilityInfo
[
0
].
srcLanguage
).
assertEqual
(
'
js
'
);
expect
(
result
.
abilityInfo
[
0
].
srcPath
).
assertEqual
(
'
default
'
);
}
installer
.
uninstall
(
bundleName
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
console
.
info
(
'
========uninstall Finish========
'
);
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
}
await
uninstall
(
bundleName
);
done
();
setTimeout
(
function
()
{
console
.
info
(
'
=====================bms_getJsAbility_0300==================end
'
);
},
TIMEOUT
)
})
/*
...
...
@@ -112,25 +176,8 @@ describe('ActsBmsJsTest', function () {
console
.
info
(
'
=====================bms_getJsAbility_0400==================
'
);
let
bundleName
=
'
com.example.c
'
;
let
abilityName
=
'
.MainAbility
'
;
await
install
([
'
/data/test/bmsThirdBundleC.hap
'
]);
let
data
=
await
bundle
.
getBundleInfo
(
bundleName
,
1
);
expect
(
data
.
abilityInfo
.
length
).
assertEqual
(
1
);
if
(
data
.
abilityInfo
.
length
==
1
){
console
.
debug
(
'
========check abilityName ========
'
+
JSON
.
stringify
(
data
.
abilityInfo
));
expect
(
data
.
abilityInfo
[
0
].
name
).
assertEqual
(
abilityName
);
expect
(
data
.
abilityInfo
[
0
].
srcLanguage
).
assertEqual
(
'
c++
'
);
expect
(
data
.
abilityInfo
[
0
].
srcPath
).
assertEqual
(
'
default/c++/
'
);
}
await
uninstall
(
bundleName
);
done
();
setTimeout
(
function
()
{
console
.
info
(
'
=====================bms_getJsAbility_0300==================end
'
);
},
TIMEOUT
)
})
async
function
install
(
bundlePath
)
{
var
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
(
bundlePath
,
{
installer
.
install
(
[
'
/data/test/bmsThirdBundleC.hap
'
]
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
...
...
@@ -138,33 +185,33 @@ describe('ActsBmsJsTest', function () {
}
},
onReceiveInstallEvent
);
function
onReceiveInstallEvent
(
err
,
data
)
{
async
function
onReceiveInstallEvent
(
err
,
data
)
{
console
.
info
(
'
========install Finish========
'
);
expect
(
typeof
err
).
assertEqual
(
'
object
'
);
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
typeof
data
).
assertEqual
(
'
object
'
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
}
}
async
function
uninstall
(
bundleName
)
{
var
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
uninstall
(
bundleName
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
let
result
=
await
bundle
.
getBundleInfo
(
bundleName
,
1
);
expect
(
result
.
abilityInfo
.
length
).
assertEqual
(
1
);
if
(
result
.
abilityInfo
.
length
==
1
)
{
console
.
debug
(
'
========check abilityName ========
'
+
JSON
.
stringify
(
result
.
abilityInfo
));
expect
(
result
.
abilityInfo
[
0
].
name
).
assertEqual
(
abilityName
);
expect
(
result
.
abilityInfo
[
0
].
srcLanguage
).
assertEqual
(
'
c++
'
);
expect
(
result
.
abilityInfo
[
0
].
srcPath
).
assertEqual
(
'
default/c++/
'
);
}
},
onReceiveUninstallEvent
);
function
onReceiveUninstallEvent
(
err
,
data
)
{
console
.
info
(
'
========uninstall Finish========
'
);
expect
(
typeof
err
).
assertEqual
(
'
object
'
);
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
typeof
data
).
assertEqual
(
'
object
'
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
installer
.
uninstall
(
bundleName
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
console
.
info
(
'
========uninstall Finish========
'
);
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
}
}
}
)
})
\ No newline at end of file
appexecfwk/bundle_standard/bundlemanager/actsbmskittest/Test.json
浏览文件 @
465d48d2
...
...
@@ -9,8 +9,8 @@
"kits"
:
[
{
"test-file-name"
:
[
"
ActsBmsKitTest
.hap"
,
"
bmsThirdBundleTest1
.hap"
"
bmsThirdBundleTest1
.hap"
,
"
ActsBmsKitTest
.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
...
...
appexecfwk/bundle_standard/bundlemanager/actsbmskittest/entry/src/main/js/test/ActsBmsKitTest.test.js
浏览文件 @
465d48d2
...
...
@@ -18,7 +18,6 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
import
featureAbility
from
'
@ohos.ability.featureability
'
import
commonEvent
from
'
@ohos.commonevent
'
const
TIMEOUT
=
2000
;
const
STRESSLEVEL
=
20
;
const
BUNDLE_NAME
=
'
com.example.actsbmskittest
'
;
const
PERMISSION_NAME
=
'
com.permission.PERMISSION_A
'
;
...
...
@@ -64,9 +63,6 @@ describe('ActsBmsKitTest', function () {
}
}
)
setTimeout
(
function
()
{
console
.
info
(
'
==================beforeAll==================end
'
);
},
TIMEOUT
)
})
/*
* @tc.number: ActsBmsKit_getAllShortcutInfo_0100
...
...
@@ -85,9 +81,6 @@ describe('ActsBmsKitTest', function () {
break
;
}
done
();
setTimeout
(
function
()
{
console
.
info
(
'
==================ActsBmsKit_getAllShortcutInfo_0100==================end
'
);
},
TIMEOUT
)
});
/*
...
...
@@ -112,9 +105,6 @@ describe('ActsBmsKitTest', function () {
}
})
}
setTimeout
(
function
()
{
console
.
info
(
'
=====================ActsBmsKit_getAllShortcutInfo_0200==================end
'
);
},
TIMEOUT
)
})
/*
...
...
@@ -133,9 +123,6 @@ describe('ActsBmsKitTest', function () {
}
}
done
();
setTimeout
(
function
()
{
console
.
info
(
'
=====================ActsBmsKit_checkPermission_0100==================end
'
);
},
TIMEOUT
)
})
/*
...
...
@@ -159,9 +146,6 @@ describe('ActsBmsKitTest', function () {
}
})
}
setTimeout
(
function
()
{
console
.
info
(
'
=====================ActsBmsKit_checkPermission_0200==================end
'
);
},
TIMEOUT
)
})
/*
...
...
@@ -213,9 +197,6 @@ describe('ActsBmsKitTest', function () {
count
++
;
});
}
setTimeout
(
function
()
{
console
.
debug
(
'
==========ActsBmsKit_getModuleUsageRecordTest_0200==================end
'
);
},
TIMEOUT
)
})
function
checkModuleUsageRecord
(
data
,
caseName
)
{
console
.
debug
(
'
======================check ModuleUsageRecord begin==========================
'
);
...
...
@@ -226,21 +207,21 @@ describe('ActsBmsKitTest', function () {
console
.
debug
(
'
=============bundleName is=========
'
+
JSON
.
stringify
(
data
[
i
].
bundleName
));
expect
(
data
[
i
].
bundleName
.
length
).
assertLarger
(
0
);
console
.
debug
(
'
=============appLabelId==============
'
+
JSON
.
stringify
(
data
[
i
].
appLabelId
));
expect
(
data
[
i
].
appLabelId
).
assertLarger
(
0
);
expect
(
data
[
i
].
appLabelId
>=
0
).
assertTrue
(
);
console
.
debug
(
'
=============name==============
'
+
JSON
.
stringify
(
data
[
i
].
name
));
expect
(
data
[
i
].
name
.
length
).
assertLarger
(
0
);
console
.
debug
(
'
=============labelId==============
'
+
JSON
.
stringify
(
data
[
i
].
labelId
));
expect
(
data
[
i
].
labelId
>=
0
).
assertTrue
();
expect
(
data
[
i
].
labelId
>=
0
).
assertTrue
();
console
.
debug
(
'
=============descriptionId==============
'
+
JSON
.
stringify
(
data
[
i
].
descriptionId
));
expect
(
data
[
i
].
descriptionId
).
assertEqual
(
0
);
console
.
debug
(
'
=============abilityName==============
'
+
JSON
.
stringify
(
data
[
i
].
abilityName
));
expect
(
data
[
i
].
abilityName
.
length
).
assertLarger
(
0
);
console
.
debug
(
'
=============abilityLabelId==============
'
+
JSON
.
stringify
(
data
[
i
].
abilityLabelId
));
expect
(
data
[
i
].
abilityLabelId
).
assertLarger
(
0
);
expect
(
data
[
i
].
abilityLabelId
>=
0
).
assertTrue
(
);
console
.
debug
(
'
===========abilityDescriptionId===========
'
+
JSON
.
stringify
(
data
[
i
].
abilityDescriptionId
));
expect
(
data
[
i
].
abilityDescriptionId
).
assertLarger
(
0
);
expect
(
data
[
i
].
abilityDescriptionId
>=
0
).
assertTrue
(
);
console
.
debug
(
'
=============abilityIconId==============
'
+
JSON
.
stringify
(
data
[
i
].
abilityIconId
));
expect
(
data
[
i
].
abilityIconId
).
assertLarger
(
0
);
expect
(
data
[
i
].
abilityIconId
>=
0
).
assertTrue
(
);
console
.
debug
(
'
=============launchedCount==============
'
+
JSON
.
stringify
(
data
[
i
].
launchedCount
));
expect
(
data
[
i
].
launchedCount
).
assertLarger
(
0
);
console
.
debug
(
'
=============lastLaunchTime==============
'
+
JSON
.
stringify
(
data
[
i
].
lastLaunchTime
));
...
...
appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/entry/src/main/js/test/ActsBmsMetaDataTest.test.js
浏览文件 @
465d48d2
此差异已折叠。
点击以展开。
appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/test/ActsBmsModuleUsageRecordTest.test.js
浏览文件 @
465d48d2
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录