提交 000b1d0c 编写于 作者: X xinxin13

fix formswithoutpermtest

Signed-off-by: Nxinxin13 <xinxin13@huawei.com>
上级 470eed18
......@@ -102,10 +102,6 @@
{
"name": "ohos.permission.CLEAN_BACKGROUND_PROCESSES",
"reason": "need use ohos.permission.CLEAN_BACKGROUND_PROCESSES"
},
{
"name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED",
"reason": "need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
}
],
"js": [
......
......@@ -17,7 +17,7 @@ import formHost from '@ohos.application.formHost';
import { describe, expect, it } from '@ohos/hypium'
export const getAllFormsInfoTest = (describeName, filterParameter) => {
const ERR_OK_CODE = 0;
const ERR_OK_CODE = 2;
const ERR_OK = `success`;
describe(`${describeName}`, () => {
......@@ -35,7 +35,7 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => {
try {
formHost.getAllFormsInfo((error, data) => {
console.log(`${callbackName} getAllFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`);
expect(Array.isArray(data)).assertEqual(true);
expect(JSON.stringify(data)).assertEqual(undefined);
expect(error.code).assertEqual(ERR_OK_CODE);
done();
console.log(`==========${callbackName} ${describeName} end==========`);
......@@ -58,13 +58,13 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => {
try {
const data = await formHost.getAllFormsInfo();
console.log(`${promiseName} getAllFormsInfo data: ${JSON.stringify(data)}`);
expect(Array.isArray(data)).assertEqual(true);
expect().assertFail();
done();
console.log(`==========${promiseName} ${describeName} end==========`);
} catch (error) {
console.log(`${promiseName} exception caught: ${JSON.stringify(error)})`);
console.log(`${promiseName} should not reach here`);
expect().assertFail();
expect(error.code).assertEqual(ERR_OK_CODE);
done()
}
});
......
......@@ -17,8 +17,8 @@ import formHost from '@ohos.application.formHost';
import { describe, expect, it } from '@ohos/hypium'
export const getFormsInfoTest = (describeName, filterParameter) => {
const ERR_PERMISSION_DENY_CODE = 5;
const ERR_PERMISSION_DENY = `failed to obtain the bundle information`;
const ERR_PERMISSION_DENY_CODE = 2;
const ERR_PERMISSION_DENY = `does not have permission to use forms`;
describe(`${describeName}`, () => {
const callbackName = `FMS_getFormsInfo_Callback_0800`;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册