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 26257a1cae4435c69e6339b60261910511a78806..1d52d21f5a5f020eed8c9ec50d5f9cc92b9525cf 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 08d711cb8af9ea6ee45d84ddfb07e116a4c62a2a..88b09cb424abb1de685a3ab7dbd5612cb91e9d2b 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(); } });