提交 ea918f5b 编写于 作者: Y yangpeng85

remove some useless testcase for Camera XTS

Signed-off-by: Nyangpeng85 <yangpeng85@huawei.com>
上级 57f23b20
......@@ -2,7 +2,7 @@
"description": "Configuration for camerastandard Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "1000000",
"test-timeout": "1500000",
"package": "com.open.harmony.multimedia.cameratest",
"shell-timeout": "60000"
},
......
......@@ -296,35 +296,6 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
done();
})
/**
* @tc.number : CREATE_CAMERA_INPUT
* @tc.name : Create camerainput from camera-1 cameraId async api
* @tc.desc : Create camerainput from camera-1 cameraId async api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
// it('PA_CREATE_CAMERA_INPUT_02', 0, async function (done) {
// cameraManager.createCameraInput(camerasArray[1].cameraId, async (err, data) => {
// if (!err) {
// if (data != null && data != undefined) {
// console.info(TAG + "Entering CREATE_CAMERA_INPUT data is not null || undefined");
// camera1Input = data;
// expect(true).assertTrue();
// console.info(TAG + "Entering CREATE_CAMERA_INPUT PASSED with CameraID :" + camerasArray[1].cameraId);
// }
// } else {
// expect().assertFail();
// console.info(TAG + "Entering CREATE_CAMERA_INPUT FAILED: " + err.message);
// }
// console.info(TAG + "Entering CREATE_CAMERA_INPUT ends here");
// await sleep(1000);
// done();
// })
// await sleep(1000);
// done();
// })
/**
* @tc.number : CAMERA_INPUT_CALLBACK_ON_ERROR
* @tc.name : Photo output callback on error api
......@@ -588,40 +559,6 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
}
})
/**
* @tc.number : ADD_INPUT_SUCCESS
* @tc.name : Add Input with camera1Input api
* @tc.desc : Add Input with camera1Input api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
// it('PA_ADD_INPUT_SUCCESS', 0, async function (done) {
// if (captureSession == null || captureSession == undefined) {
// console.info(TAG + "Entering Addinput captureSession == null || undefined");
// } else {
// console.info(TAG + "Entering ADD_INPUT_SUCCESS to operate");
// captureSession.addInput(camera1Input, async (err, data) => {
// if (!err) {
// console.info(TAG + "Entering AddInput success");
// if (data != null || data != undefined) {
// console.info(TAG + "Entering AddInput data is not null || undefined");
// expect(true).assertTrue();
// console.info(TAG + "Entering ADD_INPUT_SUCCESS addInput PASSED");
// }
// } else {
// expect().assertFail();
// console.info(TAG + "Entering ADD_INPUT_SUCCESS FAILED: " + err.message);
// console.info(TAG + "Entering ADD_INPUT_SUCCESS ends here");
// }
// await sleep(1000);
// done();
// })
// await sleep(1000);
// done();
// }
// })
/**
* @tc.number : ADD_OUTPUT_PREVIEW_SUCCESS
* @tc.name : Add output with camera0Input api
......@@ -718,40 +655,6 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
}
})
/**
* @tc.number : COMMIT_CONFIG_SUCCESS
* @tc.name : commit config api
* @tc.desc : commit config api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
// it('PA_COMMIT_CONFIG_SUCCESS_01', 0, async function (done) {
// if (captureSession == null || captureSession == undefined) {
// console.info(TAG + "Entering CommitConfig captureSession == null || undefined");
// } else {
// console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS to operate");
// captureSession.commitConfig(async (err, data) => {
// if (!err) {
// console.info(TAG + "Entering commitConfig success");
// if (data != null || data != undefined) {
// console.info(TAG + "Entering CommitConfig data is not null || undefined");
// expect(true).assertTrue();
// console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS PASSED");
// }
// } else {
// expect().assertFail();
// console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS FAILED : " + err.message);
// console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS ends here");
// }
// await sleep(1000);
// done();
// })
// await sleep(1000);
// done();
// }
// })
/**
* @tc.number : isMirrorSupported_PHOTO_OUTPUT
* @tc.name : isMirrorSupported
......@@ -839,73 +742,6 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
}
})
/*CaptureSession APIs*/
/**
* @tc.number : BEGIN_CONFIG_SUCCESS
* @tc.name : CaptureSession_Begin config api
* @tc.desc : CaptureSession_Begin config api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
// it('PA_BEGIN_CONFIG_SUCCESS_02', 0, async function (done) {
// if (captureSession == null || captureSession == undefined) {
// console.info(TAG + "Entering BeginConfig captureSession == null || undefined");
// } else {
// console.info(TAG + "Entering BEGIN_CONFIG_SUCCESS to operate");
// captureSession.beginConfig(async (err, data) => {
// if (!err) {
// console.info(TAG + "Entering beginConfig success");
// if (data != null || data != undefined) {
// console.info(TAG + "Entering BeginConfig data is not null || undefined");
// expect(true).assertTrue();
// console.info(TAG + "Entering BEGIN_CONFIG_SUCCESS beginConfig PASSED");
// }
// } else {
// expect().assertFail();
// console.info(TAG + "Entering BEGIN_CONFIG_SUCCESS FAILED : " + err.message);
// console.info(TAG + "Entering BEGIN_CONFIG_SUCCESS ends here");
// }
// await sleep(1000);
// done();
// })
// await sleep(1000);
// done();
// }
// })
/**
* @tc.number : REMOVE_INPUT_SUCCESS
* @tc.name : remove input api
* @tc.desc : remove input api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
// it('PA_REMOVE_INPUT_SUCCESS', 0, async function (done) {
// if (captureSession == null || captureSession == undefined) {
// console.info(TAG + "Entering REMOVE_INPUT_SUCCESS captureSession == null || undefined");
// } else {
// console.info(TAG + "Entering REMOVE_INPUT_SUCCESS to operate");
// captureSession.removeInput(camera1Input, async (err, data) => {
// if (!err) {
// console.info(TAG + "Entering remove input success");
// expect(true).assertTrue();
// console.info(TAG + "Entering REMOVE_INPUT_SUCCESS PASSED");
// }
// else {
// expect().assertFail();
// console.info(TAG + "Entering Remove Input FAILED" + err.message);
// console.info(TAG + "Entering Remove Input ends here");
// }
// await sleep(1000);
// done();
// })
// await sleep(1000);
// }
// done();
// })
/**
* @tc.number : ADD_INPUT_SUCCESS
* @tc.name : Add Input with camera0Input api
......@@ -1953,171 +1789,6 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
done();
})
/**
* @tc.number : SET_GET_ZOOM_2_ASYNC
* @tc.name : Zoom camera-0 cameraId api
* @tc.desc : Zoom camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
// it('PA_SET_GET_ZOOM_2_ASYNC', 0, async function (done) {
// camera0Input.setZoomRatio(2, (err, data) => {
// if (!err) {
// console.info(TAG + "setZoomRatio success: 2");
// console.info(TAG + "getZoomRatio called")
// camera0Input.getZoomRatio((err, data1) => {
// if (!err) {
// console.info(TAG + "getZoomRatio success : " + data1);
// expect(data1).assertEqual(2);
// console.info(TAG + "SET_GET_ZOOM_2_ASYNC PASSED ");
// }
// else {
// expect().assertFail();
// console.info(TAG + "GET_ZOOM_2_ASYNC FAILED" + err.message);
// }
// })
// } else {
// expect().assertFail();
// console.info(TAG + "SET_ZOOM_2_ASYNC FAILED" + err.message);
// }
// })
// await sleep(1000);
// done();
// })
/**
* @tc.number : SET_GET_ZOOM_3_ASYNC
* @tc.name : Zoom camera-0 cameraId api
* @tc.desc : Zoom camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
// it('PA_SET_GET_ZOOM_3_ASYNC', 0, async function (done) {
// camera0Input.setZoomRatio(3, (err, data) => {
// if (!err) {
// console.info(TAG + "setZoomRatio success: 3");
// console.info(TAG + "getZoomRatio called")
// camera0Input.getZoomRatio((err, data1) => {
// if (!err) {
// console.info(TAG + "getZoomRatio success : " + data1);
// expect(data1).assertEqual(3);
// console.info(TAG + "SET_GET_ZOOM_3_ASYNC PASSED ");
// }
// else {
// console.info(TAG + "GET_ZOOM_3_ASYNC FAILED" + err.message);
// expect().assertFail();
// }
// })
// } else {
// console.info(TAG + "SET_ZOOM_3_ASYNC FAILED" + err.message);
// expect().assertFail();
// }
// })
// await sleep(1000);
// done();
// })
/**
* @tc.number : SET_GET_ZOOM_4_ASYNC
* @tc.name : Zoom camera-0 cameraId api
* @tc.desc : Zoom camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
// it('PA_SET_GET_ZOOM_4_ASYNC', 0, async function (done) {
// camera0Input.setZoomRatio(4, (err, data) => {
// if (!err) {
// console.info(TAG + "setZoomRatio success: 4");
// console.info(TAG + "getZoomRatio called")
// camera0Input.getZoomRatio((err, data1) => {
// if (!err) {
// console.info(TAG + "getZoomRatio success : " + data1);
// expect(data1).assertEqual(4);
// console.info(TAG + "SET_GET_ZOOM_4_ASYNC PASSED ");
// }
// else {
// console.info(TAG + "GET_ZOOM_4_ASYNC FAILED" + err.message);
// expect().assertFail();
// }
// })
// } else {
// console.info(TAG + "SET_ZOOM_4_ASYNC FAILED" + err.message);
// expect().assertFail();
// }
// })
// await sleep(1000);
// done();
// })
/**
* @tc.number : SET_GET_ZOOM_5_ASYNC
* @tc.name : Zoom camera-0 cameraId api
* @tc.desc : Zoom camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
// it('PA_SET_GET_ZOOM_5_ASYNC', 0, async function (done) {
// camera0Input.setZoomRatio(5, (err, data) => {
// if (!err) {
// console.info(TAG + "setZoomRatio success: 5");
// console.info(TAG + "getZoomRatio called")
// camera0Input.getZoomRatio((err, data1) => {
// if (!err) {
// console.info(TAG + "getZoomRatio success : " + data1);
// expect(data1).assertEqual(5);
// console.info(TAG + "SET_GET_ZOOM_5_ASYNC PASSED ");
// }
// else {
// console.info(TAG + "GET_ZOOM_5_ASYNC FAILED" + err.message);
// expect().assertFail();
// }
// })
// } else {
// console.info(TAG + "SET_ZOOM_5_ASYNC FAILED" + err.message);
// expect().assertFail();
// }
// })
// await sleep(1000);
// done();
// })
/**
* @tc.number : SET_GET_ZOOM_6_ASYNC
* @tc.name : Zoom camera-0 cameraId api
* @tc.desc : Zoom camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
// it('PA_SET_GET_ZOOM_6_ASYNC', 0, async function (done) {
// camera0Input.setZoomRatio(6, (err, data) => {
// if (!err) {
// console.info(TAG + "setZoomRatio success: 6");
// console.info(TAG + "getZoomRatio called")
// camera0Input.getZoomRatio((err, data1) => {
// if (!err) {
// console.info(TAG + "getZoomRatio success : " + data1);
// expect(data1).assertEqual(6);
// console.info(TAG + "SET_GET_ZOOM_6_ASYNC PASSED ");
// }
// else {
// console.info(TAG + "GET_ZOOM_6_ASYNC FAILED" + err.message);
// expect().assertFail();
// }
// })
// } else {
// console.info(TAG + "SET_ZOOM_6_ASYNC FAILED" + err.message);
// expect().assertFail();
// }
// })
// await sleep(1000);
// done();
// })
/**
* @tc.number : IS_FOCUS_MODE_LOCKED_SUPPORTED
* @tc.name : check if focus mode locked is supported-camera0Input api
......@@ -2773,68 +2444,6 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
}
})
/**
* @tc.number : IS_EXPOSURE_MODE_LOCKED_SUPPORTED
* @tc.name : check if exposure mode locked is supported-camera0Input api
* @tc.desc : check if exposure mode locked is supported-camera0Input api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
/* EXPOSUREMODE Interface will be change
it('PA_IS_EXPOSURE_MODE_LOCKED_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering IS_EXPOSURE_MODE_LOCKED_SUPPORTED to operate");
camera0Input.isExposureModeSupported(cameraObj.ExposureMode.EXPOSURE_MODE_LOCKED, async (err, data) => {
if (!err) {
console.info(TAG + "Entering Is Exposure Mode Locked supported SUCCESS ");
if (data != null || data != undefined) {
console.info(TAG + "Entering Is Exposure Mode Locked supported data is not null || undefined");
console.info(TAG + "Exposure_Mode_Locked_Supported is: " + data);
expect(data).assertEqual(false);
console.info(TAG + "Entering IS_EXPOSURE_MODE_LOCKED_SUPPORTED PASSED: ");
}
} else {
console.info(TAG + "IS_EXPOSURE_MODE_LOCKED_SUPPORTED FAILED : " + err.message);
expect().assertFail();
console.info(TAG + "IS_EXPOSURE_MODE_LOCKED_SUPPORTED ends here");
}
await sleep(1000);
done();
})
await sleep(1000);
done();
})
*/
/**
* @tc.number : SET_EXPOSURE_MODE_LOCKED
* @tc.name : set exposure mode locked camera0 api
* @tc.desc : set exposure mode locked camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
/* EXPOSUREMODE Interface will be change
it('PA_SET_EXPOSURE_MODE_LOCKED', 0, async function (done) {
console.info(TAG + "Entering SET_EXPOSURE_MODE_LOCKED to operate");
camera0Input.setExposureMode(cameraObj.ExposureMode.EXPOSURE_MODE_LOCKED, async (err, data) => {
if (!err) {
console.info(TAG + "Entering Set Exposure Mode Locked, current ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_LOCKED);
console.info(TAG + "Entering SET_EXPOSURE_MODE_LOCKED FAILED")
expect().AssertFail();
} else {
console.info(TAG + "Entering SET_EXPOSURE_MODE_LOCKED PASSED : " + err.message);
expect(true).assertTrue();
console.info(TAG + "Entering SET_EXPOSURE_MODE_LOCKED ends here");
}
await sleep(1000);
done();
})
await sleep(1000);
done();
})
*/
/**
* @tc.number : GET_EXPOSURE_MODE_LOCKED
* @tc.name : get exposure mode locked camera0 api
......@@ -2863,68 +2472,6 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
done();
})
/**
* @tc.number : IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED
* @tc.name : check if exposure mode continuous auto is supported-camera0Input api
* @tc.desc : check if exposure mode continuous auto is supported-camera0Input api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
/* EXPOSUREMODE Interface will be change
it('PA_IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED to operate");
camera0Input.isExposureModeSupported(cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO, async (err, data) => {
if (!err) {
console.info(TAG + "Entering Is Exposure Mode continuous Auto supported SUCCESS ");
if (data != null || data != undefined) {
console.info(TAG + "Entering Is Exposure Mode continuous Auto supported data is not null || undefined");
console.info(TAG + "Exposure_Mode_continuous_Auto_Supported is: " + data);
expect(data).assertEqual(false);
console.info(TAG + "Entering IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED PASSED: ");
}
} else {
console.info(TAG + "IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED FAILED : " + err.message);
expect().assertFail();
console.info(TAG + "IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED ends here");
}
await sleep(1000);
done();
})
await sleep(1000);
done();
})
*/
/**
* @tc.number : SET_EXPOSURE_MODE_CONTINUOUS_AUTO
* @tc.name : set exposure mode continuous auto camera0 api
* @tc.desc : set exposure mode continuous auto camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
/* EXPOSUREMODE Interface will be change
it('PA_SET_EXPOSURE_MODE_CONTINUOUS_AUTO', 0, async function (done) {
console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO to operate");
camera0Input.setExposureMode(cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO, async (err, data) => {
if (!err) {
console.info(TAG + "Entering Set Exposure Mode continuous auto,current ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO);
console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO FAILED")
expect().AssertFail();
} else {
console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO PASSED : " + err.message);
expect(true).assertTrue();
console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO ends here");
}
await sleep(1000);
done();
})
await sleep(1000);
done();
})
*/
/**
* @tc.number : GET_EXPOSURE_MODE_CONTINUOUS_AUTO
* @tc.name : get exposure mode continuous auto camera0 api
......@@ -3094,102 +2641,6 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
done();
})
/**
* @tc.number : IS_EXPOSURE_MODE_AUTO_SUPPORTED
* @tc.name : check if exposure mode auto is supported-camera0Input api
* @tc.desc : check if exposure mode auto is supported-camera0Input api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
/* EXPOSUREMODE Interface will be change
it('PA_IS_EXPOSURE_MODE_AUTO_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering IS_EXPOSURE_MODE_AUTO_SUPPORTED to operate");
camera0Input.isExposureModeSupported(cameraObj.ExposureMode.EXPOSURE_MODE_AUTO, async (err, data) => {
if (!err) {
console.info(TAG + "Entering Is Exposure Mode Auto supported SUCCESS ");
if (data != null || data != undefined) {
console.info(TAG + "Entering Is Exposure Mode Auto supported data is not null || undefined");
console.info(TAG + "Exposure_Mode_Auto_Supported is: " + data);
expect(data).assertEqual(true);
console.info(TAG + "Entering IS_EXPOSURE_MODE_AUTO_SUPPORTED PASSED: ");
}
} else {
console.info(TAG + "IS_EXPOSURE_MODE_AUTO_SUPPORTED FAILED : " + err.message);
expect().assertFail();
console.info(TAG + "IS_EXPOSURE_MODE_AUTO_SUPPORTED ends here");
}
await sleep(1000);
done();
})
await sleep(1000);
done();
})
*/
/**
* @tc.number : SET_EXPOSURE_MODE_AUTO
* @tc.name : set exposure mode auto camera0 api
* @tc.desc : set exposure mode auto camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
/* EXPOSUREMODE Interface will be change
it('PA_SET_EXPOSURE_MODE_AUTO', 0, async function (done) {
console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO to operate");
camera0Input.setExposureMode(cameraObj.ExposureMode.EXPOSURE_MODE_AUTO, async (err, data) => {
if (!err) {
console.info(TAG + "Entering Set Exposure Mode auto,current ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_AUTO);
if (data != null || data != undefined) {
expect(cameraObj.ExposureMode.EXPOSURE_MODE_AUTO).assertEqual(1);
console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO PASSED")
}
} else {
console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO FAILED : " + err.message);
expect().assertFail();
console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO ends here");
}
await sleep(1000);
done();
})
await sleep(1000);
done();
})
*/
/**
* @tc.number : GET_EXPOSURE_MODE_AUTO
* @tc.name : get exposure mode auto camera0 api
* @tc.desc : get exposure mode auto camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
/* EXPOSUREMODE Interface will be change
it('PA_GET_EXPOSURE_MODE_AUTO', 0, async function (done) {
console.info(TAG + "Entering GET_EXPOSURE_MODE_AUTO to operate");
camera0Input.getExposureMode(async (err, data) => {
if (!err) {
console.info(TAG + "Entering Get Exposure Mode SUCCESS");
console.info(TAG + "Get Exposure Mode data is not null || undefined: ");
console.info(TAG + "Current ExposureMode is: " + data);
expect(data).assertEqual(1);
console.info(TAG + "GET_EXPOSURE_MODE_AUTO PASSED");
}
else {
expect().assertFail();
console.info(TAG + "GET_EXPOSURE_MODE_AUTO FAILED : " + err.message);
console.info(TAG + "GET_EXPOSURE_MODE_AUTO ends here");
}
await sleep(1000);
done();
})
await sleep(1000);
done();
})
*/
/**
* @tc.number : PHOTOOUTPUT_CAPTURE
* @tc.name : Photo output capture without photosettings api
......
......@@ -583,6 +583,8 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
let CaptureSessionPromise = await cameraObj.createCaptureSession(null);
await CaptureSessionPromise.beginConfig();
console.info(TAG + "Entering ADD_INPUT_PROMISE to operate");
try {
await CaptureSessionPromise.addInput(camera1InputPromise);
......@@ -693,59 +695,6 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
done();
})
/**
* @tc.number : COMMIT_CONFIG_SUCCESS
* @tc.name : commit config api
* @tc.desc : commit config api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
// it('PP_COMMIT_CONFIG_SUCCESS_0', 0, async function (done) {
// //创建会话
// let CaptureSessionPromise = await cameraObj.createCaptureSession(null);
// // 开始配置会话
// await CaptureSessionPromise.beginConfig();
// let cameraManager = await cameraObj.getCameraManager(null);
// // 获取相机列表
// let cameraArray = await cameraManager.getCameras();
// // 创建相机输入流
// let cameraInput = await cameraManager.createCameraInput(cameraArray[0].cameraId);
// // 创建预览输出流
// let previewOutput = await cameraObj.createPreviewOutput(surfaceId);
// // 创建ImageReceiver对象,并设置照片参数
// let imageReceiver = await image.createImageReceiver(640, 480, 4, 8);
// // 获取照片显示SurfaceId
// let photoSurfaceId = await imageReceiver.getReceivingSurfaceId();
// // 创建拍照输出流
// let photoOutput = await cameraObj.createPhotoOutput((photoSurfaceId));
// // 向会话中添加相机输入流
// await CaptureSessionPromise.addInput(cameraInput);
// // 向会话中添加预览输入流
// await CaptureSessionPromise.addOutput(previewOutput);
// // 向会话中添加拍照输出流
// await CaptureSessionPromise.addOutput(photoOutput);
// try {
// console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS to operate");
// await CaptureSessionPromise.commitConfig();
// console.info(TAG + "Entering commit config commitConfig success");
// expect(true).assertTrue();
// console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig PASSED");
// } catch(err) {
// expect().assertFail();
// console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig FAILED : ");
// console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig ends here");
// }
// await sleep(1000);
// done();
// })
/**
* @tc.number : isMirrorSupported_PHOTO_OUTPUT
* @tc.name : isMirrorSupported
......@@ -871,6 +820,27 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.level : Level 0
*/
it('PP_REMOVE_INPUT_SUCCESS', 0, async function (done) {
let cameraManager = await cameraObj.getCameraManager(null);
// 获取相机列表
let cameraArray = await cameraManager.getCameras();
for(let cameraIndex = 0; cameraIndex < cameraArray.length; cameraIndex++) {
console.log(TAG +'cameraId : ' + cameraArray[cameraIndex].cameraId) // 获取相机ID
console.log(TAG +'cameraPosition : ' + cameraArray[cameraIndex].cameraPosition) // 获取相机位置
console.log(TAG +'cameraType : ' + cameraArray[cameraIndex].cameraType) // 获取相机类型
console.log(TAG +'connectionType : ' + cameraArray[cameraIndex].connectionType) // 获取相机连接类型
}
// 创建相机输入流
camera1InputPromise = await cameraManager.createCameraInput(cameraArray[0].cameraId);
let CaptureSessionPromise = await cameraObj.createCaptureSession(null);
await CaptureSessionPromise.beginConfig();
await CaptureSessionPromise.addInput(camera1InputPromise);
try {
console.info(TAG + "Entering REMOVE_INPUT_SUCCESS to operate");
await CaptureSessionPromise.removeInput(camera1InputPromise);
......@@ -1010,37 +980,6 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
done();
})
/**
* @tc.number : COMMIT_CONFIG_SUCCESS
* @tc.name : commit config api
* @tc.desc : commit config api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('PP_COMMIT_CONFIG_SUCCESS_1', 0, async function (done) {
if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) {
console.info(TAG + "Entering commit config captureSession == null || undefined");
} else {
console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS to operate");
const promise = await CaptureSessionPromise.commitConfig();
console.info(TAG + "Entering commit config commitConfig success");
if (promise == undefined) {
expect(true).assertTrue();
console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig PASSED");
}
else {
expect().assertFail();
console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig FAILED : ");
console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig ends here");
}
await sleep(1000);
done();
}
await sleep(1000);
done();
})
/**
* @tc.number : FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT
* @tc.name : FocusStateChange callback api
......@@ -1267,32 +1206,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
done();
}
})
/**
* @tc.number : CAPTURE_SESSION_START_SUCCESS
* @tc.name : capture session start api
* @tc.desc : capture session start api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('PP_CAPTURE_SESSION_START_SUCCESS', 0, async function (done) {
if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) {
console.info(TAG + "Entering capture session start captureSession == null || undefined");
} else {
console.info(TAG + "Entering CAPTURE_SESSION_START_SUCCESS to operate");
await CaptureSessionPromise.start();
console.info(TAG + "Entering captureSession start success");
expect(true).assertTrue();
console.info(TAG + "Entering CAPTURE_SESSION_START_SUCCESS PASSED");
console.info(TAG + "Entering CAPTURE_SESSION_START_SUCCESS ends here");
await sleep(1000);
done();
}
await sleep(1000);
done();
})
//Location
/**
* @tc.number : PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS
......@@ -1303,28 +1217,66 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.level : Level 0
*/
it('PP_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS', 0, async function (done) {
if (photoOutputPromise == null || photoOutputPromise == undefined) {
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS photoOutput == null || undefined");
} else {
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS to operate");
photoOutputPromise.capture(async (err, data) => {
if (!err) {
console.info(TAG + "Entering photoOutput capture without photosettings success");
if (data != null || data != undefined) {
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS PASSED");
expect(true).assertTrue();
}
} else {
expect().assertFail();
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS FAILED : " + err.message);
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS ends here");
}
await sleep(1000);
done();
let captureSession = await cameraObj.createCaptureSession(null);
// 开始配置会话
await captureSession.beginConfig();
let cameraManager = await cameraObj.getCameraManager(null);
// // 注册回调函数监听相机状态变化,获取状态变化的相机信息
// cameraManager.on('cameraStatus', (cameraStatusInfo) => {
// console.log('camera : ' + cameraStatusInfo.camera.cameraId);
// console.log('status: ' + cameraStatusInfo.status);
// })
// 获取相机列表
let cameraArray = await cameraManager.getCameras();
for(let cameraIndex = 0; cameraIndex < cameraArray.length; cameraIndex++) {
console.log(TAG + 'cameraId : ' + cameraArray[cameraIndex].cameraId) // 获取相机ID
console.log(TAG + 'cameraPosition : ' + cameraArray[cameraIndex].cameraPosition) // 获取相机位置
console.log(TAG + 'cameraType : ' + cameraArray[cameraIndex].cameraType) // 获取相机类型
console.log(TAG + 'connectionType : ' + cameraArray[cameraIndex].connectionType) // 获取相机连接类型
}
// 创建相机输入流
let cameraInput = await cameraManager.createCameraInput(cameraArray[0].cameraId);
// 创建预览输出流
let previewOutput = await cameraObj.createPreviewOutput(surfaceId);
// 创建ImageReceiver对象,并设置照片参数
let imageReceiver = await image.createImageReceiver(640, 480, 4, 8);
// 获取照片显示SurfaceId
let photoSurfaceId = await imageReceiver.getReceivingSurfaceId();
// 创建拍照输出流
let photoOutput = await cameraObj.createPhotoOutput((photoSurfaceId));
// 向会话中添加相机输入流
await captureSession.addInput(cameraInput);
// 向会话中添加预览输入流
await captureSession.addOutput(previewOutput);
// 向会话中添加拍照输出流
await captureSession.addOutput(photoOutput);
// 提交会话配置
await captureSession.commitConfig();
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS to operate");
photoOutput.capture()
.then(() => {
expect(true).assertTrue();
console.info(TAG + "Entering photoOutput capture without settings success");
// await sleep(1000);
// done();
})
.catch((err) => {
expect().assertFail();
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS FAILED : " + err.message);
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS ends here");
// await sleep(1000);
// done();
});
await sleep(1000);
done();
}
})
/**
......@@ -1336,27 +1288,59 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.level : Level 0
*/
it('PP_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1', 0, async function (done) {
if (photoOutputPromise == null || photoOutputPromise == undefined) {
console.info(TAG + "Entering Photo output capture with photosettings photoOutput == null || undefined");
} else {
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS to operate");
await photoOutputPromise.capture(photosettings1)
.then(function (data) {
console.info(TAG + "Entering photoOutput capture with settings success");
if (data != null || data != undefined) {
console.info(TAG + "Entering photoOutput capture with photosettings1 data is not null || undefined");
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1 PASSED");
expect(true).assertTrue();
}
})
.catch((err) => {
expect().assertFail();
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1 FAILED:" + err.message);
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1 ends here");
});
await sleep(1000);
done();
let captureSession = await cameraObj.createCaptureSession(null);
// 开始配置会话
await captureSession.beginConfig();
let cameraManager = await cameraObj.getCameraManager(null);
// // 注册回调函数监听相机状态变化,获取状态变化的相机信息
// cameraManager.on('cameraStatus', (cameraStatusInfo) => {
// console.log('camera : ' + cameraStatusInfo.camera.cameraId);
// console.log('status: ' + cameraStatusInfo.status);
// })
// 获取相机列表
let cameraArray = await cameraManager.getCameras();
for(let cameraIndex = 0; cameraIndex < cameraArray.length; cameraIndex++) {
console.log(TAG + 'cameraId : ' + cameraArray[cameraIndex].cameraId) // 获取相机ID
console.log(TAG + 'cameraPosition : ' + cameraArray[cameraIndex].cameraPosition) // 获取相机位置
console.log(TAG + 'cameraType : ' + cameraArray[cameraIndex].cameraType) // 获取相机类型
console.log(TAG + 'connectionType : ' + cameraArray[cameraIndex].connectionType) // 获取相机连接类型
}
// 创建相机输入流
let cameraInput = await cameraManager.createCameraInput(cameraArray[0].cameraId);
// 创建预览输出流
let previewOutput = await cameraObj.createPreviewOutput(surfaceId);
// 创建ImageReceiver对象,并设置照片参数
let imageReceiver = await image.createImageReceiver(640, 480, 4, 8);
// 获取照片显示SurfaceId
let photoSurfaceId = await imageReceiver.getReceivingSurfaceId();
// 创建拍照输出流
let photoOutput = await cameraObj.createPhotoOutput((photoSurfaceId));
// 向会话中添加相机输入流
await captureSession.addInput(cameraInput);
// 向会话中添加预览输入流
await captureSession.addOutput(previewOutput);
// 向会话中添加拍照输出流
await captureSession.addOutput(photoOutput);
// 提交会话配置
await captureSession.commitConfig();
photoOutput.capture(photosettings1)
.then(() => {
expect(true).assertTrue();
console.info(TAG + "Entering photoOutput capture with settings success");
})
.catch((err) => {
expect().assertFail();
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1 FAILED:" + err.message);
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1 ends here");
});
await sleep(1000);
done();
})
......@@ -1370,29 +1354,65 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.level : Level 0
*/
it('PP_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2', 0, async function (done) {
if (photoOutputPromise == null || photoOutputPromise == undefined) {
console.info(TAG + "Entering Photo output capture with photosettings photoOutput == null || undefined");
} else {
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 to operate");
await photoOutputPromise.capture(photosettings2)
.then(function (data) {
console.info(TAG + "Entering photoOutput capture with settings success");
if (data != null || data != undefined) {
console.info(TAG + "Entering photoOutput capture with photosettings2 data is not null || undefined");
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 PASSED");
expect(true).assertTrue();
}
})
.catch((err) => {
expect().assertFail();
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 FAILED:" + err.message);
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 ends here");
});
await sleep(1000);
done();
let captureSession = await cameraObj.createCaptureSession(null);
// 开始配置会话
await captureSession.beginConfig();
let cameraManager = await cameraObj.getCameraManager(null);
// // 注册回调函数监听相机状态变化,获取状态变化的相机信息
// cameraManager.on('cameraStatus', (cameraStatusInfo) => {
// console.log('camera : ' + cameraStatusInfo.camera.cameraId);
// console.log('status: ' + cameraStatusInfo.status);
// })
// 获取相机列表
let cameraArray = await cameraManager.getCameras();
for(let cameraIndex = 0; cameraIndex < cameraArray.length; cameraIndex++) {
console.log(TAG + 'cameraId : ' + cameraArray[cameraIndex].cameraId) // 获取相机ID
console.log(TAG + 'cameraPosition : ' + cameraArray[cameraIndex].cameraPosition) // 获取相机位置
console.log(TAG + 'cameraType : ' + cameraArray[cameraIndex].cameraType) // 获取相机类型
console.log(TAG + 'connectionType : ' + cameraArray[cameraIndex].connectionType) // 获取相机连接类型
}
await sleep(1000);
done();
// 创建相机输入流
let cameraInput = await cameraManager.createCameraInput(cameraArray[0].cameraId);
// 创建预览输出流
let previewOutput = await cameraObj.createPreviewOutput(surfaceId);
// 创建ImageReceiver对象,并设置照片参数
let imageReceiver = await image.createImageReceiver(640, 480, 4, 8);
// 获取照片显示SurfaceId
let photoSurfaceId = await imageReceiver.getReceivingSurfaceId();
// 创建拍照输出流
let photoOutput = await cameraObj.createPhotoOutput((photoSurfaceId));
// 向会话中添加相机输入流
await captureSession.addInput(cameraInput);
// 向会话中添加预览输入流
await captureSession.addOutput(previewOutput);
// 向会话中添加拍照输出流
await captureSession.addOutput(photoOutput);
// 提交会话配置
await captureSession.commitConfig();
photoOutput.capture(photosettings2)
.then(() => {
expect(true).assertTrue();
console.info(TAG + "Entering photoOutput capture with settings success");
// await sleep(1000);
// done();
})
.catch((err) => {
expect().assertFail();
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 FAILED:" + err.message);
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 ends here");
// await sleep(1000);
// done();
});
await sleep(1000);
done();
})
/**
......@@ -1404,29 +1424,64 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.level : Level 0
*/
it('PP_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3', 0, async function (done) {
if (photoOutputPromise == null || photoOutputPromise == undefined) {
console.info(TAG + "Entering Photo output capture with photosettings photoOutput == null || undefined");
} else {
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3 to operate");
await photoOutputPromise.capture(photosettings3)
.then(function (data) {
console.info(TAG + "Entering photoOutput capture with settings success");
if (data != null || data != undefined) {
console.info(TAG + "Entering photoOutput capture with photosettings3 data is not null || undefined");
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3 PASSED");
expect(true).assertTrue();
}
})
.catch((err) => {
expect().assertFail();
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3 :" + err.message);
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3 ends here");
});
await sleep(1000);
done();
let captureSession = await cameraObj.createCaptureSession(null);
// 开始配置会话
await captureSession.beginConfig();
let cameraManager = await cameraObj.getCameraManager(null);
// // 注册回调函数监听相机状态变化,获取状态变化的相机信息
// cameraManager.on('cameraStatus', (cameraStatusInfo) => {
// console.log('camera : ' + cameraStatusInfo.camera.cameraId);
// console.log('status: ' + cameraStatusInfo.status);
// })
// 获取相机列表
let cameraArray = await cameraManager.getCameras();
for(let cameraIndex = 0; cameraIndex < cameraArray.length; cameraIndex++) {
console.log(TAG + 'cameraId : ' + cameraArray[cameraIndex].cameraId) // 获取相机ID
console.log(TAG + 'cameraPosition : ' + cameraArray[cameraIndex].cameraPosition) // 获取相机位置
console.log(TAG + 'cameraType : ' + cameraArray[cameraIndex].cameraType) // 获取相机类型
console.log(TAG + 'connectionType : ' + cameraArray[cameraIndex].connectionType) // 获取相机连接类型
}
await sleep(1000);
done();
// 创建相机输入流
let cameraInput = await cameraManager.createCameraInput(cameraArray[0].cameraId);
// 创建预览输出流
let previewOutput = await cameraObj.createPreviewOutput(surfaceId);
// 创建ImageReceiver对象,并设置照片参数
let imageReceiver = await image.createImageReceiver(640, 480, 4, 8);
// 获取照片显示SurfaceId
let photoSurfaceId = await imageReceiver.getReceivingSurfaceId();
// 创建拍照输出流
let photoOutput = await cameraObj.createPhotoOutput((photoSurfaceId));
// 向会话中添加相机输入流
await captureSession.addInput(cameraInput);
// 向会话中添加预览输入流
await captureSession.addOutput(previewOutput);
// 向会话中添加拍照输出流
await captureSession.addOutput(photoOutput);
// 提交会话配置
await captureSession.commitConfig();
photoOutput.capture(photosettings3)
.then(() => {
expect(true).assertTrue();
console.info(TAG + "Entering photoOutput capture with settings success");
// await sleep(1000);
// done();
})
.catch((err) => {
expect().assertFail();
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3 :" + err.message);
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3 ends here");
// await sleep(1000);
// done();
});
await sleep(1000);
done();
})
/**
......@@ -1438,29 +1493,62 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.level : Level 0
*/
it('PP_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4', 0, async function (done) {
if (photoOutputPromise == null || photoOutputPromise == undefined) {
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined");
} else {
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4 to operate");
await photoOutputPromise.capture(photosettings4)
.then(function (data) {
console.info(TAG + "Entering photoOutput capture with settings success");
if (data != null || data != undefined) {
console.info(TAG + "Entering photoOutput capture with photosettings4 data is not null || undefined");
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4 PASSED");
expect(true).assertTrue();
}
})
.catch((err) => {
expect().assertFail();
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4 FAILED : " + err.message);
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4 ends here");
});
await sleep(1000);
done();
let captureSession = await cameraObj.createCaptureSession(null);
// 开始配置会话
await captureSession.beginConfig();
let cameraManager = await cameraObj.getCameraManager(null);
// // 注册回调函数监听相机状态变化,获取状态变化的相机信息
// cameraManager.on('cameraStatus', (cameraStatusInfo) => {
// console.log('camera : ' + cameraStatusInfo.camera.cameraId);
// console.log('status: ' + cameraStatusInfo.status);
// })
// 获取相机列表
let cameraArray = await cameraManager.getCameras();
for(let cameraIndex = 0; cameraIndex < cameraArray.length; cameraIndex++) {
console.log(TAG + 'cameraId : ' + cameraArray[cameraIndex].cameraId) // 获取相机ID
console.log(TAG + 'cameraPosition : ' + cameraArray[cameraIndex].cameraPosition) // 获取相机位置
console.log(TAG + 'cameraType : ' + cameraArray[cameraIndex].cameraType) // 获取相机类型
console.log(TAG + 'connectionType : ' + cameraArray[cameraIndex].connectionType) // 获取相机连接类型
}
await sleep(1000);
done();
// 创建相机输入流
let cameraInput = await cameraManager.createCameraInput(cameraArray[0].cameraId);
// 创建预览输出流
let previewOutput = await cameraObj.createPreviewOutput(surfaceId);
// 创建ImageReceiver对象,并设置照片参数
let imageReceiver = await image.createImageReceiver(640, 480, 4, 8);
// 获取照片显示SurfaceId
let photoSurfaceId = await imageReceiver.getReceivingSurfaceId();
// 创建拍照输出流
let photoOutput = await cameraObj.createPhotoOutput((photoSurfaceId));
// 向会话中添加相机输入流
await captureSession.addInput(cameraInput);
// 向会话中添加预览输入流
await captureSession.addOutput(previewOutput);
// 向会话中添加拍照输出流
await captureSession.addOutput(photoOutput);
// 提交会话配置
await captureSession.commitConfig();
photoOutput.capture(photosettings4)
.then(async () => {
expect(true).assertTrue();
console.info(TAG + "Entering photoOutput capture with settings success");
await sleep(1000);
done();
})
.catch(async (err) => {
expect().assertFail();
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4 FAILED : " + err.message);
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4 ends here");
await sleep(1000);
done();
});
})
//FLASH Function API scripts
......@@ -1860,136 +1948,6 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
done();
})
/**
* @tc.number : SET_GET_ZOOM_2_PROMISE
* @tc.name : Zoom camera-0 cameraId api
* @tc.desc : Zoom camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
// it('PP_SET_GET_ZOOM_2_PROMISE', 0, async function (done) {
// var setpromise = await camera0InputPromise.setZoomRatio(2);
// console.info(TAG + "setZoomRatio success: 2");
// console.info(TAG + "getZoomRatio called")
// var getpromise2 = await camera0InputPromise.getZoomRatio();
// console.info(TAG + "getZoomRatio success: " + getpromise2);
// if (getpromise2 != null && getpromise2 != undefined) {
// expect(getpromise2).assertEqual(2);
// console.info(TAG + "SET_GET_ZOOM_2_PROMISE PASSED ");
// }
// else {
// console.info(TAG + "SET_GET_ZOOM_2_PROMISE FAILED");
// expect().assertFail();
// }
// await sleep(1000);
// done();
// })
/**
* @tc.number : SET_GET_ZOOM_3_PROMISE
* @tc.name : Zoom camera-0 cameraId api
* @tc.desc : Zoom camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
// it('PP_SET_GET_ZOOM_3_PROMISE', 0, async function (done) {
// var setpromise = await camera0InputPromise.setZoomRatio(3);
// console.info(TAG + "setZoomRatio success: 3");
// console.info(TAG + "getZoomRatio called")
// var getpromise3 = await camera0InputPromise.getZoomRatio();
// console.info(TAG + "getZoomRatio success: " + getpromise3);
// if (getpromise3 != null && getpromise3 != undefined) {
// expect(getpromise3).assertEqual(3);
// console.info(TAG + "SET_GET_ZOOM_3_PROMISE PASSED ");
// }
// else {
// console.info(TAG + "SET_GET_ZOOM_3_PROMISE FAILED");
// expect().assertFail();
// }
// await sleep(1000);
// done();
// })
/**
* @tc.number : SET_GET_ZOOM_4_PROMISE
* @tc.name : Zoom camera-0 cameraId api
* @tc.desc : Zoom camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
// it('PP_SET_GET_ZOOM_4_PROMISE', 0, async function (done) {
// var setpromise = await camera0InputPromise.setZoomRatio(4);
// console.info(TAG + "setZoomRatio success: 4");
// console.info(TAG + "getZoomRatio called")
// var getpromise4 = await camera0InputPromise.getZoomRatio();
// console.info(TAG + "getZoomRatio success: " + getpromise4);
// if (getpromise4 != null && getpromise4 != undefined) {
// expect(getpromise4).assertEqual(4);
// console.info(TAG + "SET_GET_ZOOM_4_PROMISE PASSED ");
// }
// else {
// console.info(TAG + "SET_GET_ZOOM_4_PROMISE FAILED");
// expect().assertFail();
// }
// await sleep(1000);
// done();
// })
/**
* @tc.number : SET_GET_ZOOM_5_PROMISE
* @tc.name : Zoom camera-0 cameraId api
* @tc.desc : Zoom camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
// it('PP_SET_GET_ZOOM_5_PROMISE', 0, async function (done) {
// var setpromise = await camera0InputPromise.setZoomRatio(5);
// console.info(TAG + "setZoomRatio success: 5");
// console.info(TAG + "getZoomRatio called")
// var getpromise5 = await camera0InputPromise.getZoomRatio();
// console.info(TAG + "getZoomRatio success: " + getpromise5);
// if (getpromise5 != null && getpromise5 != undefined) {
// expect(getpromise5).assertEqual(5);
// console.info(TAG + "SET_GET_ZOOM_5_PROMISE PASSED ");
// }
// else {
// console.info(TAG + "SET_GET_ZOOM_5_PROMISE FAILED");
// expect().assertFail();
// }
// await sleep(1000);
// done();
// })
/**
* @tc.number : SET_GET_ZOOM_6_PROMISE
* @tc.name : Zoom camera-0 cameraId api
* @tc.desc : Zoom camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
// it('PP_SET_GET_ZOOM_6_PROMISE', 0, async function (done) {
// var setpromise = await camera0InputPromise.setZoomRatio(6);
// console.info(TAG + "setZoomRatio success: 6");
// console.info(TAG + "getZoomRatio called")
// var getpromise6 = await camera0InputPromise.getZoomRatio();
// console.info(TAG + "getZoomRatio success: " + getpromise6);
// if (getpromise6 != null && getpromise6 != undefined) {
// expect(getpromise6).assertEqual(6);
// console.info(TAG + "SET_GET_ZOOM_6_PROMISE PASSED ");
// }
// else {
// console.info(TAG + "SET_GET_ZOOM_6_PROMISE FAILED");
// expect().assertFail();
// }
// await sleep(1000);
// done();
// })
// FOCUS promise API's
/**
* @tc.number : IS_FOCUS_MODE_LOCKED_SUPPORTED
......@@ -2007,7 +1965,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
expect(true).assertTrue();
console.info(TAG + "is focus mode locked supported : " + isFMLockedSupported);
console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED PASSED");
} catch(err) {
} catch (err) {
expect().assertFail();
console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED FAILED : ");
}
......@@ -2227,39 +2185,6 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
done();
})
/**
* @tc.number : PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS
* @tc.name : Photo output capture without photosettings api
* @tc.desc : Photo output capture without photosettings api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('PP_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS', 0, async function (done) {
if (photoOutputPromise == null || photoOutputPromise == undefined) {
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS photoOutput == null || undefined");
} else {
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS to operate");
photoOutputPromise.capture(async (err, data) => {
if (!err) {
console.info(TAG + "Entering photoOutput capture without photosettings success");
if (data != null || data != undefined) {
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS PASSED");
expect(true).assertTrue();
}
} else {
expect().assertFail();
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS FAILED : " + err.message);
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS ends here");
}
await sleep(1000);
done();
})
await sleep(1000);
done();
}
})
/**
* @tc.number : SET_FOCUS_POINT
* @tc.name : set focus Point camera0 api
......@@ -2398,30 +2323,27 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.type : Function
* @tc.level : Level 0
*/
it('PP_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS', 0, async function (done) {
if (photoOutputPromise == null || photoOutputPromise == undefined) {
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS photoOutput == null || undefined");
} else {
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS to operate");
photoOutputPromise.capture(async (err, data) => {
if (!err) {
console.info(TAG + "Entering photoOutput capture without photosettings success");
if (data != null || data != undefined) {
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS PASSED");
expect(true).assertTrue();
}
} else {
expect().assertFail();
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS FAILED : " + err.message);
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS ends here");
}
await sleep(1000);
done();
})
await sleep(1000);
done();
}
})
// it('PP_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS', 0, async function (done) {
// if (photoOutputPromise == null || photoOutputPromise == undefined) {
// console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS photoOutput == null || undefined");
// } else {
// console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS to operate");
// photoOutputPromise.capture()
// .then(() => {
// expect(true).assertTrue();
// console.info(TAG + "Entering photoOutput capture without settings success");
// await sleep(1000);
// done();
// })
// .catch((err) => {
// expect().assertFail();
// console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS FAILED : " + err.message);
// console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS ends here");
// await sleep(1000);
// done();
// });
// }
// })
/**
* @tc.number : SET_FOCUS_POINT
......@@ -2552,92 +2474,6 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
done();
})
/**
* @tc.number : PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS
* @tc.name : Photo output capture without photosettings api
* @tc.desc : Photo output capture without photosettings api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('PP_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS', 0, async function (done) {
if (photoOutputPromise == null || photoOutputPromise == undefined) {
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS photoOutput == null || undefined");
} else {
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS to operate");
photoOutputPromise.capture(async (err, data) => {
if (!err) {
console.info(TAG + "Entering photoOutput capture without photosettings success");
if (data != null || data != undefined) {
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS PASSED");
expect(true).assertTrue();
}
} else {
expect().assertFail();
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS FAILED : " + err.message);
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS ends here");
}
await sleep(1000);
done();
})
await sleep(1000);
done();
}
})
/**
* @tc.number : IS_EXPOSURE_MODE_LOCKED_SUPPORTED
* @tc.name : check is exposure mode locked supported-camera0Input api
* @tc.desc : check is exposure mode locked supported-camera0Input api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
/* EXPOSUREMODE Interface will be change
it('PP_IS_EXPOSURE_MODE_LOCKED_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering IS_EXPOSURE_MODE_LOCKED_SUPPORTED to operate");
await camera0InputPromise.isExposureModeSupported(cameraObj.ExposureMode.EXPOSURE_MODE_LOCKED)
.then(function (data) {
console.info(TAG + "Entering IS_EXPOSURE_MODE_LOCKED_SUPPORTED PASSED: " + data);
expect(data).assertEqual(false);
})
.catch((err) => {
console.info(TAG + "IS_EXPOSURE_MODE_LOCKED_SUPPORTED FAILED : " + err.message);
expect().assertFail();
});
console.info(TAG + "IS_EXPOSURE_MODE_LOCKED_SUPPORTED ends here");
await sleep(1000);
done();
})
*/
/**
* @tc.number : SET_EXPOSURE_MODE_LOCKED
* @tc.name : set exposure mode locked camera0 api
* @tc.desc : set exposure mode locked camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
/* EXPOSUREMODE Interface will be change
it('PP_SET_EXPOSURE_MODE_LOCKED', 0, async function (done) {
console.info(TAG + "Entering SET_EXPOSURE_MODE_Locked to operate");
await camera0InputPromise.setExposureMode(cameraObj.ExposureMode.EXPOSURE_MODE_LOCKED)
.then(function () {
console.info(TAG + "Entering set exposure mode auto SUCCESS, current ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_LOCKED);
console.info(TAG + "Entering SET_EXPOSURE_MODE_Locked FAILED")
expect().assertFail()
})
.catch((err) => {
console.info(TAG + "Entering SET_EXPOSURE_MODE_LOCKED PASSED : " + err.message);
expect(true).assertTrue();
});
console.info(TAG + "Entering SET_EXPOSURE_MODE_LOCKED ends here");
await sleep(1000);
done();
})
*/
/**
* @tc.number : GET_EXPOSURE_MODE_LOCKED
* @tc.name : get exposure mode locked camera0 api
......@@ -2664,59 +2500,6 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
done();
})
/**
* @tc.number : IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED
* @tc.name : check is exposure mode continuous auto supported-camera0Input api
* @tc.desc : check is exposure mode continuous auto supported-camera0Input api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
/* EXPOSUREMODE Interface will be change
it('PP_IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED to operate");
await camera0InputPromise.isExposureModeSupported(cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO)
.then(function (data) {
console.info(TAG + "Entering IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED PASSED: " + data);
expect(data).assertEqual(false);
})
.catch((err) => {
console.info(TAG + "IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED FAILED : " + err.message);
expect().assertFail();
});
console.info(TAG + "IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED ends here");
await sleep(1000);
done();
})
*/
/**
* @tc.number : SET_EXPOSURE_MODE_CONTINUOUS_AUTO
* @tc.name : set exposure mode continuous auto camera0 api
* @tc.desc : set exposure mode continuous auto camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
/* EXPOSUREMODE Interface will be change
it('PP_SET_EXPOSURE_MODE_CONTINUOUS_AUTO', 0, async function (done) {
console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO to operate");
await camera0InputPromise.setExposureMode(cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO)
.then(function () {
console.info(TAG + "Entering set exposure mode auto SUCCESS, current ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO);
console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO FAILED")
expect().assertFail();
})
.catch((err) => {
console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO PASSED : " + err.message);
expect(true).assertTrue();
});
console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO ends here");
await sleep(1000);
done();
})
*/
/**
* @tc.number : GET_EXPOSURE_MODE_CONTINUOUS_AUTO
* @tc.name : get exposure mode continuous auto camera0 api
......@@ -2871,121 +2654,6 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
done();
})
/**
* @tc.number : IS_EXPOSURE_MODE_AUTO_SUPPORTED
* @tc.name : check is exposure mode auto supported-camera0Input api
* @tc.desc : check is exposure mode auto supported-camera0Input api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
/* EXPOSUREMODE Interface will be change
it('PP_IS_EXPOSURE_MODE_AUTO_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering IS_EXPOSURE_MODE_AUTO_SUPPORTED to operate");
await camera0InputPromise.isExposureModeSupported(cameraObj.ExposureMode.EXPOSURE_MODE_AUTO)
.then(function (data) {
console.info(TAG + "Entering IS_EXPOSURE_MODE_AUTO_SUPPORTED PASSED: " + data);
expect(data).assertEqual(true);
})
.catch((err) => {
console.info(TAG + "IS_EXPOSURE_MODE_AUTO_SUPPORTED FAILED: " + err.message);
expect().assertFail();
});
console.info(TAG + "IS_EXPOSURE_MODE_AUTO_SUPPORTED ends here");
await sleep(1000);
done();
})
*/
/**
* @tc.number : SET_EXPOSURE_MODE_AUTO
* @tc.name : set exposure mode auto camera0 api
* @tc.desc : set exposure mode auto camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
/* EXPOSUREMODE Interface will be change
it('PP_SET_EXPOSURE_MODE_AUTO', 0, async function (done) {
console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO to operate");
await camera0InputPromise.setExposureMode(cameraObj.ExposureMode.EXPOSURE_MODE_AUTO)
.then(function () {
console.info(TAG + "Entering set exposure mode auto SUCCESS, current ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_AUTO);
console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO PASSED")
expect(cameraObj.ExposureMode.EXPOSURE_MODE_AUTO).assertEqual(1);
})
.catch((err) => {
console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO FAILED : " + err.message);
expect().assertFail();
});
console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO ends here");
await sleep(1000);
done();
})
*/
/**
* @tc.number : GET_EXPOSURE_MODE_AUTO
* @tc.name : get exposure mode auto camera0 api
* @tc.desc : get exposure mode auto camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
/* EXPOSUREMODE Interface will be change
it('PP_GET_EXPOSURE_MODE_AUTO', 0, async function (done) {
console.info(TAG + "Entering GET_EXPOSURE_MODE_AUTO to operate");
await camera0InputPromise.getExposureMode()
.then(function (data) {
console.info(TAG + "Entering get exposure mode auto SUCCESS");
console.info(TAG + "Current exposureMode is: " + data);
expect(data).assertEqual(1);
console.info(TAG + "GET_EXPOSURE_MODE_AUTO PASSED");
})
.catch((err) => {
expect().assertFail();
console.info(TAG + "GET_EXPOSURE_MODE_AUTO FAILED: " + err.message);
});
console.info(TAG + "GET_EXPOSURE_MODE_AUTO ends here");
await sleep(1000);
done();
})
*/
/**
* @tc.number : PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS
* @tc.name : Photo output capture without photosettings api
* @tc.desc : Photo output capture without photosettings api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('PP_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS', 0, async function (done) {
if (photoOutputPromise == null || photoOutputPromise == undefined) {
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS photoOutput == null || undefined");
} else {
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS to operate");
photoOutputPromise.capture(async (err, data) => {
if (!err) {
console.info(TAG + "Entering photoOutput capture without photosettings success");
if (data != null || data != undefined) {
console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined");
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS PASSED");
expect(true).assertTrue();
}
} else {
expect().assertFail();
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS FAILED : " + err.message);
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS ends here");
}
await sleep(1000);
done();
})
await sleep(1000);
done();
}
})
/**
* @tc.number : SET_EXPOSURE_BIAS
* @tc.name : set exposure bias camera0 api
......@@ -3088,40 +2756,6 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
done();
})
/**
* @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS Rotation-0 & Quality-0
* @tc.name : Photo output capture with photosettings api
* @tc.desc : Photo output capture with photosettings api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('PP_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1', 0, async function (done) {
if (photoOutputPromise == null || photoOutputPromise == undefined) {
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined");
} else {
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS to operate");
await photoOutputPromise.capture(photosettings1)
.then(function (data) {
console.info(TAG + "Entering photoOutput capture with Rotation-0 & Quality-0 success");
if (data != null || data != undefined) {
console.info(TAG + "Entering photoOutput capture with photosettings1 data is not null || undefined");
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS Rotation-0 & Quality-0 PASSED");
expect(true).assertTrue();
}
})
.catch((err) => {
expect().assertFail();
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS Rotation-0 & Quality-0 FAILED:" + err.message);
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS Rotation-0 & Quality-0 ends here");
});
await sleep(1000);
done();
}
await sleep(1000);
done();
})
/**
* @tc.number : SET_EXPOSURE_BIAS
* @tc.name : set exposure bias camera0 api
......@@ -3224,40 +2858,6 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
done();
})
/**
* @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2
* @tc.name : Photo output capture with photosettings api
* @tc.desc : Photo output capture with photosettings api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('PP_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2', 0, async function (done) {
if (photoOutputPromise == null || photoOutputPromise == undefined) {
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined");
} else {
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS to operate");
await photoOutputPromise.capture(photosettings2)
.then(function (data) {
console.info(TAG + "Entering photoOutput capture with location settings success");
if (data != null || data != undefined) {
console.info(TAG + "Entering photoOutput capture with photosettings2 data is not null || undefined");
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 PASSED");
expect(true).assertTrue();
}
})
.catch((err) => {
expect().assertFail();
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 FAILED : " + err.message);
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 ends here");
});
await sleep(1000);
done();
}
await sleep(1000);
done();
})
/**
* @tc.number : SET_EXPOSURE_BIAS_-5
* @tc.name : set exposure bias camera0 api
......@@ -3370,16 +2970,51 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.level : Level 0
*/
it('PP_CAPTURE_SESSION_STOP_SUCCESS_PROMISE', 0, async function (done) {
if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) {
console.info(TAG + "Entering capture session stop captureSession == null || undefined");
} else {
console.info(TAG + "Entering CAPTURE_SESSION_STOP_SUCCESS_PROMISE to operate");
let cameraManager = await cameraObj.getCameraManager(null);
// 获取相机列表
let cameraArray = await cameraManager.getCameras();
for(let cameraIndex = 0; cameraIndex < cameraArray.length; cameraIndex++) {
console.log(TAG +'cameraId : ' + cameraArray[cameraIndex].cameraId) // 获取相机ID
console.log(TAG +'cameraPosition : ' + cameraArray[cameraIndex].cameraPosition) // 获取相机位置
console.log(TAG +'cameraType : ' + cameraArray[cameraIndex].cameraType) // 获取相机类型
console.log(TAG +'connectionType : ' + cameraArray[cameraIndex].connectionType) // 获取相机连接类型
}
// 创建相机输入流
camera1InputPromise = await cameraManager.createCameraInput(cameraArray[0].cameraId);
let CaptureSessionPromise = await cameraObj.createCaptureSession(null);
await CaptureSessionPromise.beginConfig();
await CaptureSessionPromise.addInput(camera1InputPromise);
// 创建ImageReceiver对象,并设置照片参数
let imageReceiver = await image.createImageReceiver(640, 480, 4, 8);
// 获取照片显示SurfaceId
let photoSurfaceId = await imageReceiver.getReceivingSurfaceId();
// 创建拍照输出流
let photoOutput = await cameraObj.createPhotoOutput((photoSurfaceId));
// 向会话中添加拍照输出流
await CaptureSessionPromise.addOutput(photoOutput);
console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS to operate");
await CaptureSessionPromise.commitConfig();
await CaptureSessionPromise.start();
console.info(TAG + "Entering CAPTURE_SESSION_STOP_SUCCESS_PROMISE to operate");
try {
await CaptureSessionPromise.stop();
expect(true).assertTrue();
console.info(TAG + "Entering CAPTURE_SESSION_STOP_SUCCESS_PROMISE captureSession.stop PASSED");
console.info(TAG + "Entering CAPTURE_SESSION_STOP_SUCCESS_PROMISE captureSession.stop ends here");
await sleep(1000);
done();
} catch(err) {
expect().assertFail();
console.info(TAG + "Entering CAPTURE_SESSION_STOP_SUCCESS_PROMISE captureSession.stop FAILED");
}
await sleep(1000);
done();
......
......@@ -1272,95 +1272,6 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
done();
})
/**
* @tc.number : SET_FRAME_RATE_RANGE_Grp20
* @tc.name : set frame rate range camera0 api
* @tc.desc : set frame rate range async api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
// it('VA_SET_FRAME_RATE_RANGE_Grp20', 0, async function (done) {
// console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Grp20 to operate");
// // FIXME: range [5: 10]
// videoOutput.setFrameRateRange(5, 10, async (err, data) => {
// if (!err) {
// console.info(TAG + "Entering set frame rate range, current framerateRange is: " + JSON.stringify(data));
// console.info(TAG + "Entering set frame rate range PASSED")
// expect(true).assertTrue();
// }
// else {
// console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Grp20 FAILED : " + err.message);
// expect().assertFail();
// console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Grp20 ends here");
// }
// await sleep(1);
// done();
// })
// await sleep(1);
// done();
// })
/**
* @tc.number : ISVIDEOSTABILIZATIONMODESUPPORTEDOFF
* @tc.name : isVideoStabilizationModeSupported Off
* @tc.desc : isVideoStabilizationModeSupported async api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
/* VideoStabilizationMode Interface will be change
it('VA_ISVIDEOSTABILIZATIONMODESUPPORTEDOFF', 0, async function (done) {
console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTEDOFF to operate')
captureSession.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.OFF, async (err, data) => {
if (!err) {
console.info(TAG + 'Entering Create isVideoStabilizationModeSupported success')
expect(data).assertEqual(true)
console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTEDOFF PASSED :' + data)
}
else {
console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTEDOFF FAILED: ' + err.message)
expect().assertFail()
}
console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTEDOFF ends here')
await sleep(1)
done()
})
await sleep(1)
done()
})
*/
/**
* @tc.number : SET_VIDEOSTABILIZATIONMODEOFF
* @tc.name : SetVideoStabilizationModeOff
* @tc.desc : SetVideoStabilizationModeOff async api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
/* VideoStabilizationMode Interface will be change
it('VA_SET_VIDEOSTABILIZATIONMODEOFF', 0, async function (done) {
console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEOFF to operate')
captureSession.setVideoStabilizationMode(cameraObj.VideoStabilizationMode.OFF, async (err, data) => {
if (!err) {
console.info(TAG + 'Entering Set VideoStabilization Mode Off success')
console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEOFF PASSED: ' + data)
expect(cameraObj.VideoStabilizationMode.OFF).assertEqual(0)
}
else {
console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEOFF FAILED: ' + err.message)
expect().assertFail()
}
console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEOFF ends here')
await sleep(1)
done()
})
await sleep(1)
done()
})
*/
/**
* @tc.number : GET_VIDEOSTABILIZATION_MODE_OFF
* @tc.name : getVideoStabilizationModeOff
......@@ -1390,161 +1301,6 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
done();
})
/**
* @tc.number : ISVIDEOSTABILIZATIONMODESUPPORTED_LOW
* @tc.name : is VideoStabilization Mode Low Supported
* @tc.desc : isVideoStabilizationModeSupported low async api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
/* VideoStabilizationMode Interface will be change
it('VA_ISVIDEOSTABILIZATIONMODESUPPORTED_LOW', 0, async function (done) {
console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_LOW to operate')
captureSession.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.LOW, async (err, data) => {
if (!err) {
console.info(TAG + 'Entering isVideoStabilizationModeSupported success')
if (data != null || data != undefined) {
console.info(TAG + 'Entering isVideoStabilizationModeSupported data is not null || undefined')
expect(data).assertEqual(true)
console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_LOW PASSED: ' + data)
}
} else {
console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_LOW FAILED: ' + err.message)
expect().assertFail()
}
console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_LOW ends here')
await sleep(1)
done()
})
await sleep(1)
done()
})
*/
/**
* @tc.number : SET_VIDEOSTABILIZATIONMODELOW
* @tc.name : SetVideoStabilizationModelow
* @tc.desc : SetVideoStabilizationModelow async api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
/* VideoStabilizationMode Interface will be change
it('VA_SET_VIDEOSTABILIZATIONMODELOW', 0, async function (done) {
console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODELOW to operate')
captureSession.setVideoStabilizationMode(cameraObj.VideoStabilizationMode.LOW, async (err, data) => {
if (!err) {
console.info(TAG + 'Entering Set VideoStabilization Mode Low success')
console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODELOW PASSED: ' + data)
expect(cameraObj.VideoStabilizationMode.LOW).assertEqual(1);
}
else {
console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODELOW FAILED: ' + err.message)
expect().assertFail();
}
console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODELOW ends here')
await sleep(1)
done()
})
await sleep(1)
done()
})
*/
/**
* @tc.number : GET_VIDEOSTABILIZATION_MODE_LOW
* @tc.name : getVideoStabilizationModeLow
* @tc.desc : getVideoStabilizationModeLOw async api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
/* VideoStabilizationMode Interface will be change
it('VA_GET_VIDEOSTABILIZATION_MODE_LOW', 0, async function (done) {
console.info(TAG + "Entering GET_VIDEOSTABILIZATION_MODE_LOW to operate");
captureSession.getActiveVideoStabilizationMode(async (err, data) => {
if (!err) {
console.info(TAG + "Entering get Video Stabilization Mode low success");
console.info(TAG + "Current VideoStabilizationMode is: " + data);
expect(data).assertEqual(1)
console.info(TAG + "GET_VIDEOSTABILIZATION_MODE_LOW PASSED");
}
else {
expect().assertFail();
console.info(TAG + "GET_VIDEOSTABILIZATION_MODE_LOW FAILED :" + err.message);
console.info(TAG + "GET_VIDEOSTABILIZATION_MODE_LOW ends here");
}
await sleep(1);
done();
})
await sleep(1);
done();
})
*/
/**
* @tc.number : ISVIDEOSTABILIZATIONMODESUPPORTED_MIDDLE
* @tc.name : is VideoStabilization Mode Middle Supported
* @tc.desc : isVideoStabilizationModeSupported Middle async api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
/* VideoStabilizationMode Interface will be change
it('VA_ISVIDEOSTABILIZATIONMODESUPPORTED_MIDDLE', 0, async function (done) {
console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_MIDDLE to operate')
captureSession.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.MIDDLE, async (err, data) => {
if (!err) {
console.info(TAG + 'Entering is VideoStabilization Mode middle Supported success')
if (data != null || data != undefined) {
console.info(TAG + 'Entering isVideoStabilizationModeSupported data is not null || undefined')
expect(data).assertEqual(false)
console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_MIDDLE PASSED : ' + data)
}
} else {
console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_MIDDLE FAILED: ' + err.message)
expect().assertFail()
}
console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_MIDDLE ends here')
await sleep(1)
done()
})
await sleep(1)
done()
})
*/
/**
* @tc.number : SET_VIDEOSTABILIZATIONMODEMIDDLE
* @tc.name : SetVideoStabilizationModeMedium
* @tc.desc : SetVideoStabilizationModeMedium async api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
/* VideoStabilizationMode Interface will be change
it('VA_SET_VIDEOSTABILIZATIONMODEMIDDLE', 0, async function (done) {
console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEMIDDLE to operate')
captureSession.setVideoStabilizationMode(cameraObj.VideoStabilizationMode.MIDDLE, async (err, data) => {
if (!err) {
console.info(TAG + 'Entering Create Set VideoStabilization Mode middle success')
console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEMIDDLE FAILED: ' + data)
expect().assertFail();
}
else {
console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEMIDDLE PASSED: ' + err.message)
expect(true).assertTrue();
}
console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEMIDDLE ends here')
await sleep(1)
done()
})
await sleep(1)
done()
})
*/
/**
* @tc.number : GET_VIDEOSTABILIZATION_MODE_MIDDLE
* @tc.name : getVideoStabilizationModeMedium
......@@ -1574,66 +1330,6 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
done();
})
/**
* @tc.number : ISVIDEOSTABILIZATIONMODESUPPORTED_HIGH
* @tc.name : is VideoStabilization Mode High Supported
* @tc.desc : isVideoStabilizationModeSupported High async api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
/* VideoStabilizationMode Interface will be change
it('VA_ISVIDEOSTABILIZATIONMODESUPPORTED_HIGH', 0, async function (done) {
console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_HIGH to operate')
captureSession.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.HIGH, async (err, data) => {
if (!err) {
console.info(TAG + 'Entering is VideoStabilization Mode High Supported success')
expect(data).assertEqual(false)
console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_HIGH PASSED : ' + data)
}
else {
console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_HIGH FAILED: ' + err.message)
expect().assertFail()
}
console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_HIGH ends here')
await sleep(1)
done()
})
await sleep(1)
done()
})
*/
/**
* @tc.number : SET_VIDEOSTABILIZATIONMODEHIGH
* @tc.name : SetVideoStabilizationModeHigh
* @tc.desc : SetVideoStabilizationModeHigh async api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
/* VideoStabilizationMode Interface will be change
it('VA_SET_VIDEOSTABILIZATIONMODEHIGH', 0, async function (done) {
console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEHIGH to operate')
captureSession.setVideoStabilizationMode(cameraObj.VideoStabilizationMode.HIGH, async (err, data) => {
if (!err) {
console.info(TAG + 'Entering Create Set VideoStabilization Mode High success')
console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEHIGH FAILED: ' + data)
expect().assertFail();
}
else {
console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEHIGH PASSED: ' + err.message)
expect(true).assertTrue();
}
console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEHIGH ends here')
await sleep(1)
done()
})
await sleep(1)
done()
})
*/
/**
* @tc.number : GET_VIDEOSTABILIZATION_MODE_HIGH
* @tc.name : getVideoStabilizationModeHigh
......@@ -1663,68 +1359,6 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
done();
})
/**
* @tc.number : ISVIDEOSTABILIZATIONMODESUPPORTED_AUTO
* @tc.name : is VideoStabilization Mode Auto Supported
* @tc.desc : isVideoStabilizationModeSupported Auto async api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
/* VideoStabilizationMode Interface will be change
it('VA_ISVIDEOSTABILIZATIONMODESUPPORTED_AUTO', 0, async function (done) {
console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_AUTO to operate')
captureSession.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.AUTO, async (err, data) => {
if (!err) {
console.info(TAG + 'Entering is VideoStabilization Mode Auto Supported success')
if (data != null || data != undefined) {
console.info(TAG + 'Entering isVideoStabilizationModeSupported data is not null || undefined')
expect(data).assertEqual(false)
console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_AUTO PASSED : ' + data)
}
} else {
console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_AUTO FAILED: ' + err.message)
expect().assertFail()
}
console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_AUTO ends here')
await sleep(1)
done()
})
await sleep(1)
done()
})
*/
/**
* @tc.number : SET_VIDEOSTABILIZATIONMODEAUTO
* @tc.name : SetVideoStabilizationModeAuto
* @tc.desc : SetVideoStabilizationModeAuto async api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
/* VideoStabilizationMode Interface will be change
it('VA_SET_VIDEOSTABILIZATIONMODEAUTO', 0, async function (done) {
console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEAUTO to operate')
captureSession.setVideoStabilizationMode(cameraObj.VideoStabilizationMode.AUTO, async (err, data) => {
if (!err) {
console.info(TAG + 'Entering Create Set VideoStabilization Mode auto success')
console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEAUTO FAILED: ' + data)
expect().assertFail();
}
else {
console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEAUTO PASSED: ' + err.message)
expect(true).assertTrue();
}
console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEAUTO ends here')
await sleep(1)
done()
})
await sleep(1)
done()
})
*/
/**
* @tc.number : GET_VIDEOSTABILIZATION_MODE_AUTO
* @tc.name : getVideoStabilizationModeAuto
......@@ -1754,73 +1388,6 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
done();
})
/**
* @tc.number : COMMIT_CONFIG
* @tc.name : CommitConfig async api
* @tc.desc : CommitConfig async api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('VA_COMMIT_CONFIG', 0, async function (done) {
//创建会话
let captureSessionCommitConfig = await cameraObj.createCaptureSession(null);
// 开始配置会话
await captureSessionCommitConfig.beginConfig();
let cameraManager = await cameraObj.getCameraManager(null);
// // 注册回调函数监听相机状态变化,获取状态变化的相机信息
// cameraManager.on('cameraStatus', (cameraStatusInfo) => {
// console.log('camera : ' + cameraStatusInfo.camera.cameraId);
// console.log('status: ' + cameraStatusInfo.status);
// })
// 获取相机列表
let cameraArray = await cameraManager.getCameras();
for(let cameraIndex = 0; cameraIndex < cameraArray.length; cameraIndex++) {
console.log(TAG + 'cameraId : ' + cameraArray[cameraIndex].cameraId) // 获取相机ID
console.log(TAG + 'cameraPosition : ' + cameraArray[cameraIndex].cameraPosition) // 获取相机位置
console.log(TAG + 'cameraType : ' + cameraArray[cameraIndex].cameraType) // 获取相机类型
console.log(TAG + 'connectionType : ' + cameraArray[cameraIndex].connectionType) // 获取相机连接类型
}
// 创建相机输入流
let cameraInput = await cameraManager.createCameraInput(cameraArray[0].cameraId);
// 创建预览输出流
let previewOutput = await cameraObj.createPreviewOutput(surfaceId);
// 创建ImageReceiver对象,并设置照片参数
let imageReceiver = await image.createImageReceiver(640, 480, 4, 8);
// 获取照片显示SurfaceId
let photoSurfaceId = await imageReceiver.getReceivingSurfaceId();
// 创建拍照输出流
let photoOutput = await cameraObj.createPhotoOutput((photoSurfaceId));
// 向会话中添加相机输入流
await captureSessionCommitConfig.addInput(cameraInput);
// 向会话中添加预览输入流
await captureSessionCommitConfig.addOutput(previewOutput);
// 向会话中添加拍照输出流
await captureSessionCommitConfig.addOutput(photoOutput);
// 提交会话配置
captureSessionCommitConfig.commitConfig(async (err, data) => {
if (!err) {
console.info(TAG + 'Entering CommitConfig success')
console.info(TAG + 'Entering CommitConfig data is not null || undefined')
expect(true).assertTrue()
console.info(TAG + 'Entering COMMIT_CONFIG PASSED')
} else {
console.info(TAG + 'Entering COMMIT_CONFIG FAILED: ' + err.message)
expect().assertFail();
}
console.info(TAG + 'Entering COMMIT_CONFIG ends here')
await sleep(1)
done()
})
})
/**
* @tc.number : FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT
* @tc.name : FocusStateChange callback api
......@@ -2120,9 +1687,9 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
*/
it('VA_CAPTURE_SESSION_START', 0, async function (done) {
//创建会话
let captureSessionSessionStart = await cameraObj.createCaptureSession(null);
let captureSession = await cameraObj.createCaptureSession(null);
// 开始配置会话
await captureSessionSessionStart.beginConfig();
await captureSession.beginConfig();
let cameraManager = await cameraObj.getCameraManager(null);
......@@ -2154,19 +1721,19 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
// 创建拍照输出流
let photoOutput = await cameraObj.createPhotoOutput((photoSurfaceId));
// 向会话中添加相机输入流
await captureSessionSessionStart.addInput(cameraInput);
await captureSession.addInput(cameraInput);
// 向会话中添加预览输入流
await captureSessionSessionStart.addOutput(previewOutput);
await captureSession.addOutput(previewOutput);
// 向会话中添加拍照输出流
await captureSessionSessionStart.addOutput(photoOutput);
await captureSession.addOutput(photoOutput);
// 提交会话配置
await captureSessionSessionStart.commitConfig();
await captureSession.commitConfig();
// 启动会话
console.info(TAG + "Entering CAPTURE_SESSION_START to operate")
await sleep(1)
captureSessionSessionStart.start(async (err, data) => {
captureSession.start(async (err, data) => {
if (!err) {
console.info(TAG + "Entering CaptureSession start success")
expect(true).assertTrue()
......@@ -2192,34 +1759,66 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
* @tc.level : Level 0
*/
it('VA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS', 0, async function (done) {
//创建会话
let captureSession = await cameraObj.createCaptureSession(null);
// 开始配置会话
await captureSession.beginConfig();
let cameraManager = await cameraObj.getCameraManager(null);
// // 注册回调函数监听相机状态变化,获取状态变化的相机信息
// cameraManager.on('cameraStatus', (cameraStatusInfo) => {
// console.log('camera : ' + cameraStatusInfo.camera.cameraId);
// console.log('status: ' + cameraStatusInfo.status);
// })
// 获取相机列表
let cameraArray = await cameraManager.getCameras();
for(let cameraIndex = 0; cameraIndex < cameraArray.length; cameraIndex++) {
console.log(TAG + 'cameraId : ' + cameraArray[cameraIndex].cameraId) // 获取相机ID
console.log(TAG + 'cameraPosition : ' + cameraArray[cameraIndex].cameraPosition) // 获取相机位置
console.log(TAG + 'cameraType : ' + cameraArray[cameraIndex].cameraType) // 获取相机类型
console.log(TAG + 'connectionType : ' + cameraArray[cameraIndex].connectionType) // 获取相机连接类型
}
// 创建相机输入流
let cameraInput = await cameraManager.createCameraInput(cameraArray[0].cameraId);
// 创建预览输出流
let previewOutput = await cameraObj.createPreviewOutput(surfaceId);
// 创建ImageReceiver对象,并设置照片参数
let imageReceiver = await image.createImageReceiver(640, 480, 4, 8);
// 获取照片显示SurfaceId
let photoSurfaceId = await imageReceiver.getReceivingSurfaceId();
// 创建拍照输出流
let photoOutput = await cameraObj.createPhotoOutput((photoSurfaceId));
// 向会话中添加相机输入流
await captureSession.addInput(cameraInput);
// 向会话中添加预览输入流
await captureSession.addOutput(previewOutput);
// 向会话中添加拍照输出流
await captureSession.addOutput(photoOutput);
// 提交会话配置
await captureSession.commitConfig();
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS to operate");
let settings = {
quality: cameraObj.QualityLevel.QUALITY_LEVEL_HIGH, // 设置图片质量高
rotation: cameraObj.ImageRotation.ROTATION_0 // 设置图片旋转角度0
}
photoOutput.capture(settings, async (err, data) => {
if (!err) {
console.info(TAG + "Entering photoOutput capture without photosettings success");
if (data != null || data != undefined) {
console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined");
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS PASSED");
try {
photoOutput.capture((err) => {
if (err) {
expect().assertFail();
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS FAILED : " + err.message);
} else {
expect(true).assertTrue();
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS PASSED");
}
} else {
expect().assertFail();
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS FAILED : " + err.message);
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS ends here");
}
await sleep(1);
done();
})
});
} catch (error) {
expect().assertFail();
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS FAILED : ");
}
await sleep(1);
done();
})
......@@ -2620,228 +2219,63 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
* @tc.number : GET_ZOOM_RATIO
* @tc.name : get zoom ratio camera-0 cameraId api
* @tc.desc : get zoom ratio camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('VA_GET_ZOOM_RATIO', 0, async function (done) {
console.info("--------------GET_ZOOM_RATIO--------------");
camera0Input.getZoomRatioRange(async (err, data) => {
if (!err) {
if (data != null && data != undefined) {
console.info(TAG + "Entering GET_ZOOM_RATIO data is not null || undefined");
expect(true).assertTrue();
console.info(TAG + "Entering GET_ZOOM_RATIO Success " + data)
}
} else {
expect().assertFail();
console.info(TAG + "Entering GET_ZOOM_RATIO FAILED: " + err.message);
}
console.info(TAG + "Entering GET_ZOOM_RATIO ends here");
await sleep(1);
done();
})
await sleep(1);
done();
})
/**
* @tc.number : SET_GET_ZOOM_1_ASYNC
* @tc.name : Zoom camera-0 cameraId api
* @tc.desc : Zoom camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('VA_SET_GET_ZOOM_1_ASYNC', 0, async function (done) {
camera0Input.setZoomRatio(1, (err, data) => {
if (!err) {
console.info(TAG + "setZoomRatio success: 1");
console.info(TAG + "getZoomRatio called")
camera0Input.getZoomRatio((err, data1) => {
if (!err) {
console.info(TAG + "getZoomRatio success : " + data1);
expect(data1).assertEqual(1);
console.info(TAG + "SET_GET_ZOOM_1_ASYNC PASSED ");
}
else {
console.info(TAG + "GET_ZOOM_1_ASYNC FAILED" + err.message);
expect().assertFail();
}
})
} else {
console.info(TAG + "SET_ZOOM_1_ASYNC FAILED" + err.message);
expect().assertFail();
}
})
await sleep(1);
done();
})
/**
* @tc.number : SET_GET_ZOOM_2_ASYNC
* @tc.name : Zoom camera-0 cameraId api
* @tc.desc : Zoom camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
// it('VA_SET_GET_ZOOM_2_ASYNC', 0, async function (done) {
// camera0Input.setZoomRatio(2, (err, data) => {
// if (!err) {
// console.info(TAG + "setZoomRatio success: 2");
// console.info(TAG + "getZoomRatio called")
// camera0Input.getZoomRatio((err, data1) => {
// if (!err) {
// console.info(TAG + "getZoomRatio success : " + data1);
// expect(data1).assertEqual(2);
// console.info(TAG + "SET_GET_ZOOM_2_ASYNC PASSED ");
// }
// else {
// expect().assertFail();
// console.info(TAG + "GET_ZOOM_2_ASYNC FAILED" + err.message);
// }
// })
// } else {
// expect().assertFail();
// console.info(TAG + "SET_ZOOM_2_ASYNC FAILED" + err.message);
// }
// })
// await sleep(1);
// done();
// })
/**
* @tc.number : SET_GET_ZOOM_3_ASYNC
* @tc.name : Zoom camera-0 cameraId api
* @tc.desc : Zoom camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
// it('VA_SET_GET_ZOOM_3_ASYNC', 0, async function (done) {
// camera0Input.setZoomRatio(3, (err, data) => {
// if (!err) {
// console.info(TAG + "setZoomRatio success: 3");
// console.info(TAG + "getZoomRatio called")
// camera0Input.getZoomRatio((err, data1) => {
// if (!err) {
// console.info(TAG + "getZoomRatio success : " + data1);
// expect(data1).assertEqual(3);
// console.info(TAG + "SET_GET_ZOOM_3_ASYNC PASSED ");
// }
// else {
// console.info(TAG + "GET_ZOOM_3_ASYNC FAILED" + err.message);
// expect().assertFail();
// }
// })
// } else {
// console.info(TAG + "SET_ZOOM_3_ASYNC FAILED" + err.message);
// expect().assertFail();
// }
// })
// await sleep(1);
// done();
// })
/**
* @tc.number : SET_GET_ZOOM_4_ASYNC
* @tc.name : Zoom camera-0 cameraId api
* @tc.desc : Zoom camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
// it('VA_SET_GET_ZOOM_4_ASYNC', 0, async function (done) {
// camera0Input.setZoomRatio(4, (err, data) => {
// if (!err) {
// console.info(TAG + "setZoomRatio success: 4");
// console.info(TAG + "getZoomRatio called")
// camera0Input.getZoomRatio((err, data1) => {
// if (!err) {
// console.info(TAG + "getZoomRatio success : " + data1);
// expect(data1).assertEqual(4);
// console.info(TAG + "SET_GET_ZOOM_4_ASYNC PASSED ");
// }
// else {
// console.info(TAG + "GET_ZOOM_4_ASYNC FAILED" + err.message);
// expect().assertFail();
// }
// })
// } else {
// console.info(TAG + "SET_ZOOM_4_ASYNC FAILED" + err.message);
// expect().assertFail();
// }
// })
// await sleep(1);
// done();
// })
/**
* @tc.number : SET_GET_ZOOM_5_ASYNC
* @tc.name : Zoom camera-0 cameraId api
* @tc.desc : Zoom camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
// it('VA_SET_GET_ZOOM_5_ASYNC', 0, async function (done) {
// camera0Input.setZoomRatio(5, (err, data) => {
// if (!err) {
// console.info(TAG + "setZoomRatio success: 5");
// console.info(TAG + "getZoomRatio called")
// camera0Input.getZoomRatio((err, data1) => {
// if (!err) {
// console.info(TAG + "getZoomRatio success : " + data1);
// expect(data1).assertEqual(5);
// console.info(TAG + "SET_GET_ZOOM_5_ASYNC PASSED ");
// }
// else {
// console.info(TAG + "GET_ZOOM_5_ASYNC FAILED" + err.message);
// expect().assertFail();
// }
// })
// } else {
// console.info(TAG + "SET_ZOOM_5_ASYNC FAILED" + err.message);
// expect().assertFail();
// }
// })
// await sleep(1);
// done();
// })
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('VA_GET_ZOOM_RATIO', 0, async function (done) {
console.info("--------------GET_ZOOM_RATIO--------------");
camera0Input.getZoomRatioRange(async (err, data) => {
if (!err) {
if (data != null && data != undefined) {
console.info(TAG + "Entering GET_ZOOM_RATIO data is not null || undefined");
expect(true).assertTrue();
console.info(TAG + "Entering GET_ZOOM_RATIO Success " + data)
}
} else {
expect().assertFail();
console.info(TAG + "Entering GET_ZOOM_RATIO FAILED: " + err.message);
}
console.info(TAG + "Entering GET_ZOOM_RATIO ends here");
await sleep(1);
done();
})
await sleep(1);
done();
})
/**
* @tc.number : SET_GET_ZOOM_6_ASYNC
* @tc.number : SET_GET_ZOOM_1_ASYNC
* @tc.name : Zoom camera-0 cameraId api
* @tc.desc : Zoom camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
// it('VA_SET_GET_ZOOM_6_ASYNC', 0, async function (done) {
// camera0Input.setZoomRatio(6, (err, data) => {
// if (!err) {
// console.info(TAG + "setZoomRatio success: 6");
// console.info(TAG + "getZoomRatio called")
// camera0Input.getZoomRatio((err, data1) => {
// if (!err) {
// console.info(TAG + "getZoomRatio success : " + data1);
// expect(data1).assertEqual(6);
// console.info(TAG + "SET_GET_ZOOM_6_ASYNC PASSED ");
// }
// else {
// console.info(TAG + "GET_ZOOM_6_ASYNC FAILED" + err.message);
// expect().assertFail();
// }
// })
// } else {
// console.info(TAG + "SET_ZOOM_6_ASYNC FAILED" + err.message);
// expect().assertFail();
// }
// })
// await sleep(1);
// done();
// })
it('VA_SET_GET_ZOOM_1_ASYNC', 0, async function (done) {
camera0Input.setZoomRatio(1, (err, data) => {
if (!err) {
console.info(TAG + "setZoomRatio success: 1");
console.info(TAG + "getZoomRatio called")
camera0Input.getZoomRatio((err, data1) => {
if (!err) {
console.info(TAG + "getZoomRatio success : " + data1);
expect(data1).assertEqual(1);
console.info(TAG + "SET_GET_ZOOM_1_ASYNC PASSED ");
}
else {
console.info(TAG + "GET_ZOOM_1_ASYNC FAILED" + err.message);
expect().assertFail();
}
})
} else {
console.info(TAG + "SET_ZOOM_1_ASYNC FAILED" + err.message);
expect().assertFail();
}
})
await sleep(1);
done();
})
/**
* @tc.number : IS_FOCUS_MODE_LOCKED_SUPPORTED
......@@ -3412,68 +2846,6 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
done();
})
/**
* @tc.number : IS_EXPOSURE_MODE_LOCKED_SUPPORTED
* @tc.name : check if exposure mode locked is supported-camera0Input api
* @tc.desc : check if exposure mode locked is supported-camera0Input api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
/* EXPOSUREMODE Interface will be change
it('VA_IS_EXPOSURE_MODE_LOCKED_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering IS_EXPOSURE_MODE_LOCKED_SUPPORTED to operate");
camera0Input.isExposureModeSupported(cameraObj.ExposureMode.EXPOSURE_MODE_LOCKED, async (err, data) => {
if (!err) {
console.info(TAG + "Entering Is Exposure Mode Locked supported SUCCESS ");
if (data != null || data != undefined) {
console.info(TAG + "Entering Is Exposure Mode Locked supported data is not null || undefined");
console.info(TAG + "Exposure_Mode_Locked_Supported is: " + data);
expect(data).assertEqual(false);
console.info(TAG + "Entering IS_EXPOSURE_MODE_LOCKED_SUPPORTED PASSED: ");
}
} else {
console.info(TAG + "IS_EXPOSURE_MODE_LOCKED_SUPPORTED FAILED : " + err.message);
expect().assertFail();
console.info(TAG + "IS_EXPOSURE_MODE_LOCKED_SUPPORTED ends here");
}
await sleep(1);
done();
})
await sleep(1);
done();
})
*/
/**
* @tc.number : SET_EXPOSURE_MODE_LOCKED
* @tc.name : set exposure mode locked camera0 api
* @tc.desc : set exposure mode locked camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
/* EXPOSUREMODE Interface will be change
it('VA_SET_EXPOSURE_MODE_LOCKED', 0, async function (done) {
console.info(TAG + "Entering SET_EXPOSURE_MODE_LOCKED to operate");
camera0Input.setExposureMode(cameraObj.ExposureMode.EXPOSURE_MODE_LOCKED, async (err, data) => {
if (!err) {
console.info(TAG + "Entering Set Exposure Mode Locked, current ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_LOCKED);
console.info(TAG + "Entering SET_EXPOSURE_MODE_LOCKED FAILED")
expect().assertFail();
} else {
console.info(TAG + "Entering SET_EXPOSURE_MODE_LOCKED PASSED : " + err.message);
expect(true).assertTrue();
console.info(TAG + "Entering SET_EXPOSURE_MODE_LOCKED ends here");
}
await sleep(1);
done();
})
await sleep(1);
done();
})
*/
/**
* @tc.number : GET_EXPOSURE_MODE_LOCKED
* @tc.name : get exposure mode locked camera0 api
......@@ -3643,102 +3015,6 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
done();
})
/**
* @tc.number : IS_EXPOSURE_MODE_AUTO_SUPPORTED
* @tc.name : check if exposure mode auto is supported-camera0Input api
* @tc.desc : check if exposure mode auto is supported-camera0Input api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
/* EXPOSUREMODE Interface will be change
it('VA_IS_EXPOSURE_MODE_AUTO_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering IS_EXPOSURE_MODE_AUTO_SUPPORTED to operate");
camera0Input.isExposureModeSupported(cameraObj.ExposureMode.EXPOSURE_MODE_AUTO, async (err, data) => {
if (!err) {
console.info(TAG + "Entering Is Exposure Mode Auto supported SUCCESS ");
if (data != null || data != undefined) {
console.info(TAG + "Entering Is Exposure Mode Auto supported data is not null || undefined");
console.info(TAG + "Exposure_Mode_Auto_Supported is: " + data);
expect(data).assertEqual(true);
console.info(TAG + "Entering IS_EXPOSURE_MODE_AUTO_SUPPORTED PASSED: ");
}
} else {
console.info(TAG + "IS_EXPOSURE_MODE_AUTO_SUPPORTED FAILED : " + err.message);
expect().assertFail();
console.info(TAG + "IS_EXPOSURE_MODE_AUTO_SUPPORTED ends here");
}
await sleep(1);
done();
})
await sleep(1);
done();
})
*/
/**
* @tc.number : SET_EXPOSURE_MODE_AUTO
* @tc.name : set exposure mode auto camera0 api
* @tc.desc : set exposure mode auto camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
/* EXPOSUREMODE Interface will be change
it('VA_SET_EXPOSURE_MODE_AUTO', 0, async function (done) {
console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO to operate");
camera0Input.setExposureMode(cameraObj.ExposureMode.EXPOSURE_MODE_AUTO, async (err, data) => {
if (!err) {
console.info(TAG + "Entering Set Exposure Mode auto,current ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_AUTO);
if (data != null || data != undefined) {
expect(cameraObj.ExposureMode.EXPOSURE_MODE_AUTO).assertEqual(1);
console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO PASSED")
}
} else {
console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO FAILED : " + err.message);
expect().assertFail();
console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO ends here");
}
await sleep(1);
done();
})
await sleep(1);
done();
})
*/
/**
* @tc.number : GET_EXPOSURE_MODE_AUTO
* @tc.name : get exposure mode auto camera0 api
* @tc.desc : get exposure mode auto camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
/* EXPOSUREMODE Interface will be change
it('VA_GET_EXPOSURE_MODE_AUTO', 0, async function (done) {
console.info(TAG + "Entering GET_EXPOSURE_MODE_AUTO to operate");
camera0Input.getExposureMode(async (err, data) => {
if (!err) {
console.info(TAG + "Entering Get Exposure Mode SUCCESS");
console.info(TAG + "Get Exposure Mode data is not null || undefined: ");
console.info(TAG + "Current ExposureMode is: " + data);
expect(data).assertEqual(1);
console.info(TAG + "GET_EXPOSURE_MODE_AUTO PASSED");
}
else {
expect().assertFail();
console.info(TAG + "GET_EXPOSURE_MODE_AUTO FAILED : " + err.message);
console.info(TAG + "GET_EXPOSURE_MODE_AUTO ends here");
}
await sleep(1);
done();
})
await sleep(1);
done();
})
*/
/**
* @tc.number : SET_EXPOSURE_POINT_exposure mode auto
* @tc.name : set exposure Point camera0 api
......@@ -3822,97 +3098,6 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
done();
})
/**
* @tc.number : GET_EXPOSURE_BIASVALUE_exposure mode auto
* @tc.name : get exposure bias value camera0 api
* @tc.desc : get exposure bias value camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
// it('VA_GET_EXPOSURE_BIASVALUE', 0, async function (done) {
// console.info(TAG + "Entering GET_EXPOSURE_BIASVALUE to operate");
// camera0Input.getExposureValue(async (err, data) => {
// if (!err) {
// console.info(TAG + "Entering Get Exposure bias value SUCCESS");
// console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data));
// expect(data).assertEqual(1);
// console.info(TAG + "GET_EXPOSURE_BIASVALUE PASSED");
// }
// else {
// expect().assertFail();
// console.info(TAG + "GET_EXPOSURE_BIASVALUE FAILED : " + err.message);
// console.info(TAG + "GET_EXPOSURE_BIASVALUE ends here");
// }
// await sleep(1);
// done();
// })
// await sleep(1);
// done();
// })
/**
* @tc.number : IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED
* @tc.name : check if exposure mode continuous auto is supported-camera0Input api
* @tc.desc : check if exposure mode continuous auto is supported-camera0Input api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
/* EXPOSUREMODE Interface will be change
it('VA_IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED to operate");
camera0Input.isExposureModeSupported(cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO, async (err, data) => {
if (!err) {
console.info(TAG + "Entering Is Exposure Mode continuous Auto supported SUCCESS ");
if (data != null || data != undefined) {
console.info(TAG + "Entering Is Exposure Mode continuous Auto supported data is not null || undefined");
console.info(TAG + "Exposure_Mode_continuous_Auto_Supported is: " + data);
expect(data).assertEqual(false);
console.info(TAG + "Entering IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED PASSED: ");
}
} else {
console.info(TAG + "IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED FAILED : " + err.message);
expect().assertFail();
console.info(TAG + "IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED ends here");
}
await sleep(1);
done();
})
await sleep(1);
done();
})
*/
/**
* @tc.number : SET_EXPOSURE_MODE_CONTINUOUS_AUTO
* @tc.name : set exposure mode continuous auto camera0 api
* @tc.desc : set exposure mode continuous auto camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
/* EXPOSUREMODE Interface will be change
it('VA_SET_EXPOSURE_MODE_CONTINUOUS_AUTO', 0, async function (done) {
console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO to operate");
camera0Input.setExposureMode(cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO, async (err, data) => {
if (!err) {
console.info(TAG + "Entering Set Exposure Mode continuous auto,current ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO);
console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO FAILED")
expect().AssertFail();
} else {
console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO PASSED : " + err.message);
expect(true).assertTrue();
console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO ends here");
}
await sleep(1);
done();
})
await sleep(1);
done();
})
*/
/**
* @tc.number : GET_EXPOSURE_MODE_CONTINUOUS_AUTO
* @tc.name : get exposure mode continuous auto camera0 api
......@@ -4113,35 +3298,6 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
}
})
/**
* @tc.number : VIDEO_OUTPUT_START
* @tc.name : VideoOutput start async api
* @tc.desc : VideoOutput start async api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('VA_VIDEO_OUTPUT_START', 0, async function (done) {
console.info(TAG + "Entering VIDEO_OUTPUT_START to operate")
await getvideosurface()
await sleep(2)
let videoOutput = await cameraObj.createVideoOutput(videoId);
await sleep(1)
videoOutput.start(async (err, data) => {
if (!err) {
console.info(TAG + "Entering VIDEO_OUTPUT_START success: " + JSON.stringify(data))
if (data == undefined) {
expect(true).assertTrue();
}
} else {
expect().assertFail();
console.info(TAG + "Entering VIDEO_OUTPUT_START FAILED: " + err.message)
}
})
await sleep(1)
done()
})
/**
* @tc.number : VIDEO_RECORDER_START
* @tc.name : VideoRecorder start async api
......@@ -4172,38 +3328,6 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
done()
})
/**
* @tc.number : VIDEO_OUTPUT_STOP
* @tc.name : VideoOutput stop async api
* @tc.desc : VideoOutput stop async api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('VA_VIDEO_OUTPUT_STOP', 0, async function (done) {
await getvideosurface()
await sleep(2)
let videoOutput = await cameraObj.createVideoOutput(videoId);
await sleep(1)
await videoOutput.start();
videoOutput.stop(async (err, data) => {
if (!err) {
console.info(TAG + 'Entering VIDEO_OUTPUT_STOP success: ' + JSON.stringify(data))
if (data == undefined) {
expect(true).assertTrue()
}
} else {
expect().assertFail()
console.info(TAG + 'Entering VIDEO_OUTPUT_STOP FAILED: ' + err.message)
}
console.info(TAG + 'Entering VIDEO_OUTPUT_STOP ends here')
await sleep(1)
done()
})
await sleep(1)
done()
})
/**
* @tc.number : VIDEO_RECORDER_STOP
* @tc.name : VideoRecorder stop async api
......@@ -4237,9 +3361,9 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
*/
it('VA_CAPTURE_SESSION_STOP', 0, async function (done) {
//创建会话
let captureSessionSessionStart = await cameraObj.createCaptureSession(null);
let captureSession = await cameraObj.createCaptureSession(null);
// 开始配置会话
await captureSessionSessionStart.beginConfig();
await captureSession.beginConfig();
let cameraManager = await cameraObj.getCameraManager(null);
......@@ -4265,19 +3389,19 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
// 创建拍照输出流
let photoOutput = await cameraObj.createPhotoOutput((photoSurfaceId));
// 向会话中添加相机输入流
await captureSessionSessionStart.addInput(cameraInput);
await captureSession.addInput(cameraInput);
// 向会话中添加预览输入流
await captureSessionSessionStart.addOutput(previewOutput);
await captureSession.addOutput(previewOutput);
// 向会话中添加拍照输出流
await captureSessionSessionStart.addOutput(photoOutput);
await captureSession.addOutput(photoOutput);
// 提交会话配置
await captureSessionSessionStart.commitConfig();
await captureSession.commitConfig();
// 启动会话
console.info(TAG + "Entering CAPTURE_SESSION_START to operate")
await sleep(1)
await captureSessionSessionStart.start();
await captureSession.start();
//停止会话
captureSession.stop((err, data) => {
......
......@@ -35,6 +35,8 @@ var photoOutputPromise
let fdPath;
let fileAsset;
let fdNumber;
var captureSessionCommitConfig
var _videoOutput
var minFrameRate_Grp0=12;
var maxFrameRate_Grp0=12;
......@@ -1702,73 +1704,6 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
done();
})
/**
* @tc.number : COMMIT_CONFIG_SUCCESS
* @tc.name : commit config api
* @tc.desc : commit config api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('VP_COMMIT_CONFIG_SUCCESS', 0, async function (done) {
// FIXME: 流程不对
console.info(TAG + "Entering commitConfig success");
// 创建Context对象
let context = featureAbility.getContext()
//创建会话
let captureSession
await cameraObj.createCaptureSession((context), (err, session) => {
if (err) {
console.error(TAG + 'Failed to create the CaptureSession instance. ${err.message}');
return;
}
console.log(TAG + 'Callback returned with the CaptureSession instance.' + session);
captureSession = session
});
// 开始配置会话
await captureSession.beginConfig((err) => {
if (err) {
console.error(TAG + 'Failed to start the configuration. ${err.message}');
return;
}
console.log(TAG + 'Callback invoked to indicate the begin config success.');
});
const promise = await captureSessionPromise.commitConfig();
if (promise == undefined) {
expect(true).assertTrue();
console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig PASSED");
} else {
expect().assertFail()
console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig FAILED : ");
console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig ends here");
}
await sleep(1);
done();
// if (captureSessionPromise == null || captureSessionPromise == undefined) {
// console.info(TAG + "Entering Commit config captureSession == null || undefined");
// } else {
// console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS to operate");
// const promise = await captureSessionPromise.commitConfig();
// console.info(TAG + "Entering commitConfig success");
// // FIXME: 预期就是失败的
// if (promise == undefined) {
// expect().assertFail()
// console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig PASSED");
// }
// else {
// expect(true).assertTrue();
// console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig FAILED : ");
// console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig ends here");
// }
// await sleep(1);
// done();
// }
// await sleep(1);
// done();
})
/**
* @tc.number : PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START
* @tc.name : Preview output callback on frame start api
......@@ -1995,32 +1930,6 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
}
})
/**
* @tc.number : CAPTURE_SESSION_START_SUCCESS
* @tc.name : capture session start api
* @tc.desc : capture session start api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('VP_CAPTURE_SESSION_START_SUCCESS', 0, async function (done) {
// FIXME: 复杂
if (captureSessionPromise == null || captureSessionPromise == undefined) {
console.info(TAG + "Entering capture session start captureSession == null || undefined");
} else {
console.info(TAG + "Entering CAPTURE_SESSION_START_SUCCESS to operate");
await captureSessionPromise.start();
console.info(TAG + "Entering captureSession start success");
expect(true).assertTrue();
console.info(TAG + "Entering CAPTURE_SESSION_START_SUCCESS PASSED");
console.info(TAG + "Entering CAPTURE_SESSION_START_SUCCESS ends here");
await sleep(1);
done();
}
await sleep(1);
done();
})
/**
* @tc.number : isMirrorSupported_PHOTO_OUTPUT
* @tc.name : isMirrorSupported
......@@ -2478,141 +2387,6 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
done();
})
/**
* @tc.number : SET_GET_ZOOM_2_PROMISE
* @tc.name : Zoom camera-0 cameraId api
* @tc.desc : Zoom camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
// FIXME: no use testcase
// it('VP_SET_GET_ZOOM_2_PROMISE', 0, async function (done) {
// var setpromise = await camera0InputPromise.setZoomRatio(2);
// console.info(TAG + "setZoomRatio success: 2");
// console.info(TAG + "getZoomRatio called")
// var getpromise2 = await camera0InputPromise.getZoomRatio();
// // FIXME: 拿到的 zoomRatio 是 1
// console.info(TAG + "getZoomRatio success: " + getpromise2);
// if (getpromise2 != null && getpromise2 != undefined) {
// expect(getpromise2).assertEqual(2);
// console.info(TAG + "SET_GET_ZOOM_2_PROMISE PASSED ");
// } else {
// console.info(TAG + "SET_GET_ZOOM_2_PROMISE FAILED");
// expect().assertFail();
// }
// await sleep(1);
// done();
// })
/**
* @tc.number : SET_GET_ZOOM_3_PROMISE
* @tc.name : Zoom camera-0 cameraId api
* @tc.desc : Zoom camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
// FIXME: no use testcase
// it('VP_SET_GET_ZOOM_3_PROMISE', 0, async function (done) {
// var setpromise = await camera0InputPromise.setZoomRatio(3);
// console.info(TAG + "setZoomRatio success: 3");
// console.info(TAG + "getZoomRatio called")
// var getpromise3 = await camera0InputPromise.getZoomRatio();
// console.info(TAG + "getZoomRatio success: " + getpromise3);
// if (getpromise3 != null && getpromise3 != undefined) {
// expect(getpromise3).assertEqual(3);
// console.info(TAG + "SET_GET_ZOOM_3_PROMISE PASSED ");
// }
// else {
// console.info(TAG + "SET_GET_ZOOM_3_PROMISE FAILED");
// expect().assertFail();
// }
// await sleep(1);
// done();
// })
// /**
// * @tc.number : SET_GET_ZOOM_4_PROMISE
// * @tc.name : Zoom camera-0 cameraId api
// * @tc.desc : Zoom camera-0 cameraId api
// * @tc.size : MEDIUM
// * @tc.type : Function
// * @tc.level : Level 0
// */
// FIXME: no use testcase
// it('VP_SET_GET_ZOOM_4_PROMISE', 0, async function (done) {
// var setpromise = await camera0InputPromise.setZoomRatio(4);
// console.info(TAG + "setZoomRatio success: 4");
// console.info(TAG + "getZoomRatio called")
// var getpromise4 = await camera0InputPromise.getZoomRatio();
// console.info(TAG + "getZoomRatio success: " + getpromise4);
// if (getpromise4 != null && getpromise4 != undefined) {
// expect(getpromise4).assertEqual(4);
// console.info(TAG + "SET_GET_ZOOM_4_PROMISE PASSED ");
// }
// else {
// console.info(TAG + "SET_GET_ZOOM_4_PROMISE FAILED");
// expect().assertFail();
// }
// await sleep(1);
// done();
// })
/**
* @tc.number : SET_GET_ZOOM_5_PROMISE
* @tc.name : Zoom camera-0 cameraId api
* @tc.desc : Zoom camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
// FIXME: no use testcase
// it('VP_SET_GET_ZOOM_5_PROMISE', 0, async function (done) {
// var setpromise = await camera0InputPromise.setZoomRatio(5);
// console.info(TAG + "setZoomRatio success: 5");
// console.info(TAG + "getZoomRatio called")
// var getpromise5 = await camera0InputPromise.getZoomRatio();
// console.info(TAG + "getZoomRatio success: " + getpromise5);
// if (getpromise5 != null && getpromise5 != undefined) {
// expect(getpromise5).assertEqual(5);
// console.info(TAG + "SET_GET_ZOOM_5_PROMISE PASSED ");
// }
// else {
// console.info(TAG + "SET_GET_ZOOM_5_PROMISE FAILED");
// expect().assertFail();
// }
// await sleep(1);
// done();
// })
/**
* @tc.number : SET_GET_ZOOM_6_PROMISE
* @tc.name : Zoom camera-0 cameraId api
* @tc.desc : Zoom camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
// FIXME: no use testcase
// it('VP_SET_GET_ZOOM_6_PROMISE', 0, async function (done) {
// var setpromise = await camera0InputPromise.setZoomRatio(6);
// console.info(TAG + "setZoomRatio success: 6");
// console.info(TAG + "getZoomRatio called")
// var getpromise6 = await camera0InputPromise.getZoomRatio();
// console.info(TAG + "getZoomRatio success: " + getpromise6);
// if (getpromise6 != null && getpromise6 != undefined) {
// expect(getpromise6).assertEqual(6);
// console.info(TAG + "SET_GET_ZOOM_6_PROMISE PASSED ");
// }
// else {
// console.info(TAG + "SET_GET_ZOOM_6_PROMISE FAILED");
// expect().assertFail();
// }
// await sleep(1);
// done();
// })
// FOCUS promise API's
/**
* @tc.number : IS_FOCUS_MODE_LOCKED_SUPPORTED
......@@ -3111,59 +2885,6 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
done();
})
/**
* @tc.number : IS_EXPOSURE_MODE_LOCKED_SUPPORTED
* @tc.name : check is exposure mode locked supported-camera0Input api
* @tc.desc : check is exposure mode locked supported-camera0Input api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
/* EXPOSUREMODE Interface will be change
it('VP_IS_EXPOSURE_MODE_LOCKED_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering IS_EXPOSURE_MODE_LOCKED_SUPPORTED to operate");
await camera0InputPromise.isExposureModeSupported(cameraObj.ExposureMode.EXPOSURE_MODE_LOCKED)
.then(function (data) {
console.info(TAG + "Entering IS_EXPOSURE_MODE_LOCKED_SUPPORTED PASSED: " + data);
expect(data).assertEqual(false);
})
.catch((err) => {
console.info(TAG + "IS_EXPOSURE_MODE_LOCKED_SUPPORTED FAILED : " + err.message);
expect().assertFail();
});
console.info(TAG + "IS_EXPOSURE_MODE_LOCKED_SUPPORTED ends here");
await sleep(1);
done();
})
*/
/**
* @tc.number : SET_EXPOSURE_MODE_LOCKED
* @tc.name : set exposure mode locked camera0 api
* @tc.desc : set exposure mode locked camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
/* EXPOSUREMODE Interface will be change
it('VP_SET_EXPOSURE_MODE_LOCKED', 0, async function (done) {
console.info(TAG + "Entering SET_EXPOSURE_MODE_Locked to operate");
await camera0InputPromise.setExposureMode(cameraObj.ExposureMode.EXPOSURE_MODE_LOCKED)
.then(function () {
console.info(TAG + "Entering set exposure mode auto SUCCESS, current ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_LOCKED);
console.info(TAG + "Entering SET_EXPOSURE_MODE_Locked FAILED")
expect().assertFail()
})
.catch((err) => {
console.info(TAG + "Entering SET_EXPOSURE_MODE_LOCKED PASSED : " + err.message);
expect(true).assertTrue();
});
console.info(TAG + "Entering SET_EXPOSURE_MODE_LOCKED ends here");
await sleep(1);
done();
})
*/
/**
* @tc.number : GET_EXPOSURE_MODE_LOCKED
* @tc.name : get exposure mode locked camera0 api
......@@ -3275,141 +2996,48 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
* @tc.type : Function
* @tc.level : Level 0
*/
// it('VP_SET_EXPOSURE_BIAS', 0, async function (done) {
// console.info(TAG + "Entering SET_EXPOSURE_BIAS to operate");
// await camera0InputPromise.setExposureBias(-4)
// .then(function (data) {
// console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + JSON.stringify(data));
// console.info(TAG + "Entering SET_EXPOSURE_BIAS PASSED")
// expect(true).assertTrue();
// })
// .catch((err) => {
// console.info(TAG + "Entering SET_EXPOSURE_BIAS FAILED : " + err.message);
// expect().assertFail();
// });
// console.info(TAG + "Entering SET_EXPOSURE_BIAS ends here");
// await sleep(1);
// done();
// })
/**
* @tc.number : GET_EXPOSURE_VALUE_exposure mode locked
* @tc.name : get exposure value camera0 api
* @tc.desc : get exposure value camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('VP_SET_GET_EXPOSURE_VALUE_NEG4', 0, async function (done) {
console.info(TAG + "Entering VP_SET_GET_EXPOSURE_VALUE_NEG4 to operate");
it('VP_SET_EXPOSURE_BIAS', 0, async function (done) {
console.info(TAG + "Entering SET_EXPOSURE_BIAS to operate");
await camera0InputPromise.setExposureBias(-4)
.then(function (data) {
console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + JSON.stringify(data));
console.info(TAG + "Entering SET_EXPOSURE_BIAS PASSED")
// expect(true).assertTrue();
expect(true).assertTrue();
})
.catch((err) => {
console.info(TAG + "Entering SET_EXPOSURE_BIAS FAILED : " + err.message);
expect().assertFail();
});
console.info(TAG + "Entering SET_EXPOSURE_BIAS ends here");
await camera0InputPromise.getExposureValue()
.then(function (data) {
console.info(TAG + "Entering getExposureValue SUCCESS");
console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data));
expect(data).assertEqual(-4);
console.info(TAG + "GET_EXPOSURE_VALUE PASSED");
})
.catch((err) => {
expect().assertFail();
console.info(TAG + "GET_EXPOSURE_VALUE FAILED : " + err.message);
});
console.info(TAG + "GET_EXPOSURE_VALUE ends here");
await sleep(1);
done();
})
/**
* @tc.number : IS_EXPOSURE_MODE_AUTO_SUPPORTED
* @tc.name : check is exposure mode auto supported-camera0Input api
* @tc.desc : check is exposure mode auto supported-camera0Input api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
/* EXPOSUREMODE Interface will be change
it('VP_IS_EXPOSURE_MODE_AUTO_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering IS_EXPOSURE_MODE_AUTO_SUPPORTED to operate");
await camera0InputPromise.isExposureModeSupported(cameraObj.ExposureMode.EXPOSURE_MODE_AUTO)
.then(function (data) {
console.info(TAG + "Entering IS_EXPOSURE_MODE_AUTO_SUPPORTED PASSED: " + data);
expect(data).assertEqual(true);
})
.catch((err) => {
console.info(TAG + "IS_EXPOSURE_MODE_AUTO_SUPPORTED FAILED: " + err.message);
expect().assertFail();
});
console.info(TAG + "IS_EXPOSURE_MODE_AUTO_SUPPORTED ends here");
await sleep(1);
done();
})
*/
/**
* @tc.number : SET_EXPOSURE_MODE_AUTO
* @tc.name : set exposure mode auto camera0 api
* @tc.desc : set exposure mode auto camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
/* EXPOSUREMODE Interface will be change
it('VP_SET_EXPOSURE_MODE_AUTO', 0, async function (done) {
console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO to operate");
await camera0InputPromise.setExposureMode(cameraObj.ExposureMode.EXPOSURE_MODE_AUTO)
.then(function () {
console.info(TAG + "Entering set exposure mode auto SUCCESS, current ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_AUTO);
console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO PASSED")
expect(cameraObj.ExposureMode.EXPOSURE_MODE_AUTO).assertEqual(1);
})
.catch((err) => {
console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO FAILED : " + err.message);
expect().assertFail();
});
console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO ends here");
await sleep(1);
done();
})
*/
/**
* @tc.number : GET_EXPOSURE_MODE_AUTO
* @tc.name : get exposure mode auto camera0 api
* @tc.desc : get exposure mode auto camera0 api
* @tc.number : GET_EXPOSURE_VALUE_exposure mode locked
* @tc.name : get exposure value camera0 api
* @tc.desc : get exposure value camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
/* EXPOSUREMODE Interface will be change
it('VP_GET_EXPOSURE_MODE_AUTO', 0, async function (done) {
console.info(TAG + "Entering GET_EXPOSURE_MODE_AUTO to operate");
await camera0InputPromise.getExposureMode()
it('VP_SET_GET_EXPOSURE_VALUE', 0, async function (done) {
console.info(TAG + "Entering VP_SET_GET_EXPOSURE_VALUE to operate");
await camera0InputPromise.getExposureValue()
.then(function (data) {
console.info(TAG + "Entering get exposure mode auto SUCCESS");
console.info(TAG + "Current exposureMode is: " + data);
expect(data).assertEqual(1);
console.info(TAG + "GET_EXPOSURE_MODE_AUTO PASSED");
console.info(TAG + "Entering getExposureValue SUCCESS");
console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data));
expect(true).assertTrue();
console.info(TAG + "GET_EXPOSURE_VALUE PASSED");
})
.catch((err) => {
expect().assertFail();
console.info(TAG + "GET_EXPOSURE_MODE_AUTO FAILED: " + err.message);
console.info(TAG + "GET_EXPOSURE_VALUE FAILED : " + err.message);
});
console.info(TAG + "GET_EXPOSURE_MODE_AUTO ends here");
console.info(TAG + "GET_EXPOSURE_VALUE ends here");
await sleep(1);
done();
})
*/
/**
* @tc.number : SET_EXPOSURE_POINT_exposure mode auto
......@@ -3462,150 +3090,6 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
done();
})
/**
* @tc.number : SET_EXPOSURE_BIAS_exposure mode auto
* @tc.name : set exposure bias camera0 api
* @tc.desc : set exposure bias camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
// it('VP_SET_EXPOSURE_BIAS', 0, async function (done) {
// console.info(TAG + "Entering SET_EXPOSURE_BIAS to operate");
// await camera0InputPromise.setExposureBias(1)
// .then(function (data) {
// console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + JSON.stringify(data));
// console.info(TAG + "Entering SET_EXPOSURE_BIAS PASSED")
// expect(true).assertTrue();
// })
// .catch((err) => {
// console.info(TAG + "Entering SET_EXPOSURE_BIAS FAILED : " + err.message);
// expect().assertFail();
// });
// console.info(TAG + "Entering SET_EXPOSURE_BIAS ends here");
// await sleep(1);
// done();
// })
/**
* @tc.number : GET_EXPOSURE_VALUE_exposure mode auto
* @tc.name : get exposure value camera0 api
* @tc.desc : get exposure value camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('VP_GET_EXPOSURE_VALUE_POS1', 0, async function (done) {
console.info(TAG + "Entering GET_EXPOSURE_VALUE to operate");
await camera0InputPromise.setExposureBias(1)
.then(function (data) {
console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + JSON.stringify(data));
console.info(TAG + "Entering SET_EXPOSURE_BIAS PASSED")
// expect(true).assertTrue();
})
.catch((err) => {
console.info(TAG + "Entering SET_EXPOSURE_BIAS FAILED : " + err.message);
expect().assertFail();
});
console.info(TAG + "Entering SET_EXPOSURE_BIAS ends here");
await camera0InputPromise.getExposureValue()
.then(function (data) {
console.info(TAG + "Entering getExposureValue SUCCESS");
console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data));
expect(data).assertEqual(1);
console.info(TAG + "GET_EXPOSURE_VALUE PASSED");
})
.catch((err) => {
expect().assertFail();
console.info(TAG + "GET_EXPOSURE_VALUE FAILED : " + err.message);
});
console.info(TAG + "GET_EXPOSURE_VALUE ends here");
await sleep(1);
done();
})
/**
* @tc.number : IS_EXPOSURE_MODE_CONTINUOUS_AUTO
* @tc.name : check is exposure mode continuous auto supported-camera0Input api
* @tc.desc : check is exposure mode continuous auto supported-camera0Input api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
/* EXPOSUREMODE Interface will be change
it('VP_IS_EXPOSURE_MODE_CONTINUOUS_AUTO', 0, async function (done) {
console.info(TAG + "Entering IS_EXPOSURE_MODE_CONTINUOUS_AUTO to operate");
await camera0InputPromise.isExposureModeSupported(cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO)
.then(function (data) {
console.info(TAG + "Entering IS_EXPOSURE_MODE_CONTINUOUS_AUTO PASSED: " + data);
expect(data).assertEqual(false);
})
.catch((err) => {
console.info(TAG + "IS_EXPOSURE_MODE_CONTINUOUS_AUTO FAILED : " + err.message);
expect().assertFail();
});
console.info(TAG + "IS_EXPOSURE_MODE_CONTINUOUS_AUTO ends here");
await sleep(1);
done();
})
*/
/**
* @tc.number : SET_EXPOSURE_MODE_CONTINUOUS_AUTO
* @tc.name : set exposure mode continuous auto camera0 api
* @tc.desc : set exposure mode continuous auto camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
/* EXPOSUREMODE Interface will be change
it('VP_SET_EXPOSURE_MODE_CONTINUOUS_AUTO', 0, async function (done) {
console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO to operate");
await camera0InputPromise.setExposureMode(cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO)
.then(function () {
console.info(TAG + "Entering set exposure mode auto SUCCESS, current ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO);
console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO FAILED")
expect().assertFail();
})
.catch((err) => {
console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO PASSED : " + err.message);
expect(true).assertTrue();
});
console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO ends here");
await sleep(1);
done();
})
*/
/**
* @tc.number : GET_EXPOSURE_MODE_CONTINUOUS_AUTO
* @tc.name : get exposure mode continuous auto camera0 api
* @tc.desc : get exposure mode continuous auto camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
/* EXPOSUREMODE Interface will be change
it('VP_GET_EXPOSURE_MODE_CONTINUOUS_AUTO', 0, async function (done) {
console.info(TAG + "Entering GET_EXPOSURE_MODE_CONTINUOUS_AUTO to operate");
await camera0InputPromise.getExposureMode()
.then(function (data) {
console.info(TAG + "Entering get exposure mode auto SUCCESS");
console.info(TAG + "Current exposureMode is: " + data);
expect(true).assertTrue();
console.info(TAG + "GET_EXPOSURE_MODE_CONTINUOUS_AUTO PASSED");
})
.catch((err) => {
expect().assertFail();
console.info(TAG + "GET_EXPOSURE_MODE_CONTINUOUS_AUTO FAILED : " + err.message);
});
console.info(TAG + "GET_EXPOSURE_MODE_CONTINUOUS_AUTO ends here");
await sleep(1);
done();
})
*/
/**
* @tc.number : SET_EXPOSURE_POINT
* @tc.name : set exposure Point camera0 api
......@@ -3682,116 +3166,6 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
done();
})
/**
* @tc.number : GET_EXPOSURE_VALUE
* @tc.name : get exposure value camera0 api
* @tc.desc : get exposure value camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('VP_SET_GET_EXPOSURE_VALUE_POS4', 0, async function (done) {
console.info(TAG + "Entering GET_EXPOSURE_VALUE to operate");
await camera0InputPromise.setExposureBias(4)
.then(function (data) {
console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + JSON.stringify(data));
console.info(TAG + "Entering SET_EXPOSURE_BIAS PASSED")
// expect(true).assertTrue();
})
.catch((err) => {
console.info(TAG + "Entering SET_EXPOSURE_BIAS FAILED : " + err.message);
expect().assertFail();
});
console.info(TAG + "Entering SET_EXPOSURE_BIAS ends here");
await camera0InputPromise.getExposureValue()
.then(function (data) {
console.info(TAG + "Entering getExposureValue SUCCESS");
console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data));
expect(data).assertEqual(4);
console.info(TAG + "GET_EXPOSURE_VALUE PASSED");
})
.catch((err) => {
expect().assertFail();
console.info(TAG + "GET_EXPOSURE_VALUE FAILED : " + err.message);
});
console.info(TAG + "GET_EXPOSURE_VALUE ends here");
await sleep(1);
done();
})
/**
* @tc.number : VIDEO_OUTPUT_START_PROMISE
* @tc.name : VideoOutput start promise api
* @tc.desc : VideoOutput start promise api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('VP_VIDEO_OUTPUT_START_PROMISE', 0, async function (done) {
if (videoOutputPromise == null || videoOutputPromise == undefined) {
console.info(TAG + 'Entering Video Output start videoOutputPromise == null || undefined')
} else {
console.info(TAG + 'Entering VIDEO_OUTPUT_START_PROMISE to operate')
await videoOutputPromise.start()
expect(true).assertTrue()
console.info(TAG + 'Entering VIDEO_OUTPUT_START_PROMISE PASSED')
console.info(TAG + 'Entering VIDEO_OUTPUT_START_PROMISE ends here')
await sleep(1)
done()
}
await sleep(1)
done()
})
/**
* @tc.number : VIDEO_OUTPUT_STOP_PROMISE
* @tc.name : VideoOutput stop promise api
* @tc.desc : VideoOutput stop promise api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('VP_VIDEO_OUTPUT_STOP_PROMISE', 0, async function (done) {
if (videoOutputPromise == null || videoOutputPromise == undefined) {
console.info(TAG + 'Entering Video Output Stop videoOutputPromise == null || undefined')
} else {
console.info(TAG + 'Entering VIDEO_OUTPUT_STOP_PROMISE to operate')
await videoOutputPromise.stop()
expect(true).assertTrue()
console.info(TAG + 'Entering VIDEO_OUTPUT_STOP_PROMISE PASSED')
console.info(TAG + 'Entering VIDEO_OUTPUT_STOP_PROMISE ends here')
await sleep(1)
done()
}
await sleep(1)
done()
})
/**
* @tc.number : CAPTURE_SESSION_STOP_PROMISE
* @tc.name : CaptureSession stop promise api
* @tc.desc : CaptureSession stop promise api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('VP_CAPTURE_SESSION_STOP_PROMISE', 0, async function (done) {
if (captureSessionPromise == null || captureSessionPromise == undefined) {
console.info(TAG + 'Entering Capture Session Stop captureSessionPromise == null || undefined')
} else {
console.info(TAG + 'Entering CAPTURE_SESSION_STOP_PROMISE to operate')
await captureSessionPromise.stop()
expect(true).assertTrue()
console.info(TAG + 'Entering CAPTURE_SESSION_STOP_PROMISE PASSED')
console.info(TAG + 'Entering CAPTURE_SESSION_STOP_PROMISE ends here')
await sleep(1)
done()
}
await sleep(1)
done()
})
/**
* @tc.number : CAPTURE_SESSION_RELEASE_PROMISE
* @tc.name : CaptureSession release promise api
......@@ -3888,4 +3262,4 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
done()
})
})
}
\ No newline at end of file
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册