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

!4982 getProcessRunningInformation接口对应新增测试用例

Merge pull request !4982 from savior-xzh/master
...@@ -115,9 +115,6 @@ export default function ActsAmsCallBackFifthScene() { ...@@ -115,9 +115,6 @@ export default function ActsAmsCallBackFifthScene() {
* @tc.desc : Get All Running Processes Info(by CallBack) * @tc.desc : Get All Running Processes Info(by CallBack)
*/ */
it('Acts_Ams_test_6600', 0, async function (done) { it('Acts_Ams_test_6600', 0, async function (done) {
console.info("sleep begin");
sleep(5000);
console.info("sleep end");
appManager.getProcessRunningInfos( appManager.getProcessRunningInfos(
(error, info) => { (error, info) => {
console.info('Acts_Ams_test_6600 getProcessRunningInfos error.code \ console.info('Acts_Ams_test_6600 getProcessRunningInfos error.code \
...@@ -141,5 +138,37 @@ export default function ActsAmsCallBackFifthScene() { ...@@ -141,5 +138,37 @@ export default function ActsAmsCallBackFifthScene() {
} }
); );
}) })
/*
* @tc.number : Acts_Ams_test_6700
* @tc.name : getProcessRunningInformation : Get All Running Processes Information
* @tc.desc : Get All Running Processes Information(by CallBack)
*/
it('Acts_Ams_test_6700', 0, async function (done) {
appManager.getProcessRunningInformation(
(error, info) => {
console.info('Acts_Ams_test_6700 getProcessRunningInformation error.code \
' + error.code + ', data length [' + info.length + ']');
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertLarger(0);
for (let i = 0; i < info.length; i++) {
console.info('Acts_Ams_test_6700 getProcessRunningInformation[' + i + "]: \
" + JSON.stringify(info[i]));
expect(typeof (info[i].pid)).assertEqual("number");
expect(info[i].pid).assertLarger(0);
expect(typeof (info[i].processName)).assertEqual("string");
expect(info[i].processName.length).assertLarger(0);
expect(Array.isArray(info[i].bundleNames)).assertEqual(true);
expect(info[i].bundleNames.length).assertLarger(0);
expect(typeof (info[i].uid)).assertEqual("number");
expect(info[i].uid).assertLarger(0);
}
done();
}
);
})
}) })
} }
\ No newline at end of file
...@@ -59,9 +59,6 @@ export default function ActsAmsCallBackFirstScene() { ...@@ -59,9 +59,6 @@ export default function ActsAmsCallBackFirstScene() {
* @tc.desc : Get All Running Processes Info(by CallBack) * @tc.desc : Get All Running Processes Info(by CallBack)
*/ */
it('Acts_Ams_test_0200', 0, async function (done) { it('Acts_Ams_test_0200', 0, async function (done) {
console.info("sleep begin");
sleep(5000);
console.info("sleep end");
appManager.getProcessRunningInfos( appManager.getProcessRunningInfos(
(error, info) => { (error, info) => {
console.info('Acts_Ams_test_0200 getProcessRunningInfos error.code \ console.info('Acts_Ams_test_0200 getProcessRunningInfos error.code \
...@@ -84,5 +81,36 @@ export default function ActsAmsCallBackFirstScene() { ...@@ -84,5 +81,36 @@ export default function ActsAmsCallBackFirstScene() {
done(); done();
}); });
}) })
/*
* @tc.number : Acts_Ams_test_0300
* @tc.name : getProcessRunningInformation : Get All Running Processes Information
* @tc.desc : Get All Running Processes Information(by CallBack)
*/
it('Acts_Ams_test_0300', 0, async function (done) {
appManager.getProcessRunningInformation(
(error, info) => {
console.info('Acts_Ams_test_0300 getProcessRunningInformation error.code \
' + error.code + ', data length [' + info.length + ']');
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertLarger(0);
for (var i = 0; i < info.length; i++) {
console.info('Acts_Ams_test_0200 getProcessRunningInformation[' + i + "]: \
" + JSON.stringify(info[i]));
expect(typeof (info[i].pid)).assertEqual("number");
expect(info[i].pid).assertLarger(0);
expect(typeof (info[i].processName)).assertEqual("string");
expect(info[i].processName.length).assertLarger(0);
expect(Array.isArray(info[i].bundleNames)).assertEqual(true);
expect(info[i].bundleNames.length).assertLarger(0);
expect(typeof (info[i].uid)).assertEqual("number");
expect(info[i].uid).assertLarger(0);
}
done();
});
})
}) })
} }
\ No newline at end of file
...@@ -110,9 +110,6 @@ export default function ActsAmsCallBackFourthScene() { ...@@ -110,9 +110,6 @@ export default function ActsAmsCallBackFourthScene() {
* @tc.desc : Get All Running Processes Info(by CallBack) * @tc.desc : Get All Running Processes Info(by CallBack)
*/ */
it('Acts_Ams_test_5000', 0, async function (done) { it('Acts_Ams_test_5000', 0, async function (done) {
console.info("sleep begin");
sleep(5000);
console.info("sleep end");
appManager.getProcessRunningInfos( appManager.getProcessRunningInfos(
(error, info) => { (error, info) => {
console.info('Acts_Ams_test_5000 getProcessRunningInfos error.code \ console.info('Acts_Ams_test_5000 getProcessRunningInfos error.code \
...@@ -135,5 +132,36 @@ export default function ActsAmsCallBackFourthScene() { ...@@ -135,5 +132,36 @@ export default function ActsAmsCallBackFourthScene() {
done(); done();
}); });
}) })
/*
* @tc.number : Acts_Ams_test_5100
* @tc.name : getProcessRunningInformation : Get All Running Processes Information
* @tc.desc : Get All Running Processes Information(by CallBack)
*/
it('Acts_Ams_test_5100', 0, async function (done) {
appManager.getProcessRunningInformation(
(error, info) => {
console.info('Acts_Ams_test_5100 getProcessRunningInformation error.code \
' + error.code + ', data length [' + info.length + ']');
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertLarger(0);
for (let i = 0; i < info.length; i++) {
console.info('Acts_Ams_test_5100 getProcessRunningInformation[' + i + "]: \
" + JSON.stringify(info[i]));
expect(typeof (info[i].pid)).assertEqual("number");
expect(info[i].pid).assertLarger(0);
expect(typeof (info[i].processName)).assertEqual("string");
expect(info[i].processName.length).assertLarger(0);
expect(Array.isArray(info[i].bundleNames)).assertEqual(true);
expect(info[i].bundleNames.length).assertLarger(0);
expect(typeof (info[i].uid)).assertEqual("number");
expect(info[i].uid).assertLarger(0);
}
done();
});
})
}) })
} }
\ No newline at end of file
...@@ -76,9 +76,6 @@ export default function ActsAmsCallBackSecondScene() { ...@@ -76,9 +76,6 @@ export default function ActsAmsCallBackSecondScene() {
* @tc.desc : Get All Running Processes Info(by CallBack) * @tc.desc : Get All Running Processes Info(by CallBack)
*/ */
it('Acts_Ams_test_1800', 0, async function (done) { it('Acts_Ams_test_1800', 0, async function (done) {
console.info("sleep begin");
sleep(5000);
console.info("sleep end");
appManager.getProcessRunningInfos( appManager.getProcessRunningInfos(
(error, info) => { (error, info) => {
console.info('Acts_Ams_test_1800 getProcessRunningInfos error.code \ console.info('Acts_Ams_test_1800 getProcessRunningInfos error.code \
...@@ -101,5 +98,36 @@ export default function ActsAmsCallBackSecondScene() { ...@@ -101,5 +98,36 @@ export default function ActsAmsCallBackSecondScene() {
done(); done();
}); });
}) })
/*
* @tc.number : Acts_Ams_test_1900
* @tc.name : getProcessRunningInformation : Get All Running Processes Information
* @tc.desc : Get All Running Processes Information(by CallBack)
*/
it('Acts_Ams_test_1900', 0, async function (done) {
appManager.getProcessRunningInformation(
(error, info) => {
console.info('Acts_Ams_test_1900 getProcessRunningInformation error.code \
' + error.code + ', data length [' + info.length + ']');
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertLarger(0);
for (let i = 0; i < info.length; i++) {
console.info('Acts_Ams_test_1900 getProcessRunningInformation[' + i + "]: \
" + JSON.stringify(info[i]));
expect(typeof (info[i].pid)).assertEqual("number");
expect(info[i].pid).assertLarger(0);
expect(typeof (info[i].processName)).assertEqual("string");
expect(info[i].processName.length).assertLarger(0);
expect(Array.isArray(info[i].bundleNames)).assertEqual(true);
expect(info[i].bundleNames.length).assertLarger(0);
expect(typeof (info[i].uid)).assertEqual("number");
expect(info[i].uid).assertLarger(0);
}
done();
});
})
}) })
} }
\ No newline at end of file
...@@ -70,9 +70,6 @@ export default function ActsAmsCallBackThirdScene() { ...@@ -70,9 +70,6 @@ export default function ActsAmsCallBackThirdScene() {
* @tc.desc : Get All Running Processes Info(by CallBack) * @tc.desc : Get All Running Processes Info(by CallBack)
*/ */
it('Acts_Ams_test_3400', 0, async function (done) { it('Acts_Ams_test_3400', 0, async function (done) {
console.info("sleep begin");
sleep(5000);
console.info("sleep end");
appManager.getProcessRunningInfos( appManager.getProcessRunningInfos(
(error, info) => { (error, info) => {
console.info('Acts_Ams_test_3400 getProcessRunningInfos error.code \ console.info('Acts_Ams_test_3400 getProcessRunningInfos error.code \
...@@ -95,5 +92,36 @@ export default function ActsAmsCallBackThirdScene() { ...@@ -95,5 +92,36 @@ export default function ActsAmsCallBackThirdScene() {
done(); done();
}); });
}) })
/*
* @tc.number : Acts_Ams_test_3500
* @tc.name : getProcessRunningInformation : Get All Running Processes Information
* @tc.desc : Get All Running Processes Information(by CallBack)
*/
it('Acts_Ams_test_3500', 0, async function (done) {
appManager.getProcessRunningInformation(
(error, info) => {
console.info('Acts_Ams_test_3500 getProcessRunningInformation error.code \
' + error.code + ', data length [' + info.length + ']');
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertLarger(0);
for (let i = 0; i < info.length; i++) {
console.info('Acts_Ams_test_3500 getProcessRunningInformation[' + i + "]: \
" + JSON.stringify(info[i]));
expect(typeof (info[i].pid)).assertEqual("number");
expect(info[i].pid).assertLarger(0);
expect(typeof (info[i].processName)).assertEqual("string");
expect(info[i].processName.length).assertLarger(0);
expect(Array.isArray(info[i].bundleNames)).assertEqual(true);
expect(info[i].bundleNames.length).assertLarger(0);
expect(typeof (info[i].uid)).assertEqual("number");
expect(info[i].uid).assertLarger(0);
}
done();
});
})
}) })
} }
\ No newline at end of file
...@@ -130,9 +130,6 @@ export default function ActsAmsTestFifthScene() { ...@@ -130,9 +130,6 @@ export default function ActsAmsTestFifthScene() {
* @tc.desc : Get All Running Processes Info(by Promise) * @tc.desc : Get All Running Processes Info(by Promise)
*/ */
it('Acts_Ams_test_0100', 0, async function (done) { it('Acts_Ams_test_0100', 0, async function (done) {
console.info("sleep begin");
sleep(5000);
console.info("sleep end");
let info = await appManager.getProcessRunningInfos(); let info = await appManager.getProcessRunningInfos();
expect(Array.isArray(info)).assertEqual(true); expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertLarger(0); expect(info.length).assertLarger(0);
...@@ -151,5 +148,32 @@ export default function ActsAmsTestFifthScene() { ...@@ -151,5 +148,32 @@ export default function ActsAmsTestFifthScene() {
} }
done(); done();
}) })
/*
* @tc.number : Acts_Ams_test_0200
* @tc.name : getProcessRunningInformation : Get All Running Processes Information
* @tc.desc : Get All Running Processes Information(by Promise)
*/
it('Acts_Ams_test_0200', 0, async function (done) {
let info = await appManager.getProcessRunningInformation();
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertLarger(0);
for (let i = 0; i < info.length; i++) {
console.info('Acts_Ams_test_0200 getProcessRunningInformation[' + i + "]: \
" + JSON.stringify(info[i]));
expect(typeof (info[i].pid)).assertEqual("number");
expect(info[i].pid).assertLarger(0);
expect(typeof (info[i].processName)).assertEqual("string");
expect(info[i].processName.length).assertLarger(0);
expect(Array.isArray(info[i].bundleNames)).assertEqual(true);
expect(info[i].bundleNames.length).assertLarger(0);
expect(typeof (info[i].uid)).assertEqual("number");
expect(info[i].uid).assertLarger(0);
}
done();
})
}) })
} }
\ No newline at end of file
...@@ -64,9 +64,6 @@ export default function ActsAmsTestFirstScene() { ...@@ -64,9 +64,6 @@ export default function ActsAmsTestFirstScene() {
* @tc.desc : Get All Running Processes Info(by Promise) * @tc.desc : Get All Running Processes Info(by Promise)
*/ */
it('Acts_Ams_test_0100', 0, async function (done) { it('Acts_Ams_test_0100', 0, async function (done) {
console.info("sleep begin");
sleep(5000);
console.info("sleep end");
var info = await appManager.getProcessRunningInfos(); var info = await appManager.getProcessRunningInfos();
expect(Array.isArray(info)).assertEqual(true); expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertLarger(0); expect(info.length).assertLarger(0);
...@@ -85,5 +82,32 @@ export default function ActsAmsTestFirstScene() { ...@@ -85,5 +82,32 @@ export default function ActsAmsTestFirstScene() {
} }
done(); done();
}) })
/*
* @tc.number : Acts_Ams_test_0200
* @tc.name : getProcessRunningInformation : Get All Running Processes Information
* @tc.desc : Get All Running Processes Information(by Promise)
*/
it('Acts_Ams_test_0200', 0, async function (done) {
var info = await appManager.getProcessRunningInformation();
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertLarger(0);
for (var i = 0; i < info.length; i++) {
console.info('Acts_Ams_test_0200 getProcessRunningInformation[' + i + "]: \
" + JSON.stringify(info[i]));
expect(typeof (info[i].pid)).assertEqual("number");
expect(info[i].pid).assertLarger(0);
expect(typeof (info[i].processName)).assertEqual("string");
expect(info[i].processName.length).assertLarger(0);
expect(Array.isArray(info[i].bundleNames)).assertEqual(true);
expect(info[i].bundleNames.length).assertLarger(0);
expect(typeof (info[i].uid)).assertEqual("number");
expect(info[i].uid).assertLarger(0);
}
done();
})
}) })
} }
\ No newline at end of file
...@@ -131,7 +131,7 @@ export default function ActsAmsTestFourthScene() { ...@@ -131,7 +131,7 @@ export default function ActsAmsTestFourthScene() {
*/ */
it('Acts_Ams_test_1700', 0, async function (done) { it('Acts_Ams_test_1700', 0, async function (done) {
console.info("sleep begin"); console.info("sleep begin");
sleep(5000); sleep(2000);
console.info("sleep end"); console.info("sleep end");
var info = await appManager.getProcessRunningInfos(); var info = await appManager.getProcessRunningInfos();
expect(Array.isArray(info)).assertEqual(true); expect(Array.isArray(info)).assertEqual(true);
...@@ -151,5 +151,35 @@ export default function ActsAmsTestFourthScene() { ...@@ -151,5 +151,35 @@ export default function ActsAmsTestFourthScene() {
} }
done(); done();
}) })
/*
* @tc.number : Acts_Ams_test_1800
* @tc.name : getProcessRunningInformation : Get All Running Processes Information
* @tc.desc : Get All Running Processes Information(by Promise)
*/
it('Acts_Ams_test_1800', 0, async function (done) {
console.info("sleep begin");
sleep(2000);
console.info("sleep end");
var info = await appManager.getProcessRunningInformation();
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertLarger(0);
for (var i = 0; i < info.length; i++) {
console.info('Acts_Ams_test_1800 getProcessRunningInformation[' + i + "]: \
" + JSON.stringify(info[i]));
expect(typeof (info[i].pid)).assertEqual("number");
expect(info[i].pid).assertLarger(0);
expect(typeof (info[i].processName)).assertEqual("string");
expect(info[i].processName.length).assertLarger(0);
expect(Array.isArray(info[i].bundleNames)).assertEqual(true);
expect(info[i].bundleNames.length).assertLarger(0);
expect(typeof (info[i].uid)).assertEqual("number");
expect(info[i].uid).assertLarger(0);
}
done();
})
}) })
} }
\ No newline at end of file
...@@ -86,9 +86,6 @@ export default function ActsAmsTestSecondScene() { ...@@ -86,9 +86,6 @@ export default function ActsAmsTestSecondScene() {
* @tc.desc : Get All Running Processes Info(by Promise) * @tc.desc : Get All Running Processes Info(by Promise)
*/ */
it('Acts_Ams_test_1700', 0, async function (done) { it('Acts_Ams_test_1700', 0, async function (done) {
console.info("sleep begin");
sleep(5000);
console.info("sleep end");
var info = await appManager.getProcessRunningInfos(); var info = await appManager.getProcessRunningInfos();
expect(Array.isArray(info)).assertEqual(true); expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertLarger(0); expect(info.length).assertLarger(0);
...@@ -107,5 +104,32 @@ export default function ActsAmsTestSecondScene() { ...@@ -107,5 +104,32 @@ export default function ActsAmsTestSecondScene() {
} }
done(); done();
}) })
/*
* @tc.number : Acts_Ams_test_1800
* @tc.name : getProcessRunningInformation : Get All Running Processes Information
* @tc.desc : Get All Running Processes Information(by Promise)
*/
it('Acts_Ams_test_1800', 0, async function (done) {
var info = await appManager.getProcessRunningInformation();
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertLarger(0);
for (var i = 0; i < info.length; i++) {
console.info('Acts_Ams_test_1800 getProcessRunningInformation[' + i + "]: \
" + JSON.stringify(info[i]));
expect(typeof (info[i].pid)).assertEqual("number");
expect(info[i].pid).assertLarger(0);
expect(typeof (info[i].processName)).assertEqual("string");
expect(info[i].processName.length).assertLarger(0);
expect(Array.isArray(info[i].bundleNames)).assertEqual(true);
expect(info[i].bundleNames.length).assertLarger(0);
expect(typeof (info[i].uid)).assertEqual("number");
expect(info[i].uid).assertLarger(0);
}
done();
})
}) })
} }
\ No newline at end of file
...@@ -87,9 +87,6 @@ export default function ActsAmsTestThirdScene() { ...@@ -87,9 +87,6 @@ export default function ActsAmsTestThirdScene() {
* @tc.desc : Get All Running Processes Info(by Promise) * @tc.desc : Get All Running Processes Info(by Promise)
*/ */
it('Acts_Ams_test_3300', 0, async function (done) { it('Acts_Ams_test_3300', 0, async function (done) {
console.info("sleep begin");
sleep(5000);
console.info("sleep end");
var info = await appManager.getProcessRunningInfos(); var info = await appManager.getProcessRunningInfos();
console.info('Acts_Ams_test_3300 getProcessRunningInfos JSON String: ' + JSON.stringify(info)); console.info('Acts_Ams_test_3300 getProcessRunningInfos JSON String: ' + JSON.stringify(info));
expect(Array.isArray(info)).assertEqual(true); expect(Array.isArray(info)).assertEqual(true);
...@@ -109,5 +106,34 @@ export default function ActsAmsTestThirdScene() { ...@@ -109,5 +106,34 @@ export default function ActsAmsTestThirdScene() {
} }
done(); done();
}) })
/*
* @tc.number : Acts_Ams_test_3400
* @tc.name : getProcessRunningInformation : Get All Running Processes Information
* @tc.desc : Get All Running Processes Information(by Promise)
*/
it('Acts_Ams_test_3400', 0, async function (done) {
var info = await appManager.getProcessRunningInformation();
console.info('Acts_Ams_test_3400 getProcessRunningInformation JSON String: \
' + JSON.stringify(info));
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertLarger(0);
for (var i = 0; i < info.length; i++) {
console.info('Acts_Ams_test_3400 getProcessRunningInformation[' + i + "]: \
" + JSON.stringify(info[i]));
expect(typeof (info[i].pid)).assertEqual("number");
expect(info[i].pid).assertLarger(0);
expect(typeof (info[i].processName)).assertEqual("string");
expect(info[i].processName.length).assertLarger(0);
expect(Array.isArray(info[i].bundleNames)).assertEqual(true);
expect(info[i].bundleNames.length).assertLarger(0);
expect(typeof (info[i].uid)).assertEqual("number");
expect(info[i].uid).assertLarger(0);
}
done();
})
}) })
} }
\ No newline at end of file
...@@ -58,5 +58,35 @@ describe('ActsAbilityRunningInfosTest', function () { ...@@ -58,5 +58,35 @@ describe('ActsAbilityRunningInfosTest', function () {
done(); done();
}) })
}) })
/*
* @tc.number: ACTS_getProcessRunningInformation_0300
* @tc.name: Application running ability information query
* @tc.desc: Verify applications are started to query getProcessRunningInformation ability information
* (by promise)
*/
it('ACTS_getProcessRunningInformation_0300', 0, async function (done) {
console.log('ACTS_getProcessRunningInformation_0300====<begin');
var data = await appManager.getProcessRunningInformation()
console.info('====> ACTS_getProcessRunningInformation_0300 ====>' + JSON.stringify(data))
expect(checkRunningProcess('com.example.abilityrunninginfostest', data)).assertTrue();
done();
})
/*
* @tc.number: ACTS_getProcessRunningInformation_0400
* @tc.name: Application running ability information query
* @tc.desc: Verify applications are started to query getProcessRunningInformation ability information
* (by callback)
*/
it('ACTS_getProcessRunningInformation_0400', 0, async function (done) {
console.log('ACTS_getProcessRunningInformation_0400====<begin');
appManager.getProcessRunningInformation((err, data) => {
console.info('====> ACTS_getProcessRunningInformation_0400 ====>' + JSON.stringify(data))
expect(checkRunningProcess('com.example.abilityrunninginfostest', data)).assertTrue();
done();
})
})
}) })
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册