From fc3b5f23d201b9ea04c795934f62ca97f6489dcd Mon Sep 17 00:00:00 2001 From: wangtiantian Date: Sat, 30 Jul 2022 15:43:20 +0800 Subject: [PATCH] IssueNo: #I5JPY7:hasInstalled complete Description:hasInstalled complete Sig:SIG_ApplicaitonFramework Feature or Bugfix:Bugfix Binary Source:No Signed-off-by: wangtiantian --- .../src/main/ets/test/ActsBmsEtsUnPermissionTest.test.ets | 8 ++++++-- .../src/main/js/test/ActsBmsHasInstalldTest.test.js | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsetsunpermissiontest/entry/src/main/ets/test/ActsBmsEtsUnPermissionTest.test.ets b/bundlemanager/bundle_standard/bundlemanager/actsbmsetsunpermissiontest/entry/src/main/ets/test/ActsBmsEtsUnPermissionTest.test.ets index 26257a1ca..1d52d21f5 100644 --- a/bundlemanager/bundle_standard/bundlemanager/actsbmsetsunpermissiontest/entry/src/main/ets/test/ActsBmsEtsUnPermissionTest.test.ets +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsetsunpermissiontest/entry/src/main/ets/test/ActsBmsEtsUnPermissionTest.test.ets @@ -102,10 +102,12 @@ export default function actsBmsJsUnPermissionTest() { * @tc.desc: test hasInstalled without permission */ it('SUB_BMS_HAP_STATUS_0011', 0, async function (done) { + let flag = 0; pkg.hasInstalled({ bundleName: SELF_BUNDLENAME, success: function success(data) { console.info("get hasInstalled success" + JSON.stringify(data)); + flag += 1; expect(data.result).assertTrue(); done(); }, @@ -116,7 +118,7 @@ export default function actsBmsJsUnPermissionTest() { }, complete: function complete() { console.info("get hasInstalled complete"); - expect().assertFail(); + expect(flag).assertEqual(1); done(); } }) @@ -128,10 +130,12 @@ export default function actsBmsJsUnPermissionTest() { * @tc.desc: test hasInstalled without permission */ it('SUB_BMS_HAP_STATUS_0012', 0, async function (done) { + let flag = 0; pkg.hasInstalled({ bundleName: BUNDLE_NAME_OTHER, success: function success(data) { console.info("get hasInstalled success" + JSON.stringify(data)); + flag += 1; expect(data.result).assertFalse(); done(); }, @@ -142,7 +146,7 @@ export default function actsBmsJsUnPermissionTest() { }, complete: function complete() { console.info("get hasInstalled complete"); - expect().assertFail(); + expect(flag).assertEqual(1); done(); } }) diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsjstest/src/main/js/test/ActsBmsHasInstalldTest.test.js b/bundlemanager/bundle_standard/bundlemanager/actsbmsjstest/src/main/js/test/ActsBmsHasInstalldTest.test.js index 08d711cb8..88b09cb42 100644 --- a/bundlemanager/bundle_standard/bundlemanager/actsbmsjstest/src/main/js/test/ActsBmsHasInstalldTest.test.js +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsjstest/src/main/js/test/ActsBmsHasInstalldTest.test.js @@ -29,10 +29,12 @@ describe('ActsBmsHasInstalldTest', function () { * @tc.desc Test hasInstalled interface. */ it('hasInstalled_0100', 0, async function (done) { + let flag = 0; pkg.hasInstalled({ bundleName: 'com.ohos.launcher', success: function success(data) { console.info('hasInstalled success function in'); + flag += 1; expect(data.result).assertTrue(); done(); }, @@ -43,7 +45,7 @@ describe('ActsBmsHasInstalldTest', function () { }, complete: function complete() { console.info('hasInstalled complete function in'); - expect().assertFail(); + expect(flag).assertEqual(1); done(); } }); @@ -55,10 +57,12 @@ describe('ActsBmsHasInstalldTest', function () { * @tc.desc Test hasInstalled interface. */ it('hasInstalled_0200', 0, async function (done) { + let flag = 0; pkg.hasInstalled({ bundleName: 'wrongName', success: function success(data) { console.info('hasInstalled success function in'); + flag += 1; expect(data.result).assertFalse(); done(); }, @@ -69,7 +73,7 @@ describe('ActsBmsHasInstalldTest', function () { }, complete: function complete() { console.info('hasInstalled complete function in'); - expect().assertFail(); + expect(flag).assertEqual(1); done(); } }); -- GitLab