提交 3d211a97 编写于 作者: R r00559040

xts update

Signed-off-by: Nr00559040 <ry.renyi@huawei.com>
上级 44b25e27
......@@ -12,7 +12,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require('./ActsBmsGetBackGroundModes.test.js')
require('./ActsBmsFormsInfoTest.test.js')
require('./ActsBmsPermissionChange.test.js')
require('./ActsBmsQueryAbilityByWant.test.js')
\ No newline at end of file
......@@ -673,12 +673,9 @@ describe('ActsBundleManagerTest', function () {
it('getBundleArchiveInfo_0100', 0, async function (done) {
let installData = await demo.getBundleInstaller()
installData.install([PATH + BMSJSTEST1], installParam, async (err, data) => {
console.err("install result" + JSON.stringify(err))
console.err("install result" + JSON.stringify(data))
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
console.err("getBundleArchiveInfo begin")
getInfo();
});
async function getInfo() {
......@@ -2394,305 +2391,7 @@ describe('ActsBundleManagerTest', function () {
}
})
/**
* @tc.number getPermissionDef_0100
* @tc.name BUNDLE::getPermissionDef
* @tc.desc Test getPermissionDef interfaces.
*/
it('getPermissionDef_0100', 0, async function (done) {
let installData = await demo.getBundleInstaller()
installData.install([PATH + BMSJSTEST1], {
userId: 0,
installFlag: 0,
isKeepData: false
}, async (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
getInfo();
});
async function getInfo() {
demo.getPermissionDef(CAMERA).then((infos) => {
expect(infos.name).assertEqual("com.permission.BMS_PERMISSION_CAMERA");
expect(infos.grantMode).assertEqual(1);
expect(infos.availableScope).assertEqual(2);
expect(infos.label).assertEqual("BMS_PERMISSION_CAMERA permission");
expect(infos.description).assertEqual("BMS_PERMISSION_CAMERA permission in detail");
installData.uninstall(NAME1, {
userId: 0,
installFlag: 0,
isKeepData: false
}, async (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
done();
});
});
}
})
/**
* @tc.number getPermissionDef_0200
* @tc.name BUNDLE::getPermissionDef
* @tc.desc Test getPermissionDef interfaces.
*/
it('getPermissionDef_0200', 0, async function (done) {
let installData = await demo.getBundleInstaller()
installData.install([PATH + BMSJSTEST2, PATH + BMSJSTEST3], {
userId: 0,
installFlag: 0,
isKeepData: false
}, async (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
getInfo();
});
async function getInfo() {
demo.getPermissionDef(CAMERA).then((infos) => {
expect(infos.name).assertEqual("com.permission.BMS_PERMISSION_CAMERA");
expect(infos.grantMode).assertEqual(1);
expect(infos.availableScope).assertEqual(2);
expect(infos.label).assertEqual("BMS_PERMISSION_CAMERA permission");
expect(infos.description).assertEqual("BMS_PERMISSION_CAMERA permission in detail");
});
demo.getPermissionDef(MUSIC).then((infos) => {
expect(infos.name).assertEqual("com.permission.BMS_PERMISSION_MUSIC");
expect(infos.grantMode).assertEqual(1);
expect(infos.availableScope).assertEqual(2);
expect(infos.label).assertEqual("BMS_PERMISSION_MUSIC permission");
expect(infos.description).assertEqual("BMS_PERMISSION_MUSIC permission in detail");
installData.uninstall(NAME2, {
userId: 0,
installFlag: 0,
isKeepData: false
}, (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
done();
});
});
}
})
/**
* @tc.number getPermissionDef_0300
* @tc.name BUNDLE::getPermissionDef
* @tc.desc Test getPermissionDef interfaces.
*/
it('getPermissionDef_0300', 0, async function (done) {
let installData = await demo.getBundleInstaller()
await demo.getBundleInstaller().then((data) => {
data.install([PATH + BMSJSTEST4, PATH + BMSJSTEST5, PATH + BMSJSTEST6], {
userId: 0,
installFlag: 0,
isKeepData: false
}, async (err, data) => {
getInfo();
});
});
async function getInfo() {
demo.getPermissionDef(CAMERA).then((infos) => {
expect(infos.name).assertEqual('');
expect(infos.grantMode).assertEqual(0);
expect(infos.availableScope).assertEqual(0);
expect(infos.label).assertEqual('');
expect(infos.description).assertEqual('');
});
demo.getPermissionDef(MUSIC).then((infos) => {
expect(infos.name).assertEqual('');
expect(infos.grantMode).assertEqual(0);
expect(infos.availableScope).assertEqual(0);
expect(infos.label).assertEqual('');
expect(infos.description).assertEqual('');
});
demo.getPermissionDef(WECHAT).then((infos) => {
expect(infos.name).assertEqual('');
expect(infos.grantMode).assertEqual(0);
expect(infos.availableScope).assertEqual(0);
expect(infos.label).assertEqual('');
expect(infos.description).assertEqual('');
installData.uninstall(NAME3, {
userId: 0,
installFlag: 0,
isKeepData: false
}, (err, data) => {
installData.uninstall(NAME4, {
userId: 0,
installFlag: 0,
isKeepData: false
}, (err, data) => {
installData.uninstall(NAME5, {
userId: 0,
installFlag: 0,
isKeepData: false
}, (err, data) => {
done();
});
});
});
});
}
})
/**
* @tc.number getPermissionDef_0400
* @tc.name BUNDLE::getPermissionDef
* @tc.desc Test getPermissionDef interfaces.
*/
it('getPermissionDef_0400', 0, async function (done) {
demo.getPermissionDef('').then((infos) => {
expect(infos.name).assertEqual("");
expect(infos.grantMode).assertEqual(0);
expect(infos.availableScope).assertEqual(0);
expect(infos.label).assertEqual("");
expect(infos.description).assertEqual("");
done();
});
})
/**
* @tc.number getPermissionDef_0500
* @tc.name BUNDLE::getPermissionDef
* @tc.desc Test getPermissionDef interfaces.
*/
it('getPermissionDef_0500', 0, async function (done) {
demo.getPermissionDef('error').then((infos) => {
expect(infos.name).assertEqual("");
expect(infos.grantMode).assertEqual(0);
expect(infos.availableScope).assertEqual(0);
expect(infos.label).assertEqual("");
expect(infos.description).assertEqual("");
done();
});
})
/**
* @tc.number getPermissionDef_0600
* @tc.name BUNDLE::getPermissionDef
* @tc.desc Test getPermissionDef interfaces.
*/
it('getPermissionDef_0600', 0, async function (done) {
let installData = await demo.getBundleInstaller()
installData.install([PATH + BMSJSTEST1], {
userId: 0,
installFlag: 0,
isKeepData: false
}, async (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
getInfo();
});
async function getInfo() {
await demo.getPermissionDef(CAMERA, OnReceiveEvent);
function OnReceiveEvent(err, data) {
expect(data.name).assertEqual("com.permission.BMS_PERMISSION_CAMERA");
expect(data.grantMode).assertEqual(1);
expect(data.availableScope).assertEqual(2);
expect(data.label).assertEqual("BMS_PERMISSION_CAMERA permission");
expect(data.description).assertEqual("BMS_PERMISSION_CAMERA permission in detail");
installData.uninstall(NAME1, {
userId: 0,
installFlag: 0,
isKeepData: false
}, async (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
done();
});
}
}
})
/**
* @tc.number getPermissionDef_0700
* @tc.name BUNDLE::getPermissionDef
* @tc.desc Test getPermissionDef interfaces.
*/
it('getPermissionDef_0700', 0, async function (done) {
let installData = await demo.getBundleInstaller()
installData.install([PATH + BMSJSTEST2, PATH + BMSJSTEST3], {
userId: 0,
installFlag: 0,
isKeepData: false
}, async (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
getInfo();
});
async function getInfo() {
await demo.getPermissionDef(CAMERA, OnReceiveEvent1);
await demo.getPermissionDef(MUSIC, OnReceiveEvent2);
function OnReceiveEvent1(err, data) {
expect(data.name).assertEqual("com.permission.BMS_PERMISSION_CAMERA");
expect(data.grantMode).assertEqual(1);
expect(data.availableScope).assertEqua(2);
expect(data.label).assertEqual("BMS_PERMISSION_CAMERA permission");
expect(data.description).assertEqual("BMS_PERMISSION_CAMERA permission in detail");
}
function OnReceiveEvent2(err, data) {
expect(data.name).assertEqual("com.permission.BMS_PERMISSION_MUSIC");
expect(data.grantMode).assertEqual(1);
expect(data.availableScope).assertEqual(2);
expect(data.label).assertEqual("BMS_PERMISSION_MUSIC permission");
expect(data.description).assertEqual("BMS_PERMISSION_MUSIC permission in detail");
installData.uninstall(NAME2, {
userId: 0,
installFlag: 0,
isKeepData: false
}, (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
done();
});
}
}
})
/**
* @tc.number getPermissionDef_0800
* @tc.name BUNDLE::getPermissionDef
* @tc.desc Test getPermissionDef interfaces.
*/
it('getPermissionDef_0800', 0, async function (done) {
await demo.getPermissionDef('', OnReceiveEvent);
function OnReceiveEvent(err, data) {
expect(data.name).assertEqual("");
expect(data.availableScope).assertEqual(0);
expect(data.grantMode).assertEqual(0);
expect(data.label).assertEqual("");
expect(data.description).assertEqual("");
done();
}
})
/**
* @tc.number getPermissionDef_0900
* @tc.name BUNDLE::getPermissionDef
* @tc.desc Test getPermissionDef interfaces.
*/
it('getPermissionDef_0900', 0, async function (done) {
await demo.getPermissionDef('error', OnReceiveEvent);
function OnReceiveEvent(err, data) {
expect(data.name).assertEqual("");
expect(data.availableScope).assertEqual(0);
expect(data.grantMode).assertEqual(0);
expect(data.label).assertEqual("");
expect(data.description).assertEqual("");
done();
}
})
/**
* @tc.number install_0100
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册