提交 fc3b5f23 编写于 作者: W wangtiantian

IssueNo: #I5JPY7:hasInstalled complete

Description:hasInstalled complete
Sig:SIG_ApplicaitonFramework
Feature or Bugfix:Bugfix
Binary Source:No
Signed-off-by: Nwangtiantian <wangtiantian19@huawei.com>
上级 e10756f4
...@@ -102,10 +102,12 @@ export default function actsBmsJsUnPermissionTest() { ...@@ -102,10 +102,12 @@ export default function actsBmsJsUnPermissionTest() {
* @tc.desc: test hasInstalled without permission * @tc.desc: test hasInstalled without permission
*/ */
it('SUB_BMS_HAP_STATUS_0011', 0, async function (done) { it('SUB_BMS_HAP_STATUS_0011', 0, async function (done) {
let flag = 0;
pkg.hasInstalled({ pkg.hasInstalled({
bundleName: SELF_BUNDLENAME, bundleName: SELF_BUNDLENAME,
success: function success(data) { success: function success(data) {
console.info("get hasInstalled success" + JSON.stringify(data)); console.info("get hasInstalled success" + JSON.stringify(data));
flag += 1;
expect(data.result).assertTrue(); expect(data.result).assertTrue();
done(); done();
}, },
...@@ -116,7 +118,7 @@ export default function actsBmsJsUnPermissionTest() { ...@@ -116,7 +118,7 @@ export default function actsBmsJsUnPermissionTest() {
}, },
complete: function complete() { complete: function complete() {
console.info("get hasInstalled complete"); console.info("get hasInstalled complete");
expect().assertFail(); expect(flag).assertEqual(1);
done(); done();
} }
}) })
...@@ -128,10 +130,12 @@ export default function actsBmsJsUnPermissionTest() { ...@@ -128,10 +130,12 @@ export default function actsBmsJsUnPermissionTest() {
* @tc.desc: test hasInstalled without permission * @tc.desc: test hasInstalled without permission
*/ */
it('SUB_BMS_HAP_STATUS_0012', 0, async function (done) { it('SUB_BMS_HAP_STATUS_0012', 0, async function (done) {
let flag = 0;
pkg.hasInstalled({ pkg.hasInstalled({
bundleName: BUNDLE_NAME_OTHER, bundleName: BUNDLE_NAME_OTHER,
success: function success(data) { success: function success(data) {
console.info("get hasInstalled success" + JSON.stringify(data)); console.info("get hasInstalled success" + JSON.stringify(data));
flag += 1;
expect(data.result).assertFalse(); expect(data.result).assertFalse();
done(); done();
}, },
...@@ -142,7 +146,7 @@ export default function actsBmsJsUnPermissionTest() { ...@@ -142,7 +146,7 @@ export default function actsBmsJsUnPermissionTest() {
}, },
complete: function complete() { complete: function complete() {
console.info("get hasInstalled complete"); console.info("get hasInstalled complete");
expect().assertFail(); expect(flag).assertEqual(1);
done(); done();
} }
}) })
......
...@@ -29,10 +29,12 @@ describe('ActsBmsHasInstalldTest', function () { ...@@ -29,10 +29,12 @@ describe('ActsBmsHasInstalldTest', function () {
* @tc.desc Test hasInstalled interface. * @tc.desc Test hasInstalled interface.
*/ */
it('hasInstalled_0100', 0, async function (done) { it('hasInstalled_0100', 0, async function (done) {
let flag = 0;
pkg.hasInstalled({ pkg.hasInstalled({
bundleName: 'com.ohos.launcher', bundleName: 'com.ohos.launcher',
success: function success(data) { success: function success(data) {
console.info('hasInstalled success function in'); console.info('hasInstalled success function in');
flag += 1;
expect(data.result).assertTrue(); expect(data.result).assertTrue();
done(); done();
}, },
...@@ -43,7 +45,7 @@ describe('ActsBmsHasInstalldTest', function () { ...@@ -43,7 +45,7 @@ describe('ActsBmsHasInstalldTest', function () {
}, },
complete: function complete() { complete: function complete() {
console.info('hasInstalled complete function in'); console.info('hasInstalled complete function in');
expect().assertFail(); expect(flag).assertEqual(1);
done(); done();
} }
}); });
...@@ -55,10 +57,12 @@ describe('ActsBmsHasInstalldTest', function () { ...@@ -55,10 +57,12 @@ describe('ActsBmsHasInstalldTest', function () {
* @tc.desc Test hasInstalled interface. * @tc.desc Test hasInstalled interface.
*/ */
it('hasInstalled_0200', 0, async function (done) { it('hasInstalled_0200', 0, async function (done) {
let flag = 0;
pkg.hasInstalled({ pkg.hasInstalled({
bundleName: 'wrongName', bundleName: 'wrongName',
success: function success(data) { success: function success(data) {
console.info('hasInstalled success function in'); console.info('hasInstalled success function in');
flag += 1;
expect(data.result).assertFalse(); expect(data.result).assertFalse();
done(); done();
}, },
...@@ -69,7 +73,7 @@ describe('ActsBmsHasInstalldTest', function () { ...@@ -69,7 +73,7 @@ describe('ActsBmsHasInstalldTest', function () {
}, },
complete: function complete() { complete: function complete() {
console.info('hasInstalled complete function in'); console.info('hasInstalled complete function in');
expect().assertFail(); expect(flag).assertEqual(1);
done(); done();
} }
}); });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册