未验证 提交 fed4d159 编写于 作者: O openharmony_ci 提交者: Gitee

!1801 bms xts fix

Merge pull request !1801 from SoftSquirrel/master
...@@ -244,7 +244,11 @@ describe('ActsBmsKitTest', function () { ...@@ -244,7 +244,11 @@ describe('ActsBmsKitTest', function () {
expect(data[i].lastLaunchTime).assertLarger(0); expect(data[i].lastLaunchTime).assertLarger(0);
console.debug('=============isRemoved==============' + JSON.stringify(data[i].isRemoved)); console.debug('=============isRemoved==============' + JSON.stringify(data[i].isRemoved));
expect(data[i].isRemoved).assertEqual(false); 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) { function checkIsExist(data, bundleName) {
......
...@@ -96,24 +96,40 @@ describe('ActsBundleManagerUninstall', function () { ...@@ -96,24 +96,40 @@ describe('ActsBundleManagerUninstall', function () {
expect(err.code).assertEqual(ERR_CODE); expect(err.code).assertEqual(ERR_CODE);
expect(data.status).assertEqual(STATUS_INSTALL_FAILURE_CONFLICT); expect(data.status).assertEqual(STATUS_INSTALL_FAILURE_CONFLICT);
expect(data.statusMessage).assertEqual('STATUS_INSTALL_FAILURE_CONFLICT'); expect(data.statusMessage).assertEqual('STATUS_INSTALL_FAILURE_CONFLICT');
var datainfo1 = await demo.getBundleInfo(NAME1, 1); var datainfo1 = demo.getBundleInfo(NAME1, 1);
var datainfo2 = await demo.getBundleInfo(NAME2, 1); datainfo1.then(data => {
expect(datainfo1.name).assertEqual(''); expect().assertFail();
expect(datainfo2.name).assertEqual(''); }).catch(err => {
expect(err).assertEqual(1);
});
var datainfo2 = demo.getBundleInfo(NAME2, 1);
datainfo2.then(data => {
expect().assertFail();
}).catch(err => {
expect(err).assertEqual(1);
});
installData.uninstall(NAME1, { installData.uninstall(NAME1, {
userId: 100, userId: 100,
installFlag: 1, installFlag: 1,
isKeepData: false isKeepData: false
}, async(err, data) => { }, async(err, data) => {
var datainfo3 = await demo.getBundleInfo(NAME1, 1); var datainfo3 = demo.getBundleInfo(NAME1, 1);
expect(datainfo3.name).assertEqual(''); datainfo3.then(data => {
expect().assertFail();
}).catch(err => {
expect(err).assertEqual(1);
});
installData.uninstall(NAME2, { installData.uninstall(NAME2, {
userId: 100, userId: 100,
installFlag: 1, installFlag: 1,
isKeepData: false isKeepData: false
}, async(err, data) => { }, async(err, data) => {
var datainfo4 = await demo.getBundleInfo(NAME2, 1); var datainfo4 = demo.getBundleInfo(NAME2, 1);
expect(datainfo4.name).assertEqual(''); datainfo4.then(data => {
expect().assertFail();
}).catch(err => {
expect(err).assertEqual(1);
});
done(); done();
}) })
}) })
...@@ -135,33 +151,57 @@ describe('ActsBundleManagerUninstall', function () { ...@@ -135,33 +151,57 @@ describe('ActsBundleManagerUninstall', function () {
expect(err.code).assertEqual(ERR_CODE); expect(err.code).assertEqual(ERR_CODE);
expect(data.status).assertEqual(STATUS_INSTALL_FAILURE_INVALID); expect(data.status).assertEqual(STATUS_INSTALL_FAILURE_INVALID);
expect(data.statusMessage).assertEqual('STATUS_INSTALL_FAILURE_INVALID'); expect(data.statusMessage).assertEqual('STATUS_INSTALL_FAILURE_INVALID');
var datainfo1 = await demo.getBundleInfo(NAME3, 1); var datainfo1 = demo.getBundleInfo(NAME3, 1);
expect(datainfo1.name).assertEqual(''); datainfo1.then(data => {
var datainfo2 = await demo.getBundleInfo(NAME4, 1); expect().assertFail();
expect(datainfo2.name).assertEqual(''); }).catch(err => {
var datainfo3 = await demo.getBundleInfo(NAME5, 1); expect(err).assertEqual(1);
expect(datainfo3.name).assertEqual(''); });
var datainfo2 = demo.getBundleInfo(NAME4, 1);
datainfo2.then(data => {
expect().assertFail();
}).catch(err => {
expect(err).assertEqual(1);
});
var datainfo3 = demo.getBundleInfo(NAME5, 1);
datainfo3.then(data => {
expect().assertFail();
}).catch(err => {
expect(err).assertEqual(1);
});
installData.uninstall(NAME3, { installData.uninstall(NAME3, {
userId: 100, userId: 100,
installFlag: 1, installFlag: 1,
isKeepData: false isKeepData: false
}, async(err, data) => { }, async(err, data) => {
var datainfo4 = await demo.getBundleInfo(NAME3, 1); var datainfo4 = demo.getBundleInfo(NAME3, 1);
expect(datainfo4.name).assertEqual(''); datainfo4.then(data => {
expect().assertFail();
}).catch(err => {
expect(err).assertEqual(1);
});
installData.uninstall(NAME4, { installData.uninstall(NAME4, {
userId: 100, userId: 100,
installFlag: 1, installFlag: 1,
isKeepData: false isKeepData: false
}, async(err, data) => { }, async(err, data) => {
var datainfo5 = await demo.getBundleInfo(NAME4, 1); var datainfo5 = demo.getBundleInfo(NAME4, 1);
expect(datainfo5.name).assertEqual(''); datainfo5.then(data => {
expect().assertFail();
}).catch(err => {
expect(err).assertEqual(1);
});
installData.uninstall(NAME5, { installData.uninstall(NAME5, {
userId: 100, userId: 100,
installFlag: 1, installFlag: 1,
isKeepData: false isKeepData: false
}, async(err, data) => { }, async(err, data) => {
var datainfo6 = await demo.getBundleInfo(NAME5, 1); var datainfo6 = demo.getBundleInfo(NAME5, 1);
expect(datainfo6.name).assertEqual(''); datainfo6.then(data => {
expect().assertFail();
}).catch(err => {
expect(err).assertEqual(1);
});
done(); done();
}); });
}); });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册