提交 7add6e99 编写于 作者: O openharmony_ci 提交者: Gitee

!1119 Bms xts update

Merge pull request !1119 from blackleon/master_1118
...@@ -91,7 +91,9 @@ describe('ActsBmsKitTest', function () { ...@@ -91,7 +91,9 @@ describe('ActsBmsKitTest', function () {
it('ActsBmsKit_getAllShortcutInfo_0200', 0, async function (done) { it('ActsBmsKit_getAllShortcutInfo_0200', 0, async function (done) {
console.info('=====================ActsBmsKit_getAllShortcutInfo_0200=================='); console.info('=====================ActsBmsKit_getAllShortcutInfo_0200==================');
var bundleName = 'com.example.third1'; var bundleName = 'com.example.third1';
for (let count = 0; count < STRESSLEVEL; count++) { let flag = true;
let count = 0;
for (let i = 0; i < STRESSLEVEL; i++) {
bundle.getAllShortcutInfo(bundleName, async (err, data) => { bundle.getAllShortcutInfo(bundleName, async (err, data) => {
expect(data.length).assertEqual(1); expect(data.length).assertEqual(1);
expect(err.code).assertEqual(0); expect(err.code).assertEqual(0);
...@@ -101,9 +103,14 @@ describe('ActsBmsKitTest', function () { ...@@ -101,9 +103,14 @@ describe('ActsBmsKitTest', function () {
} else if (err.code != 0) { } else if (err.code != 0) {
console.log('call function level is: ' + count); console.log('call function level is: ' + count);
expect().assertFail(); expect().assertFail();
done(); flag = false;
} }
count++;
}) })
if (!flag) {
done();
break;
}
} }
}) })
...@@ -132,8 +139,10 @@ describe('ActsBmsKitTest', function () { ...@@ -132,8 +139,10 @@ describe('ActsBmsKitTest', function () {
*/ */
it('ActsBmsKit_checkPermission_0200', 0, async function (done) { it('ActsBmsKit_checkPermission_0200', 0, async function (done) {
console.info('=====================ActsBmsKit_checkPermission_0200=================='); console.info('=====================ActsBmsKit_checkPermission_0200==================');
for (let count = 0; count < STRESSLEVEL; count++) { let flag = true;
await bundle.checkPermission(BUNDLE_NAME, PERMISSION_NAME, (err, data) => { let count = 0;
for (let i = 0; i < STRESSLEVEL; i++) {
bundle.checkPermission(BUNDLE_NAME, PERMISSION_NAME, (err, data) => {
expect(err.code).assertEqual(0); expect(err.code).assertEqual(0);
expect(data).assertEqual(0); expect(data).assertEqual(0);
console.log('checkPermission is granted: ' + data); console.log('checkPermission is granted: ' + data);
...@@ -142,9 +151,14 @@ describe('ActsBmsKitTest', function () { ...@@ -142,9 +151,14 @@ describe('ActsBmsKitTest', function () {
} else if (err.code != 0 || data != 0) { } else if (err.code != 0 || data != 0) {
console.log('call function level is: ' + count); console.log('call function level is: ' + count);
expect().assertFail(); expect().assertFail();
done(); flag = false;
} }
count++;
}) })
if (!flag) {
done();
break;
}
} }
}) })
...@@ -178,6 +192,7 @@ describe('ActsBmsKitTest', function () { ...@@ -178,6 +192,7 @@ describe('ActsBmsKitTest', function () {
console.debug('=====================ActsBmsKit_getModuleUsageRecordTest_0200=================='); console.debug('=====================ActsBmsKit_getModuleUsageRecordTest_0200==================');
var bundleName = 'com.example.third1'; var bundleName = 'com.example.third1';
let count = 0; let count = 0;
let flag = true;
for (let i = 0; i < STRESSLEVEL; i++) { for (let i = 0; i < STRESSLEVEL; i++) {
bundle.getModuleUsageRecords(50, (err, data) => { bundle.getModuleUsageRecords(50, (err, data) => {
expect(err.code).assertEqual(0); expect(err.code).assertEqual(0);
...@@ -189,10 +204,14 @@ describe('ActsBmsKitTest', function () { ...@@ -189,10 +204,14 @@ describe('ActsBmsKitTest', function () {
} else if (err.code != 0) { } else if (err.code != 0) {
console.log('call function level is: ' + count); console.log('call function level is: ' + count);
expect().assertFail(); expect().assertFail();
done(); flag = false;
} }
count++; count++;
}); });
if (!flag) {
done();
break;
}
} }
}) })
function checkModuleUsageRecord(data, caseName) { function checkModuleUsageRecord(data, caseName) {
......
...@@ -24,7 +24,7 @@ const BUNDLE_NAME = 'com.example.third1'; ...@@ -24,7 +24,7 @@ const BUNDLE_NAME = 'com.example.third1';
const NUM_TWO = 2; const NUM_TWO = 2;
const NUM_TEN = 10; const NUM_TEN = 10;
const INVALID_NUM = -1; const INVALID_NUM = -1;
const START_ABILITY_TIMEOUT = 3000; const START_ABILITY_TIMEOUT = 5000;
const START_RECORD = 900; const START_RECORD = 900;
const TIMEOUT = 3000; const TIMEOUT = 3000;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册