From 3e4e74e60ed825a5b8502610b61b80357f3f60ff Mon Sep 17 00:00:00 2001 From: SoftSquirrel Date: Sat, 5 Feb 2022 17:25:40 +0800 Subject: [PATCH] Description:bms xts fix Feature or Bugfix: Bugfix Binary Source: No Signed-off-by: SoftSquirrel --- .../src/main/js/test/ActsBmsKitTest.test.js | 6 +- .../src/main/js/test/ExampleJsunit.test.js | 80 ++++++++++++++----- 2 files changed, 65 insertions(+), 21 deletions(-) diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmskittest/entry/src/main/js/test/ActsBmsKitTest.test.js b/appexecfwk/bundle_standard/bundlemanager/actsbmskittest/entry/src/main/js/test/ActsBmsKitTest.test.js index ab827ea20..b591d2680 100644 --- a/appexecfwk/bundle_standard/bundlemanager/actsbmskittest/entry/src/main/js/test/ActsBmsKitTest.test.js +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmskittest/entry/src/main/js/test/ActsBmsKitTest.test.js @@ -244,7 +244,11 @@ describe('ActsBmsKitTest', function () { expect(data[i].lastLaunchTime).assertLarger(0); console.debug('=============isRemoved==============' + JSON.stringify(data[i].isRemoved)); expect(data[i].isRemoved).assertEqual(false); - expect(data[i].installationFreeSupported).assertEqual(false); + if (data[i].bundleName == 'com.ohos.launcher') { + expect(data[i].installationFreeSupported).assertTrue(); + } else { + expect(data[i].installationFreeSupported).assertFalse(); + } } } function checkIsExist(data, bundleName) { diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbundlemanageruninstall/entry/src/main/js/test/ExampleJsunit.test.js b/appexecfwk/bundle_standard/bundlemanager/actsbundlemanageruninstall/entry/src/main/js/test/ExampleJsunit.test.js index 0ba24f79f..3ede873a4 100644 --- a/appexecfwk/bundle_standard/bundlemanager/actsbundlemanageruninstall/entry/src/main/js/test/ExampleJsunit.test.js +++ b/appexecfwk/bundle_standard/bundlemanager/actsbundlemanageruninstall/entry/src/main/js/test/ExampleJsunit.test.js @@ -96,24 +96,40 @@ describe('ActsBundleManagerUninstall', function () { expect(err.code).assertEqual(ERR_CODE); expect(data.status).assertEqual(STATUS_INSTALL_FAILURE_CONFLICT); expect(data.statusMessage).assertEqual('STATUS_INSTALL_FAILURE_CONFLICT'); - var datainfo1 = await demo.getBundleInfo(NAME1, 1); - var datainfo2 = await demo.getBundleInfo(NAME2, 1); - expect(datainfo1.name).assertEqual(''); - expect(datainfo2.name).assertEqual(''); + var datainfo1 = demo.getBundleInfo(NAME1, 1); + datainfo1.then(data => { + expect(true).assertFalse(); + }).catch(err => { + expect(err).assertEqual(1); + }); + var datainfo2 = demo.getBundleInfo(NAME2, 1); + datainfo2.then(data => { + expect(true).assertFalse(); + }).catch(err => { + expect(err).assertEqual(1); + }); installData.uninstall(NAME1, { userId: 100, installFlag: 1, isKeepData: false }, async(err, data) => { - var datainfo3 = await demo.getBundleInfo(NAME1, 1); - expect(datainfo3.name).assertEqual(''); + var datainfo3 = demo.getBundleInfo(NAME1, 1); + datainfo3.then(data => { + expect(true).assertFalse(); + }).catch(err => { + expect(err).assertEqual(1); + }); installData.uninstall(NAME2, { userId: 100, installFlag: 1, isKeepData: false }, async(err, data) => { - var datainfo4 = await demo.getBundleInfo(NAME2, 1); - expect(datainfo4.name).assertEqual(''); + var datainfo4 = demo.getBundleInfo(NAME2, 1); + datainfo4.then(data => { + expect(true).assertFalse(); + }).catch(err => { + expect(err).assertEqual(1); + }); done(); }) }) @@ -135,33 +151,57 @@ describe('ActsBundleManagerUninstall', function () { expect(err.code).assertEqual(ERR_CODE); expect(data.status).assertEqual(STATUS_INSTALL_FAILURE_INVALID); expect(data.statusMessage).assertEqual('STATUS_INSTALL_FAILURE_INVALID'); - var datainfo1 = await demo.getBundleInfo(NAME3, 1); - expect(datainfo1.name).assertEqual(''); - var datainfo2 = await demo.getBundleInfo(NAME4, 1); - expect(datainfo2.name).assertEqual(''); - var datainfo3 = await demo.getBundleInfo(NAME5, 1); - expect(datainfo3.name).assertEqual(''); + var datainfo1 = demo.getBundleInfo(NAME3, 1); + datainfo1.then(data => { + expect(true).assertFalse(); + }).catch(err => { + expect(err).assertEqual(1); + }); + var datainfo2 = demo.getBundleInfo(NAME4, 1); + datainfo2.then(data => { + expect(true).assertFalse(); + }).catch(err => { + expect(err).assertEqual(1); + }); + var datainfo3 = demo.getBundleInfo(NAME5, 1); + datainfo3.then(data => { + expect(true).assertFalse(); + }).catch(err => { + expect(err).assertEqual(1); + }); installData.uninstall(NAME3, { userId: 100, installFlag: 1, isKeepData: false }, async(err, data) => { - var datainfo4 = await demo.getBundleInfo(NAME3, 1); - expect(datainfo4.name).assertEqual(''); + var datainfo4 = demo.getBundleInfo(NAME3, 1); + datainfo4.then(data => { + expect(true).assertFalse(); + }).catch(err => { + expect(err).assertEqual(1); + }); installData.uninstall(NAME4, { userId: 100, installFlag: 1, isKeepData: false }, async(err, data) => { - var datainfo5 = await demo.getBundleInfo(NAME4, 1); - expect(datainfo5.name).assertEqual(''); + var datainfo5 = demo.getBundleInfo(NAME4, 1); + datainfo5.then(data => { + expect(true).assertFalse(); + }).catch(err => { + expect(err).assertEqual(1); + }); installData.uninstall(NAME5, { userId: 100, installFlag: 1, isKeepData: false }, async(err, data) => { - var datainfo6 = await demo.getBundleInfo(NAME5, 1); - expect(datainfo6.name).assertEqual(''); + var datainfo6 = demo.getBundleInfo(NAME5, 1); + datainfo6.then(data => { + expect(true).assertFalse(); + }).catch(err => { + expect(err).assertEqual(1); + }); done(); }); }); -- GitLab