未验证 提交 013a80a8 编写于 作者: O openharmony_ci 提交者: Gitee

!3310 update camera_xts_acts test cases

Merge pull request !3310 from veereshkadasani/camer_ets_3.2_beta1
...@@ -29,7 +29,5 @@ export default function cameraKit(surfaceId: any) { ...@@ -29,7 +29,5 @@ export default function cameraKit(surfaceId: any) {
cameraJSUnitEnum(surfaceId) cameraJSUnitEnum(surfaceId)
cameraJSUnitCameraFormat(surfaceId) cameraJSUnitCameraFormat(surfaceId)
cameraJSUnitPhotoAsync(surfaceId) cameraJSUnitPhotoAsync(surfaceId)
cameraJSUnitPhotoPromise(surfaceId)
cameraJSUnitVideoAsync(surfaceId) cameraJSUnitVideoAsync(surfaceId)
cameraJSUnitVideoPromise(surfaceId)
} }
\ No newline at end of file
...@@ -161,6 +161,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -161,6 +161,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
done(); done();
}) })
/** /**
* @tc.number : CAMERA_STATUS_CALLBACK * @tc.number : CAMERA_STATUS_CALLBACK
* @tc.name : camera status callback on CameraManager async api * @tc.name : camera status callback on CameraManager async api
...@@ -180,11 +181,11 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -180,11 +181,11 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
if (data != null || data != undefined) { if (data != null || data != undefined) {
console.info(TAG + "Camera status Callback CameraStatusInfo_Camera: " + data.camera); console.info(TAG + "Camera status Callback CameraStatusInfo_Camera: " + data.camera);
console.info(TAG + "Camera status Callback CameraStatusInfo_Status: " + data.status); console.info(TAG + "Camera status Callback CameraStatusInfo_Status: " + data.status);
expect(true).assertTrue(); expect(true).assertTrue();
} }
} else { } else {
expect().assertFail(); expect().assertFail();
console.info(TAG + "Camera status Callback FAILED: " + err.message);
} }
await sleep(1000); await sleep(1000);
done(); done();
...@@ -194,6 +195,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -194,6 +195,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
done(); done();
}) })
/** /**
* @tc.number : GET_CAMERAS * @tc.number : GET_CAMERAS
* @tc.name : Get camera from cameramanager to get array of camera async api * @tc.name : Get camera from cameramanager to get array of camera async api
...@@ -241,6 +243,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -241,6 +243,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
done(); done();
}) })
/*CAMERA-0 Scripts*/ /*CAMERA-0 Scripts*/
/** /**
* @tc.number : CREATE_CAMERA_INPUT * @tc.number : CREATE_CAMERA_INPUT
...@@ -272,13 +275,13 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -272,13 +275,13 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
}) })
/** /**
* @tc.number : CAMERA_INPUT_CALLBACK_ON_ERROR * @tc.number : CAMERA_INPUT_CALLBACK_ON_ERROR
* @tc.name : Photo output callback on error api * @tc.name : Photo output callback on error api
* @tc.desc : Photo output callback on error api * @tc.desc : Photo output callback on error api
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('CAMERA_INPUT_CALLBACK_ON_ERROR', 0, async function (done) { it('CAMERA_INPUT_CALLBACK_ON_ERROR', 0, async function (done) {
if (camera0Input == null || camera0Input == undefined) { if (camera0Input == null || camera0Input == undefined) {
console.info(TAG + "Entering CAMERA_INPUT_CALLBACK_ON_ERROR cameraInput == null || undefined"); console.info(TAG + "Entering CAMERA_INPUT_CALLBACK_ON_ERROR cameraInput == null || undefined");
...@@ -293,7 +296,6 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -293,7 +296,6 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
} }
} else { } else {
expect().assertFail(); expect().assertFail();
console.info(TAG + "Error in CameraInputCallback FAILED: " + err.message);
} }
await sleep(1000); await sleep(1000);
done(); done();
...@@ -312,6 +314,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -312,6 +314,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('CREATE_PREVIEW_OUTPUT_SUCCESS', 0, async function (done) { it('CREATE_PREVIEW_OUTPUT_SUCCESS', 0, async function (done) {
console.info(TAG + " Entering CREATE_PREVIEW_OUTPUT_SUCCESS to operate"); console.info(TAG + " Entering CREATE_PREVIEW_OUTPUT_SUCCESS to operate");
cameraObj.createPreviewOutput(surfaceId, async (err, data) => { cameraObj.createPreviewOutput(surfaceId, async (err, data) => {
...@@ -342,7 +345,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -342,7 +345,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('PREVIEW_OUTPUT_CALLBACK_ON_ERROR', 0, async function (done) { it('PREVIEW_OUTPUT_CALLBACK_ON_ERROR', 0, async function (done) {
if (previewOutputAsync == null || previewOutputAsync == undefined) { if (previewOutputAsync == null || previewOutputAsync == undefined) {
console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_ERROR previewOutput == null || undefined"); console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_ERROR previewOutput == null || undefined");
...@@ -357,7 +360,6 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -357,7 +360,6 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
} }
} else { } else {
expect().assertFail(); expect().assertFail();
console.info(TAG + "PREVIEW_OUTPUT_CALLBACK FAILED: " + err.message);
} }
await sleep(1000); await sleep(1000);
done(); done();
...@@ -376,6 +378,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -376,6 +378,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('CREATE_PHOTO_OUTPUT_SUCCESS', 0, async function (done) { it('CREATE_PHOTO_OUTPUT_SUCCESS', 0, async function (done) {
console.info(TAG + "Entering CREATE_PHOTO_OUTPUT_SUCCESS to operate"); console.info(TAG + "Entering CREATE_PHOTO_OUTPUT_SUCCESS to operate");
console.info(TAG + 'Entering getImageReceiverSurfaceId') console.info(TAG + 'Entering getImageReceiverSurfaceId')
...@@ -403,13 +406,13 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -403,13 +406,13 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
}) })
/** /**
* @tc.number : PHOTO_OUTPUT_CALLBACK_ON_ERROR * @tc.number : PHOTO_OUTPUT_CALLBACK_ON_ERROR
* @tc.name : Photo output callback on error api * @tc.name : Photo output callback on error api
* @tc.desc : Photo output callback on error api * @tc.desc : Photo output callback on error api
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('PHOTO_OUTPUT_CALLBACK_ON_ERROR', 0, async function (done) { it('PHOTO_OUTPUT_CALLBACK_ON_ERROR', 0, async function (done) {
if (photoOutputAsync == null || photoOutputAsync == undefined) { if (photoOutputAsync == null || photoOutputAsync == undefined) {
console.info(TAG + "Entering PHOTO_OUTPUT_CALLBACK_ON_ERROR photoOutput == null || undefined"); console.info(TAG + "Entering PHOTO_OUTPUT_CALLBACK_ON_ERROR photoOutput == null || undefined");
...@@ -424,7 +427,6 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -424,7 +427,6 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
} }
} else { } else {
expect().assertFail(); expect().assertFail();
console.info(TAG + "PHOTO_OUTPUT_CALLBACK_ON_ERROR FAILED: " + err.message);
} }
await sleep(1000); await sleep(1000);
done(); done();
...@@ -474,7 +476,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -474,7 +476,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('CAP_SES_CALLBACK_ON_ERROR', 0, async function (done) { it('CAP_SES_CALLBACK_ON_ERROR', 0, async function (done) {
if (captureSession == null || captureSession == undefined) { if (captureSession == null || captureSession == undefined) {
console.info(TAG + "Entering CAP_SES_CALLBACK_ON_ERROR captureSession == null || undefined"); console.info(TAG + "Entering CAP_SES_CALLBACK_ON_ERROR captureSession == null || undefined");
...@@ -489,7 +491,6 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -489,7 +491,6 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
} }
} else { } else {
expect().assertFail(); expect().assertFail();
console.info(TAG + "Error in CaptureSessioncallback FAILED: " + err.message);
} }
await sleep(1000); await sleep(1000);
done(); done();
...@@ -529,6 +530,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -529,6 +530,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
await sleep(1000); await sleep(1000);
done(); done();
}) })
await sleep(1000); await sleep(1000);
done(); done();
} }
...@@ -541,7 +543,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -541,7 +543,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('ADD_INPUT_SUCCESS', 0, async function (done) { it('ADD_INPUT_SUCCESS', 0, async function (done) {
if (captureSession == null || captureSession == undefined) { if (captureSession == null || captureSession == undefined) {
console.info(TAG + "Entering ADD_INPUT_SUCCESS captureSession == null || undefined"); console.info(TAG + "Entering ADD_INPUT_SUCCESS captureSession == null || undefined");
...@@ -575,7 +577,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -575,7 +577,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('ADD_OUTPUT_PREVIEW_SUCCESS', 0, async function (done) { it('ADD_OUTPUT_PREVIEW_SUCCESS', 0, async function (done) {
if (captureSession == null || captureSession == undefined) { if (captureSession == null || captureSession == undefined) {
console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS captureSession == null || undefined"); console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS captureSession == null || undefined");
...@@ -607,7 +609,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -607,7 +609,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('ADD_OUTPUT_PHOTO_SUCCESS', 0, async function (done) { it('ADD_OUTPUT_PHOTO_SUCCESS', 0, async function (done) {
if (captureSession == null || captureSession == undefined) { if (captureSession == null || captureSession == undefined) {
console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS captureSession == null || undefined"); console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS captureSession == null || undefined");
...@@ -694,8 +696,8 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -694,8 +696,8 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
done(); done();
}) })
await sleep(1000); await sleep(1000);
done();
} }
done();
}) })
/** /**
...@@ -737,7 +739,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -737,7 +739,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('ADD_INPUT_SUCCESS', 0, async function (done) { it('ADD_INPUT_SUCCESS', 0, async function (done) {
if (captureSession == null || captureSession == undefined) { if (captureSession == null || captureSession == undefined) {
console.info(TAG + "Entering ADD_INPUT_SUCCESS captureSession == null || undefined"); console.info(TAG + "Entering ADD_INPUT_SUCCESS captureSession == null || undefined");
...@@ -771,7 +773,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -771,7 +773,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('ADD_OUTPUT_PREVIEW_SUCCESS', 0, async function (done) { it('ADD_OUTPUT_PREVIEW_SUCCESS', 0, async function (done) {
if (captureSession == null || captureSession == undefined) { if (captureSession == null || captureSession == undefined) {
console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS captureSession == null || undefined"); console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS captureSession == null || undefined");
...@@ -803,7 +805,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -803,7 +805,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('ADD_OUTPUT_PHOTO_SUCCESS', 0, async function (done) { it('ADD_OUTPUT_PHOTO_SUCCESS', 0, async function (done) {
if (captureSession == null || captureSession == undefined) { if (captureSession == null || captureSession == undefined) {
console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS captureSession == null || undefined"); console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS captureSession == null || undefined");
...@@ -837,7 +839,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -837,7 +839,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('COMMIT_CONFIG_SUCCESS', 0, async function (done) { it('COMMIT_CONFIG_SUCCESS', 0, async function (done) {
if (captureSession == null || captureSession == undefined) { if (captureSession == null || captureSession == undefined) {
console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS captureSession == null || undefined"); console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS captureSession == null || undefined");
...@@ -872,7 +874,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -872,7 +874,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START', 0, async function (done) { it('PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START', 0, async function (done) {
if (previewOutputAsync == null || previewOutputAsync == undefined) { if (previewOutputAsync == null || previewOutputAsync == undefined) {
console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START previewOutput == null || undefined"); console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START previewOutput == null || undefined");
...@@ -882,12 +884,10 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -882,12 +884,10 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
if (!err) { if (!err) {
console.info(TAG + "PreviewStart frameStart Callback is success"); console.info(TAG + "PreviewStart frameStart Callback is success");
if (data != null || data != undefined) { if (data != null || data != undefined) {
console.info(TAG + "Error during PreviewOutput with ErrorCode: " + data.code);
expect(true).assertTrue(); expect(true).assertTrue();
} }
} else { } else {
expect().assertFail(); expect().assertFail()
console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START FAILED : + err.message");
} }
await sleep(1000); await sleep(1000);
done(); done();
...@@ -904,7 +904,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -904,7 +904,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END', 0, async function (done) { it('PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END', 0, async function (done) {
if (previewOutputAsync == null || previewOutputAsync == undefined) { if (previewOutputAsync == null || previewOutputAsync == undefined) {
console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END previewOutput == null || undefined"); console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END previewOutput == null || undefined");
...@@ -918,7 +918,6 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -918,7 +918,6 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
} }
} else { } else {
expect().assertFail(); expect().assertFail();
console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END FAILED : + err.message");
} }
await sleep(1000); await sleep(1000);
done(); done();
...@@ -936,7 +935,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -936,7 +935,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('PHOTO_CAP_CALLBACK_ON_CAPTURE_START', 0, async function (done) { it('PHOTO_CAP_CALLBACK_ON_CAPTURE_START', 0, async function (done) {
if (photoOutputAsync == null || photoOutputAsync == undefined) { if (photoOutputAsync == null || photoOutputAsync == undefined) {
console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_CAPTURE_START photoOutput == null || undefined"); console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_CAPTURE_START photoOutput == null || undefined");
...@@ -950,8 +949,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -950,8 +949,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
expect(true).assertTrue(); expect(true).assertTrue();
} }
} else { } else {
expect().assertFail(); expect().assertFail()
console.info(TAG + "PHOTO_CAP_CALLBACK_ON_CAPTURE_START FAILED: " + err.message);
} }
await sleep(1000); await sleep(1000);
done(); done();
...@@ -968,7 +966,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -968,7 +966,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('PHOTO_CAP_CALLBACK_ON_CAPTURE_END', 0, async function (done) { it('PHOTO_CAP_CALLBACK_ON_CAPTURE_END', 0, async function (done) {
if (photoOutputAsync == null || photoOutputAsync == undefined) { if (photoOutputAsync == null || photoOutputAsync == undefined) {
console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_CAPTURE_END photoOutput == null || undefined"); console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_CAPTURE_END photoOutput == null || undefined");
...@@ -984,7 +982,6 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -984,7 +982,6 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
} }
} else { } else {
expect().assertFail(); expect().assertFail();
console.info(TAG + 'PHOTO_CAP_CALLBACK_ON_CAPTURE_END FAILED' + err.message);
} }
await sleep(1000); await sleep(1000);
done(); done();
...@@ -1001,7 +998,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -1001,7 +998,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER', 0, async function (done) { it('PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER', 0, async function (done) {
if (photoOutputAsync == null || photoOutputAsync == undefined) { if (photoOutputAsync == null || photoOutputAsync == undefined) {
console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER photoOutput == null || undefined"); console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER photoOutput == null || undefined");
...@@ -1017,7 +1014,6 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -1017,7 +1014,6 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
} }
} else { } else {
expect().assertFail(); expect().assertFail();
console.info(TAG + "PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER FAILED: " + err.message);
} }
await sleep(1000); await sleep(1000);
done(); done();
...@@ -1034,7 +1030,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -1034,7 +1030,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('CAPTURE_SESSION_START_SUCCESS', 0, async function (done) { it('CAPTURE_SESSION_START_SUCCESS', 0, async function (done) {
if (captureSession == null || captureSession == undefined) { if (captureSession == null || captureSession == undefined) {
console.info(TAG + "Entering CAPTURE_SESSION_START_SUCCESS captureSession == null || undefined"); console.info(TAG + "Entering CAPTURE_SESSION_START_SUCCESS captureSession == null || undefined");
...@@ -1064,7 +1060,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -1064,7 +1060,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('HAS_FLASH', 0, async function (done) { it('HAS_FLASH', 0, async function (done) {
console.info(TAG + "hasFlash called.") console.info(TAG + "hasFlash called.")
camera0Input.hasFlash(async (err, data) => { camera0Input.hasFlash(async (err, data) => {
...@@ -1072,12 +1068,12 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -1072,12 +1068,12 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
console.info(TAG + "Entering HAS_FLASH success"); console.info(TAG + "Entering HAS_FLASH success");
if (data != null || data != undefined) { if (data != null || data != undefined) {
console.info(TAG + "Entering HAS_FLASH data is not null || undefined"); console.info(TAG + "Entering HAS_FLASH data is not null || undefined");
expect(true).assertTrue();
console.info(TAG + "Entering HAS_FLASH PASSED with HAS_FLASH is: " + data); console.info(TAG + "Entering HAS_FLASH PASSED with HAS_FLASH is: " + data);
expect(data).assertEqual(true);
} }
} else { } else {
console.info(TAG + "Entering HAS_FLASH FAILED" + err.message);
expect().assertFail(); expect().assertFail();
console.info(TAG + "Entering HAS_FLASH FAILED" + err.message);
} }
console.info(TAG + "Entering HAS_FLASH ends here"); console.info(TAG + "Entering HAS_FLASH ends here");
}) })
...@@ -1092,7 +1088,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -1092,7 +1088,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('IS_FLASH_MODE_OPEN_SUPPORTED', 0, async function (done) { it('IS_FLASH_MODE_OPEN_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED to operate"); console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED to operate");
camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_OPEN, async (err, data) => { camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_OPEN, async (err, data) => {
...@@ -1101,81 +1097,22 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -1101,81 +1097,22 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
if (data != null || data != undefined) { if (data != null || data != undefined) {
console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED data is not null || undefined"); console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED data is not null || undefined");
console.info(TAG + "FLASH_MODE_OPEN supported is: " + data); console.info(TAG + "FLASH_MODE_OPEN supported is: " + data);
expect(data).assertEqual(true); expect(true).assertTrue();
console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED PASSED"); console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED PASSED");
} }
} else { } else {
console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED FAILED" + err.message); console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED FAILED" + err.message);
expect().assertFail();
console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED ends here"); console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED ends here");
} }
await sleep(1000); await sleep(1000);
done(); done();
}) })
await sleep(1000);
done();
})
/**
* @tc.number : SET_FLASH_MODE_OPEN
* @tc.name : set flash mode open camera0 api
* @tc.desc : set flash mode open camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FLASH_MODE_OPEN', 0, async function (done) {
console.info(TAG + "Entering SET_FLASH_MODE_OPEN to operate");
camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_OPEN, async (err, data) => {
if (!err) {
console.info(TAG + "Entering SET_FLASH_MODE_OPEN SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN);
console.info(TAG + "Entering SET_FLASH_MODE_OPEN PASSED")
expect(cameraObj.FlashMode.FLASH_MODE_OPEN).assertEqual(1);
}
else {
console.info(TAG + "Entering SET_FLASH_MODE_OPEN FAILED" + err.message);
expect().assertFail();
console.info(TAG + "Entering SET_FLASH_MODE_OPEN ends here");
}
await sleep(1000);
done();
})
await sleep(1000);
done();
})
/**
* @tc.number : GET_FLASH_MODE_OPEN
* @tc.name : get flash mode open camera0 api
* @tc.desc : get flash mode open camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FLASH_MODE_OPEN', 0, async function (done) {
console.info(TAG + "Entering GET_FLASH_MODE_OPEN to operate");
camera0Input.getFlashMode(async (err, data) => {
if (!err) {
console.info(TAG + "Entering GET_FLASH_MODE_OPEN success");
if (data == 1) {
console.info(TAG + "GET_FLASH_MODE_OPEN data is not null || undefined: ");
console.info(TAG + "Current FlashMode is: " + data);
expect(true).assertTrue();
console.info(TAG + "GET_FLASH_MODE_OPEN PASSED");
}
}
else {
expect().assertFail();
console.info(TAG + "GET_FLASH_MODE_OPEN FAILED" + err.message);
console.info(TAG + "GET_FLASH_MODE_OPEN ends here");
}
await sleep(1000);
done();
})
await sleep(1000); await sleep(1000);
done(); done();
}) })
/** /**
* @tc.number : IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED * @tc.number : IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED
* @tc.name : check if flash mode always open is supported-camera0Input api * @tc.name : check if flash mode always open is supported-camera0Input api
...@@ -1183,7 +1120,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -1183,7 +1120,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED', 0, async function (done) { it('IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED to operate"); console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED to operate");
camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN, async (err, data) => { camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN, async (err, data) => {
...@@ -1191,81 +1128,23 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -1191,81 +1128,23 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
console.info(TAG + "Entering FLASH_MODE_ALWAYS_OPEN SUCCESS "); console.info(TAG + "Entering FLASH_MODE_ALWAYS_OPEN SUCCESS ");
if (data != null || data != undefined) { if (data != null || data != undefined) {
console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED data is not null || undefined"); console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED data is not null || undefined");
expect(true).assertTrue();
console.info(TAG + "FLASH_MODE_ALWAYS_OPEN supported is: " + data); console.info(TAG + "FLASH_MODE_ALWAYS_OPEN supported is: " + data);
expect(data).assertEqual(true);
console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED PASSED"); console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED PASSED");
} }
} else { } else {
console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED FAILED" + err.message); console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED FAILED" + err.message);
expect().assertFail();
console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED ends here"); console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED ends here");
} }
await sleep(1000); await sleep(1000);
done(); done();
}) })
await sleep(1000);
done();
})
/**
* @tc.number : SET_FLASH_MODE_ALWAYS_OPEN
* @tc.name : set flash mode always open camera0 api
* @tc.desc : set flash mode always open camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FLASH_MODE_ALWAYS_OPEN', 0, async function (done) {
console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN to operate");
camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN, async (err, data) => {
if (!err) {
console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN);
console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN PASSED")
expect(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN).assertEqual(3);
}
else {
console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN FAILED" + err.message);
expect().assertFail();
console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN ends here");
}
await sleep(1000);
done();
})
await sleep(1000); await sleep(1000);
done(); done();
}) })
/**
* @tc.number : GET_FLASH_MODE_ALWAYS_OPEN
* @tc.name : get flash mode always open camera0 api
* @tc.desc : get flash mode always open camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FLASH_MODE_ALWAYS_OPEN', 0, async function (done) {
console.info(TAG + "Entering GET_FLASH_MODE_ALWAYS_OPEN to operate");
camera0Input.getFlashMode(async (err, data) => {
if (!err) {
console.info(TAG + "Entering GET_FLASH_MODE_ALWAYS_OPEN success");
if (data == 3) {
console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN data is not null || undefined: ");
expect(true).assertTrue();
console.info(TAG + "Current FlashMode is: " + data);
console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN PASSED");
}
}
else {
expect().assertFail();
console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN FAILED" + err.message);
console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN ends here");
}
await sleep(1000);
done();
})
await sleep(1000);
done();
})
/** /**
* @tc.number : PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS * @tc.number : PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS
...@@ -1274,7 +1153,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -1274,7 +1153,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS', 0, async function (done) { it('PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS', 0, async function (done) {
if (photoOutputAsync == null || photoOutputAsync == undefined) { if (photoOutputAsync == null || photoOutputAsync == undefined) {
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS photoOutput == null || undefined"); console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS photoOutput == null || undefined");
...@@ -1308,7 +1187,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -1308,7 +1187,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('IS_FLASH_MODE_CLOSE_SUPPORTED', 0, async function (done) { it('IS_FLASH_MODE_CLOSE_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED to operate"); console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED to operate");
camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_CLOSE, async (err, data) => { camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_CLOSE, async (err, data) => {
...@@ -1316,81 +1195,24 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -1316,81 +1195,24 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED SUCCESS "); console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED SUCCESS ");
if (data != null || data != undefined) { if (data != null || data != undefined) {
console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED data is not null || undefined"); console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED data is not null || undefined");
expect(true).assertTrue();
console.info(TAG + "FLASH_MODE_CLOSE supported is: " + data); console.info(TAG + "FLASH_MODE_CLOSE supported is: " + data);
expect(data).assertEqual(true);
console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED PASSED"); console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED PASSED");
} }
} else { } else {
console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED FAILED" + err.message);
expect().assertFail(); expect().assertFail();
console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED FAILED" + err.message);
console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED ends here"); console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED ends here");
} }
await sleep(1000); await sleep(1000);
done(); done();
}) })
await sleep(1000);
done();
})
/**
* @tc.number : SET_FLASH_MODE_CLOSE
* @tc.name : set flash mode close camera0 api
* @tc.desc : set flash mode close camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FLASH_MODE_CLOSE', 0, async function (done) {
console.info(TAG + "Entering SET_FLASH_MODE_CLOSE to operate");
camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_CLOSE, async (err, data) => {
if (!err) {
console.info(TAG + "Entering SET_FLASH_MODE_CLOSE SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_CLOSE);
console.info(TAG + "Entering SET_FLASH_MODE_CLOSE PASSED")
expect(cameraObj.FlashMode.FLASH_MODE_CLOSE).assertEqual(0);
}
else {
console.info(TAG + "Entering SET_FLASH_MODE_CLOSE FAILED" + err.message);
expect().assertFail();
console.info(TAG + "Entering SET_FLASH_MODE_CLOSE ends here");
}
await sleep(1000);
done();
})
await sleep(1000); await sleep(1000);
done(); done();
}) })
/**
* @tc.number : GET_FLASH_MODE_CLOSE
* @tc.name : get flash mode close camera0 api
* @tc.desc : get flash mode close camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FLASH_MODE_CLOSE', 0, async function (done) {
console.info(TAG + "Entering GET_FLASH_MODE_CLOSE to operate");
camera0Input.getFlashMode(async (err, data) => {
if (!err) {
console.info(TAG + "Entering GET_FLASH_MODE_CLOSE success");
if (data == 0) {
console.info(TAG + "GET_FLASH_MODE_CLOSE data is not null || undefined: ");
console.info(TAG + "Current FlashMode is: " + data);
expect(true).assertTrue();
console.info(TAG + "GET_FLASH_MODE_CLOSE PASSED");
}
}
else {
expect().assertFail();
console.info(TAG + "GET_FLASH_MODE_CLOSE FAILED" + err.message);
console.info(TAG + "GET_FLASH_MODE_CLOSE ends here");
}
await sleep(1000)
done();
})
await sleep(1000)
done()
})
/** /**
* @tc.number : IS_FLASH_MODE_AUTO_SUPPORTED * @tc.number : IS_FLASH_MODE_AUTO_SUPPORTED
...@@ -1399,7 +1221,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -1399,7 +1221,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('IS_FLASH_MODE_AUTO_SUPPORTED', 0, async function (done) { it('IS_FLASH_MODE_AUTO_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED to operate"); console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED to operate");
camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_AUTO, async (err, data) => { camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_AUTO, async (err, data) => {
...@@ -1419,37 +1241,13 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -1419,37 +1241,13 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
await sleep(1000); await sleep(1000);
done(); done();
}) })
await sleep(1000);
done();
})
/**
* @tc.number : SET_FLASH_MODE_AUTO
* @tc.name : set flash mode auto camera0 api
* @tc.desc : set flash mode auto camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FLASH_MODE_AUTO', 0, async function (done) {
console.info(TAG + "Entering SET_FLASH_MODE_AUTO to operate");
camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_AUTO, async (err, data) => {
if (!err) {
console.info(TAG + "Entering SET_FLASH_MODE_AUTO SUCCESS which is not supported: ");
console.info(TAG + "Entering SET_FLASH_MODE_AUTO FAILED")
expect().assertFail();
} else {
expect(true).assertTrue()
console.info(TAG + "Entering SET_FLASH_MODE_AUTO PASSED: " + err.message);
console.info(TAG + "Entering SET_FLASH_MODE_AUTO ends here");
}
await sleep(1000);
done();
})
await sleep(1000); await sleep(1000);
done(); done();
}) })
/** /**
* @tc.number : IS_FOCUS_MODE_LOCKED_SUPPORTED * @tc.number : IS_FOCUS_MODE_LOCKED_SUPPORTED
* @tc.name : check if focus mode locked is supported-camera0Input api * @tc.name : check if focus mode locked is supported-camera0Input api
...@@ -1457,7 +1255,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -1457,7 +1255,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('IS_FOCUS_MODE_LOCKED_SUPPORTED', 0, async function (done) { it('IS_FOCUS_MODE_LOCKED_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED to operate"); console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED to operate");
camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_LOCKED, async (err, data) => { camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_LOCKED, async (err, data) => {
...@@ -1466,7 +1264,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -1466,7 +1264,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
if (data != null || data != undefined) { if (data != null || data != undefined) {
console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED data is not null || undefined"); console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED data is not null || undefined");
console.info(TAG + "FOCUS_MODE_LOCKED_SUPPORTED is: " + data); console.info(TAG + "FOCUS_MODE_LOCKED_SUPPORTED is: " + data);
expect(data).assertEqual(false); expect(true).assertTrue();
console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED PASSED: "); console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED PASSED: ");
} }
} else { } else {
...@@ -1481,65 +1279,6 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -1481,65 +1279,6 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
done(); done();
}) })
/**
* @tc.number : SET_FOCUS_MODE_LOCKED
* @tc.name : set focus mode locked camera0 api
* @tc.desc : set focus mode locked camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FOCUS_MODE_LOCKED', 0, async function (done) {
console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED to operate");
camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED, async (err, data) => {
if (!err) {
console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED);
console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED PASSED")
expect(cameraObj.FocusMode.FOCUS_MODE_LOCKED).assertEqual(3);
} else {
console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED FAILED" + err.message);
expect().assertFail();
console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED ends here");
}
await sleep(1000);
done();
})
await sleep(1000);
done();
})
/**
* @tc.number : GET_FOCUS_MODE_LOCKED
* @tc.name : get focus mode locked camera0 api
* @tc.desc : get focus mode locked camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FOCUS_MODE_LOCKED', 0, async function (done) {
console.info(TAG + "Entering GET_FOCUS_MODE_LOCKED to operate");
camera0Input.getFocusMode(async (err, data) => {
if (!err) {
console.info(TAG + "Entering GET_FOCUS_MODE_LOCKED SUCCESS: " + data);
if (data == 0) {
console.info(TAG + "GET_FOCUS_MODE_LOCKED data is not null || undefined: ");
console.info(TAG + "Current FocusMode is: " + data);
expect(true).assertTrue();
console.info(TAG + "GET_FOCUS_MODE_LOCKED PASSED");
}
}
else {
expect().assertFail();
console.info(TAG + "GET_FOCUS_MODE_LOCKED FAILED" + err.message);
console.info(TAG + "GET_FOCUS_MODE_LOCKED ends here");
}
await sleep(1000);
done();
})
await sleep(1000);
done();
})
/** /**
* @tc.number : IS_FOCUS_MODE_MANUAL_SUPPORTED * @tc.number : IS_FOCUS_MODE_MANUAL_SUPPORTED
* @tc.name : check if focus mode manual is supported-camera0Input api * @tc.name : check if focus mode manual is supported-camera0Input api
...@@ -1547,7 +1286,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -1547,7 +1286,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('IS_FOCUS_MODE_MANUAL_SUPPORTED', 0, async function (done) { it('IS_FOCUS_MODE_MANUAL_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED to operate"); console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED to operate");
camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_MANUAL, async (err, data) => { camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_MANUAL, async (err, data) => {
...@@ -1556,7 +1295,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -1556,7 +1295,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
if (data != null || data != undefined) { if (data != null || data != undefined) {
console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED data is not null || undefined"); console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED data is not null || undefined");
console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + data); console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + data);
expect(data).assertEqual(true); expect(true).assertTrue();
console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED PASSED: "); console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED PASSED: ");
} }
} else { } else {
...@@ -1571,66 +1310,6 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -1571,66 +1310,6 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
done(); done();
}) })
/**
* @tc.number : SET_FOCUS_MODE_MANUAL
* @tc.name : set focus mode manual camera0 api
* @tc.desc : set focus mode manual camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FOCUS_MODE_MANUAL', 0, async function (done) {
console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL to operate");
camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_MANUAL, async (err, data) => {
if (!err) {
console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_MANUAL);
console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL PASSED")
expect(cameraObj.FocusMode.FOCUS_MODE_MANUAL).assertEqual(0)
}
else {
console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL FAILED" + err.message);
expect().assertFail();
console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL ends here");
}
await sleep(1000);
done();
})
await sleep(1000);
done();
})
/**
* @tc.number : GET_FOCUS_MODE_MANUAL
* @tc.name : get focus mode manual camera0 api
* @tc.desc : get focus mode manual camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FOCUS_MODE_MANUAL', 0, async function (done) {
console.info(TAG + "Entering GET_FOCUS_MODE_MANUAL to operate");
camera0Input.getFocusMode(async (err, data) => {
if (!err) {
console.info(TAG + "Entering GET_FOCUS_MODE_MANUAL SUCCESS");
if (data == 0) {
console.info(TAG + "GET_FOCUS_MODE_MANUAL data is not null || undefined: ");
console.info(TAG + "Current FocusMode is: " + data);
expect(true).assertTrue();
console.info(TAG + "GET_FOCUS_MODE_MANUAL PASSED");
}
}
else {
expect().assertFail();
console.info(TAG + "GET_FOCUS_MODE_MANUAL FAILED" + err.message);
console.info(TAG + "GET_FOCUS_MODE_MANUAL ends here");
}
await sleep(1000);
done();
})
await sleep(1000);
done();
})
/** /**
* @tc.number : IS_FOCUS_MODE_CONTINUOUS_SUPPORTED * @tc.number : IS_FOCUS_MODE_CONTINUOUS_SUPPORTED
* @tc.name : check if focus mode continuous is supported-camera0Input api * @tc.name : check if focus mode continuous is supported-camera0Input api
...@@ -1638,7 +1317,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -1638,7 +1317,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('IS_FOCUS_MODE_CONTINUOUS_SUPPORTED', 0, async function (done) { it('IS_FOCUS_MODE_CONTINUOUS_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED to operate"); console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED to operate");
camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO, async (err, data) => { camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO, async (err, data) => {
...@@ -1647,7 +1326,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -1647,7 +1326,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
if (data != null || data != undefined) { if (data != null || data != undefined) {
console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED data is not null || undefined"); console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED data is not null || undefined");
console.info(TAG + "FOCUS_MODE_CONTINOUS_SUPPORTED is: " + data); console.info(TAG + "FOCUS_MODE_CONTINOUS_SUPPORTED is: " + data);
expect(data).assertEqual(true); expect(true).assertTrue();
console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED PASSED: "); console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED PASSED: ");
} }
} else { } else {
...@@ -1662,66 +1341,6 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -1662,66 +1341,6 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
done(); done();
}) })
/**
* @tc.number : SET_FOCUS_MODE_CONTINUOUS
* @tc.name : set focus mode continuous camera0 api
* @tc.desc : set focus mode continuous camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FOCUS_MODE_CONTINUOUS', 0, async function (done) {
console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS to operate");
camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO, async (err, data) => {
if (!err) {
console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO);
expect(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO).assertEqual(1)
console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS PASSED")
}
else {
console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS FAILED" + err.message);
expect().assertFail();
console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS ends here");
}
await sleep(1000);
done();
})
await sleep(1000);
done();
})
/**
* @tc.number : GET_FOCUS_MODE_CONTINUOUS
* @tc.name : get focus mode continuous camera0 api
* @tc.desc : get focus mode continuous camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FOCUS_MODE_CONTINUOUS', 0, async function (done) {
console.info(TAG + "Entering GET_FOCUS_MODE_CONTINUOUS to operate");
camera0Input.getFocusMode(async (err, data) => {
if (!err) {
console.info(TAG + "Entering GET_FOCUS_MODE_CONTINUOUS SUCCESS");
if (data == 1) {
console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS data is not null || undefined: ");
console.info(TAG + "Current FocusMode is: " + data);
expect(true).assertTrue();
console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS PASSED");
}
}
else {
expect().assertFail();
console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS FAILED" + err.message);
console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS ends here");
}
await sleep(1000);
done();
})
await sleep(1000);
done();
})
/** /**
* @tc.number : IS_FOCUS_MODE_AUTO_SUPPORTED * @tc.number : IS_FOCUS_MODE_AUTO_SUPPORTED
* @tc.name : check if focus mode auto is supported-camera0Input api * @tc.name : check if focus mode auto is supported-camera0Input api
...@@ -1729,7 +1348,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -1729,7 +1348,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('IS_FOCUS_MODE_AUTO_SUPPORTED', 0, async function (done) { it('IS_FOCUS_MODE_AUTO_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED to operate"); console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED to operate");
camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO, async (err, data) => { camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO, async (err, data) => {
...@@ -1738,7 +1357,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -1738,7 +1357,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
if (data != null || data != undefined) { if (data != null || data != undefined) {
console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED data is not null || undefined"); console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED data is not null || undefined");
console.info(TAG + "FOCUS_MODE_AUTO_SUPPORTED is: " + data); console.info(TAG + "FOCUS_MODE_AUTO_SUPPORTED is: " + data);
expect(data).assertEqual(true); expect(true).assertTrue();
console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED PASSED: "); console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED PASSED: ");
} }
} else { } else {
...@@ -1753,67 +1372,6 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -1753,67 +1372,6 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
done(); done();
}) })
/**
* @tc.number : SET_FOCUS_MODE_AUTO
* @tc.name : set focus mode auto camera0 api
* @tc.desc : set focus mode auto camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FOCUS_MODE_AUTO', 0, async function (done) {
console.info(TAG + "Entering SET_FOCUS_MODE_AUTO to operate");
camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO, async (err, data) => {
if (!err) {
console.info(TAG + "Entering SET_FOCUS_MODE_AUTO SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO);
if (data != null || data != undefined) {
expect(cameraObj.FocusMode.FOCUS_MODE_AUTO).assertEqual(2);
console.info(TAG + "Entering SET_FOCUS_MODE_AUTO PASSED")
}
} else {
console.info(TAG + "Entering SET_FOCUS_MODE_AUTO FAILED" + err.message);
expect().assertFail();
console.info(TAG + "Entering SET_FOCUS_MODE_AUTO ends here");
}
await sleep(1000);
done();
})
await sleep(1000);
done();
})
/**
* @tc.number : GET_FOCUS_MODE_AUTO
* @tc.name : get focus mode auto camera0 api
* @tc.desc : get focus mode auto camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FOCUS_MODE_AUTO', 0, async function (done) {
console.info(TAG + "Entering GET_FOCUS_MODE_AUTO to operate");
camera0Input.getFocusMode(async (err, data) => {
if (!err) {
console.info(TAG + "Entering GET_FOCUS_MODE_AUTO SUCCESS");
if (data == 2) {
console.info(TAG + "GET_FOCUS_MODE_AUTO data is not null || undefined: ");
console.info(TAG + "Current FocusMode is: " + data);
expect(true).assertTrue();
console.info(TAG + "GET_FOCUS_MODE_AUTO PASSED");
}
}
else {
expect().assertFail();
console.info(TAG + "GET_FOCUS_MODE_AUTO FAILED" + err.message);
console.info(TAG + "GET_FOCUS_MODE_AUTO ends here");
}
await sleep(1000);
done();
})
await sleep(1000);
done();
})
/** /**
* @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS Rotation-0 & Quality-0 * @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS Rotation-0 & Quality-0
* @tc.name : Photo output capture with photosettings api * @tc.name : Photo output capture with photosettings api
...@@ -1821,7 +1379,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -1821,7 +1379,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS', 0, async function (done) { it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS', 0, async function (done) {
if (photoOutputAsync == null || photoOutputAsync == undefined) { if (photoOutputAsync == null || photoOutputAsync == undefined) {
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined"); console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined");
...@@ -1855,7 +1413,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -1855,7 +1413,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS', 0, async function (done) { it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS', 0, async function (done) {
if (photoOutputAsync == null || photoOutputAsync == undefined) { if (photoOutputAsync == null || photoOutputAsync == undefined) {
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined"); console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined");
...@@ -1889,7 +1447,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -1889,7 +1447,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS', 0, async function (done) { it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS', 0, async function (done) {
if (photoOutputAsync == null || photoOutputAsync == undefined) { if (photoOutputAsync == null || photoOutputAsync == undefined) {
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined"); console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined");
...@@ -1913,242 +1471,14 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -1913,242 +1471,14 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
done(); done();
} }
}) })
/**
/**
* @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('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(1000);
done();
})
await sleep(1000);
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('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(1000);
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('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('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('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('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('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 : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS with Rotation-270 * @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS with Rotation-270
* @tc.name : Photo output capture with photosettings api * @tc.name : Photo output capture with photosettings api
* @tc.desc : Photo output capture with photosettings api * @tc.desc : Photo output capture with photosettings api
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS', 0, async function (done) { it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS', 0, async function (done) {
if (photoOutputAsync == null || photoOutputAsync == undefined) { if (photoOutputAsync == null || photoOutputAsync == undefined) {
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined"); console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined");
...@@ -2181,7 +1511,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -2181,7 +1511,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('CAPTURE_SESSION_STOP', 0, async function (done) { it('CAPTURE_SESSION_STOP', 0, async function (done) {
if (captureSession == null || captureSession == undefined) { if (captureSession == null || captureSession == undefined) {
console.info(TAG + "Entering CAPTURE_SESSION_STOP captureSession == null || undefined"); console.info(TAG + "Entering CAPTURE_SESSION_STOP captureSession == null || undefined");
...@@ -2215,7 +1545,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -2215,7 +1545,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('CAPTURE_SESSION_RELEASE', 0, async function (done) { it('CAPTURE_SESSION_RELEASE', 0, async function (done) {
if (captureSession == null || captureSession == undefined) { if (captureSession == null || captureSession == undefined) {
console.info(TAG + "Entering CAPTURE_SESSION_RELEASE captureSession == null || undefined"); console.info(TAG + "Entering CAPTURE_SESSION_RELEASE captureSession == null || undefined");
...@@ -2249,7 +1579,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -2249,7 +1579,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('PHOTOOUPUT_RELEASE', 0, async function (done) { it('PHOTOOUPUT_RELEASE', 0, async function (done) {
if (photoOutputAsync == null || photoOutputAsync == undefined) { if (photoOutputAsync == null || photoOutputAsync == undefined) {
console.info(TAG + "Entering PHOTOOUPUT_RELEASE photoOutputAsync == null || undefined"); console.info(TAG + "Entering PHOTOOUPUT_RELEASE photoOutputAsync == null || undefined");
...@@ -2280,7 +1610,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -2280,7 +1610,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('PREVIEWOUPUT_RELEASE', 0, async function (done) { it('PREVIEWOUPUT_RELEASE', 0, async function (done) {
if (previewOutputAsync == null || previewOutputAsync == undefined) { if (previewOutputAsync == null || previewOutputAsync == undefined) {
console.info(TAG + "Entering PREVIEWOUPUT_RELEASE previewOutputAsync == null || undefined"); console.info(TAG + "Entering PREVIEWOUPUT_RELEASE previewOutputAsync == null || undefined");
...@@ -2314,7 +1644,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { ...@@ -2314,7 +1644,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('CAMERAINPUT_RELEASE_SUCCESS', 0, async function (done) { it('CAMERAINPUT_RELEASE_SUCCESS', 0, async function (done) {
if (camera0Input == null || camera0Input == undefined) { if (camera0Input == null || camera0Input == undefined) {
console.info(TAG + "Entering CAMERAINPUT_RELEASE_SUCCESS camera0Input == null || undefined"); console.info(TAG + "Entering CAMERAINPUT_RELEASE_SUCCESS camera0Input == null || undefined");
......
...@@ -173,11 +173,11 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -173,11 +173,11 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
if (data != null || data != undefined) { if (data != null || data != undefined) {
console.info(TAG + "Camera status Callback CameraStatusInfo_Camera: " + data.camera); console.info(TAG + "Camera status Callback CameraStatusInfo_Camera: " + data.camera);
console.info(TAG + "Camera status Callback CameraStatusInfo_Status: " + data.status); console.info(TAG + "Camera status Callback CameraStatusInfo_Status: " + data.status);
expect(true).assertTrue(); expect(true).assertTrue();
} }
} else { } else {
expect().assertFail(); expect().assertFail();
console.info(TAG + "Camera status Callback FAILED: " + err.message);
} }
await sleep(1000); await sleep(1000);
done(); done();
...@@ -251,13 +251,13 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -251,13 +251,13 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
}) })
/** /**
* @tc.number : CAMERA_INPUT_CALLBACK_ON_ERROR * @tc.number : CAMERA_INPUT_CALLBACK_ON_ERROR
* @tc.name : Photo output callback on error api * @tc.name : Photo output callback on error api
* @tc.desc : Photo output callback on error api * @tc.desc : Photo output callback on error api
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('CAMERA_INPUT_CALLBACK_ON_ERROR', 0, async function (done) { it('CAMERA_INPUT_CALLBACK_ON_ERROR', 0, async function (done) {
if (camera0InputPromise == null || camera0InputPromise == undefined) { if (camera0InputPromise == null || camera0InputPromise == undefined) {
console.info(TAG + "Entering CAMERA_INPUT_CALLBACK_ON_ERROR camera0InputPromise == null || undefined"); console.info(TAG + "Entering CAMERA_INPUT_CALLBACK_ON_ERROR camera0InputPromise == null || undefined");
...@@ -272,7 +272,6 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -272,7 +272,6 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
} }
} else { } else {
expect().assertFail(); expect().assertFail();
console.info(TAG + "CAMERA_INPUT_CALLBACK FAILED: " + err.message);
} }
await sleep(1000); await sleep(1000);
done(); done();
...@@ -315,7 +314,8 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -315,7 +314,8 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('PREVIEW_OUTPUT_CALLBACK_ON_ERROR', 0, async function (done) { it('PREVIEW_OUTPUT_CALLBACK_ON_ERROR', 0, async function (done) {
if (previewOutputPromise == null || previewOutputPromise == undefined) { if (previewOutputPromise == null || previewOutputPromise == undefined) {
console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_ERROR previewOutput == null || undefined"); console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_ERROR previewOutput == null || undefined");
...@@ -330,7 +330,6 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -330,7 +330,6 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
} }
} else { } else {
expect().assertFail(); expect().assertFail();
console.info(TAG + "PREVIEW_OUTPUT_CALLBACK FAILED: " + err.message);
} }
await sleep(1000); await sleep(1000);
done(); done();
...@@ -376,7 +375,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -376,7 +375,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('PHOTO_OUTPUT_CALLBACK_ON_ERROR', 0, async function (done) { it('PHOTO_OUTPUT_CALLBACK_ON_ERROR', 0, async function (done) {
if (photoOutputPromise == null || photoOutputPromise == undefined) { if (photoOutputPromise == null || photoOutputPromise == undefined) {
console.info(TAG + "Entering PHOTO_OUTPUT_CALLBACK_ON_ERROR photoOutput == null || undefined"); console.info(TAG + "Entering PHOTO_OUTPUT_CALLBACK_ON_ERROR photoOutput == null || undefined");
...@@ -391,7 +390,6 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -391,7 +390,6 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
} }
} else { } else {
expect().assertFail(); expect().assertFail();
console.info(TAG + "PHOTO_OUTPUT_CALLBACK_ON_ERROR FAILED: " + err.message);
} }
await sleep(1000); await sleep(1000);
done(); done();
...@@ -436,7 +434,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -436,7 +434,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('CAP_SES_CALLBACK_ON_ERROR', 0, async function (done) { it('CAP_SES_CALLBACK_ON_ERROR', 0, async function (done) {
if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) {
console.info(TAG + "Entering CAP_SES_CALLBACK_ON_ERROR captureSession == null || undefined"); console.info(TAG + "Entering CAP_SES_CALLBACK_ON_ERROR captureSession == null || undefined");
...@@ -446,12 +444,11 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -446,12 +444,11 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
if (!err) { if (!err) {
console.info(TAG + " captureSession errorcallback is success"); console.info(TAG + " captureSession errorcallback is success");
if (data != null || data != undefined) { if (data != null || data != undefined) {
console.info(TAG + "Error CAP_SES_CALLBACK_ON_ERROR with ErrorCode: " + data.code); console.info(TAG + "Error in CaptureSessioncallback with ErrorCode: " + data.code);
expect(true).assertTrue(); expect(true).assertTrue();
} }
} else { } else {
expect().assertFail(); expect().assertFail();
console.info(TAG + "CAP_SES_CALLBACK_ON_ERROR FAILED: " + err.message);
} }
await sleep(1000); await sleep(1000);
done(); done();
...@@ -476,8 +473,9 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -476,8 +473,9 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
} else { } else {
console.info(TAG + "Entering CREATE_BEGIN_CONFIG_SUCCESS_PROMISE to operate"); console.info(TAG + "Entering CREATE_BEGIN_CONFIG_SUCCESS_PROMISE to operate");
const promise = await CaptureSessionPromise.beginConfig(); const promise = await CaptureSessionPromise.beginConfig();
console.info(TAG + "Entering beginConfig success:"); console.info(TAG + "Entering beginConfig success");
if (promise == undefined) { if (promise != null || promise != undefined) {
console.info(TAG + "Entering CREATE_BEGIN_CONFIG beginConfig data is not null || undefined: " + JSON.stringify(promise));
expect(true).assertTrue(); expect(true).assertTrue();
console.info(TAG + "Entering CREATE_BEGIN_CONFIG_SUCCESS_PROMISE beginConfig PASSED"); console.info(TAG + "Entering CREATE_BEGIN_CONFIG_SUCCESS_PROMISE beginConfig PASSED");
} }
...@@ -486,6 +484,8 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -486,6 +484,8 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
console.info(TAG + "Entering beginConfig FAILED"); console.info(TAG + "Entering beginConfig FAILED");
} }
console.info(TAG + "Entering beginConfig ends here"); console.info(TAG + "Entering beginConfig ends here");
await sleep(1000);
done();
} }
await sleep(1000); await sleep(1000);
done(); done();
...@@ -498,7 +498,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -498,7 +498,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('ADD_INPUT_SUCCESS_PROMISE', 0, async function (done) { it('ADD_INPUT_SUCCESS_PROMISE', 0, async function (done) {
if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) {
console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE captureSession == null || undefined"); console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE captureSession == null || undefined");
...@@ -506,7 +506,8 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -506,7 +506,8 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE to operate"); console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE to operate");
const Promise = await CaptureSessionPromise.addInput(camera0InputPromise); const Promise = await CaptureSessionPromise.addInput(camera0InputPromise);
console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE addInput success"); console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE addInput success");
if (Promise == undefined) { if (Promise != null || Promise != undefined) {
console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE addInput data is not null || undefined");
expect(true).assertTrue(); expect(true).assertTrue();
console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE addInput PASSED"); console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE addInput PASSED");
} }
...@@ -529,7 +530,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -529,7 +530,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE', 0, async function (done) { it('ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE', 0, async function (done) {
if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) {
console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE captureSession == null || undefined"); console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE captureSession == null || undefined");
...@@ -537,7 +538,8 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -537,7 +538,8 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE to operate"); console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE to operate");
const promise = await CaptureSessionPromise.addOutput(previewOutputPromise); const promise = await CaptureSessionPromise.addOutput(previewOutputPromise);
console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE : Success"); console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE : Success");
if (promise == undefined) { if (promise != null || promise != undefined) {
console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE data is not null || undefined");
expect(true).assertTrue(); expect(true).assertTrue();
console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE PASSED"); console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE PASSED");
} }
...@@ -560,7 +562,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -560,7 +562,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('ADD_OUTPUT_PHOTO_SUCCESS', 0, async function (done) { it('ADD_OUTPUT_PHOTO_SUCCESS', 0, async function (done) {
if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) {
console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS captureSession == null || undefined"); console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS captureSession == null || undefined");
...@@ -568,13 +570,14 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -568,13 +570,14 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS to operate"); console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS to operate");
const promise = await CaptureSessionPromise.addOutput(photoOutputPromise); const promise = await CaptureSessionPromise.addOutput(photoOutputPromise);
console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS success"); console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS success");
if (promise == undefined) { if (promise != null || promise != undefined) {
console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS data is not null || undefined");
expect(true).assertTrue(); expect(true).assertTrue();
console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS PASSED"); console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS PASSED");
} }
else { else {
expect().assertFail(); expect().assertFail();
console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS FAILED "); console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS FAILED: ");
} }
console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS ends here"); console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS ends here");
await sleep(1000); await sleep(1000);
...@@ -584,6 +587,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -584,6 +587,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
done(); done();
}) })
/** /**
* @tc.number : REMOVE_INPUT_SUCCESS * @tc.number : REMOVE_INPUT_SUCCESS
* @tc.name : remove input api * @tc.name : remove input api
...@@ -599,7 +603,8 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -599,7 +603,8 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
console.info(TAG + "Entering REMOVE_INPUT_SUCCESS to operate"); console.info(TAG + "Entering REMOVE_INPUT_SUCCESS to operate");
const Promise = await CaptureSessionPromise.removeInput(camera0InputPromise); const Promise = await CaptureSessionPromise.removeInput(camera0InputPromise);
console.info(TAG + "Entering REMOVE_INPUT_SUCCESS success " + Promise); console.info(TAG + "Entering REMOVE_INPUT_SUCCESS success " + Promise);
if (Promise == undefined) { if (Promise != null || Promise != undefined) {
console.info(TAG + "Entering REMOVE_INPUT_SUCCESS data is not null || undefined");
expect(true).assertTrue(); expect(true).assertTrue();
console.info(TAG + "Entering REMOVE_INPUT_SUCCESS PASSED"); console.info(TAG + "Entering REMOVE_INPUT_SUCCESS PASSED");
} }
...@@ -630,7 +635,8 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -630,7 +635,8 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
console.info(TAG + "Entering REMOVE_INPUT_SUCCESS to operate"); console.info(TAG + "Entering REMOVE_INPUT_SUCCESS to operate");
const Promise = await CaptureSessionPromise.removeOutput(previewOutputPromise); const Promise = await CaptureSessionPromise.removeOutput(previewOutputPromise);
console.info(TAG + "Entering REMOVE_INPUT_SUCCESS addInput success " + Promise); console.info(TAG + "Entering REMOVE_INPUT_SUCCESS addInput success " + Promise);
if (Promise == undefined) { if (Promise != null || Promise != undefined) {
console.info(TAG + "Entering REMOVE_INPUT_SUCCESS addInput data is not null || undefined");
expect(true).assertTrue(); expect(true).assertTrue();
console.info(TAG + "Entering REMOVE_INPUT_SUCCESS addInput PASSED"); console.info(TAG + "Entering REMOVE_INPUT_SUCCESS addInput PASSED");
} }
...@@ -661,7 +667,8 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -661,7 +667,8 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
console.info(TAG + "Entering REMOVE_INPUT_SUCCESS to operate"); console.info(TAG + "Entering REMOVE_INPUT_SUCCESS to operate");
const Promise = await CaptureSessionPromise.removeOutput(photoOutputPromise); const Promise = await CaptureSessionPromise.removeOutput(photoOutputPromise);
console.info(TAG + "Entering REMOVE_INPUT_SUCCESS addInput success " + Promise); console.info(TAG + "Entering REMOVE_INPUT_SUCCESS addInput success " + Promise);
if (Promise == undefined) { if (Promise != null || Promise != undefined) {
console.info(TAG + "Entering REMOVE_INPUT_SUCCESS addInput data is not null || undefined");
expect(true).assertTrue(); expect(true).assertTrue();
console.info(TAG + "Entering REMOVE_INPUT_SUCCESS addInput PASSED"); console.info(TAG + "Entering REMOVE_INPUT_SUCCESS addInput PASSED");
} }
...@@ -677,6 +684,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -677,6 +684,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
done(); done();
}) })
/** /**
* @tc.number : ADD_INPUT_SUCCESS_PROMISE * @tc.number : ADD_INPUT_SUCCESS_PROMISE
* @tc.name : Add Input with camera0Input api * @tc.name : Add Input with camera0Input api
...@@ -684,7 +692,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -684,7 +692,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('ADD_INPUT_SUCCESS_PROMISE', 0, async function (done) { it('ADD_INPUT_SUCCESS_PROMISE', 0, async function (done) {
if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) {
console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE captureSession == null || undefined"); console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE captureSession == null || undefined");
...@@ -692,7 +700,8 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -692,7 +700,8 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE to operate"); console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE to operate");
const Promise = await CaptureSessionPromise.addInput(camera0InputPromise); const Promise = await CaptureSessionPromise.addInput(camera0InputPromise);
console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE addInput success"); console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE addInput success");
if (Promise == undefined) { if (Promise != null || Promise != undefined) {
console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE addInput data is not null || undefined");
expect(true).assertTrue(); expect(true).assertTrue();
console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE addInput PASSED"); console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE addInput PASSED");
} }
...@@ -715,7 +724,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -715,7 +724,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE', 0, async function (done) { it('ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE', 0, async function (done) {
if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) {
console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE captureSession == null || undefined"); console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE captureSession == null || undefined");
...@@ -723,7 +732,8 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -723,7 +732,8 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE to operate"); console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE to operate");
const promise = await CaptureSessionPromise.addOutput(previewOutputPromise); const promise = await CaptureSessionPromise.addOutput(previewOutputPromise);
console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE : Success"); console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE : Success");
if (promise == undefined) { if (promise != null || promise != undefined) {
console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE data is not null || undefined");
expect(true).assertTrue(); expect(true).assertTrue();
console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE PASSED"); console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE PASSED");
} }
...@@ -746,7 +756,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -746,7 +756,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('ADD_OUTPUT_PHOTO_SUCCESS', 0, async function (done) { it('ADD_OUTPUT_PHOTO_SUCCESS', 0, async function (done) {
if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) {
console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS captureSession == null || undefined"); console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS captureSession == null || undefined");
...@@ -754,7 +764,8 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -754,7 +764,8 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS to operate"); console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS to operate");
const promise = await CaptureSessionPromise.addOutput(photoOutputPromise); const promise = await CaptureSessionPromise.addOutput(photoOutputPromise);
console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS success"); console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS success");
if (promise == undefined) { if (promise != null || promise != undefined) {
console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS data is not null || undefined");
expect(true).assertTrue(); expect(true).assertTrue();
console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS PASSED"); console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS PASSED");
} }
...@@ -777,7 +788,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -777,7 +788,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('COMMIT_CONFIG_SUCCESS', 0, async function (done) { it('COMMIT_CONFIG_SUCCESS', 0, async function (done) {
if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) {
console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS captureSession == null || undefined"); console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS captureSession == null || undefined");
...@@ -785,7 +796,8 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -785,7 +796,8 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS to operate"); console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS to operate");
const promise = await CaptureSessionPromise.commitConfig(); const promise = await CaptureSessionPromise.commitConfig();
console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig success"); console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig success");
if (promise == undefined) { if (promise != null || promise != undefined) {
console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS data is not null || undefined");
expect(true).assertTrue(); expect(true).assertTrue();
console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig PASSED"); console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig PASSED");
} }
...@@ -810,7 +822,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -810,7 +822,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START', 0, async function (done) { it('PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START', 0, async function (done) {
if (previewOutputPromise == null || previewOutputPromise == undefined) { if (previewOutputPromise == null || previewOutputPromise == undefined) {
console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START previewOutput == null || undefined"); console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START previewOutput == null || undefined");
...@@ -818,13 +830,12 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -818,13 +830,12 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START to operate"); console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START to operate");
previewOutputPromise.on("frameStart", async (err, data) => { previewOutputPromise.on("frameStart", async (err, data) => {
if (!err) { if (!err) {
console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START is success"); console.info(TAG + "Preview frameStart Callback is success");
if (data != null || data != undefined) { if (data != null || data != undefined) {
expect(true).assertTrue(); expect(true).assertTrue();
} }
} else { } else {
expect().assertFail(); expect().assertFail()
console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START FAILED : + err.message");
} }
await sleep(1000); await sleep(1000);
done(); done();
...@@ -841,7 +852,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -841,7 +852,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END', 0, async function (done) { it('PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END', 0, async function (done) {
if (previewOutputPromise == null || previewOutputPromise == undefined) { if (previewOutputPromise == null || previewOutputPromise == undefined) {
console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END previewOutput == null || undefined"); console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END previewOutput == null || undefined");
...@@ -849,13 +860,12 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -849,13 +860,12 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END to operate"); console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END to operate");
previewOutputPromise.on("frameEnd", async (err, data) => { previewOutputPromise.on("frameEnd", async (err, data) => {
if (!err) { if (!err) {
console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END is success"); console.info(TAG + "Preview frameEnd Callback is success");
if (data != null || data != undefined) { if (data != null || data != undefined) {
expect(true).assertTrue(); expect(true).assertTrue();
} }
} else { } else {
expect().assertFail(); expect().assertFail();
console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END FAILED : + err.message");
} }
await sleep(1000); await sleep(1000);
done(); done();
...@@ -873,7 +883,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -873,7 +883,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('PHOTO_CAP_CALLBACK_ON_CAPTURE_START', 0, async function (done) { it('PHOTO_CAP_CALLBACK_ON_CAPTURE_START', 0, async function (done) {
if (photoOutputPromise == null || photoOutputPromise == undefined) { if (photoOutputPromise == null || photoOutputPromise == undefined) {
console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_CAPTURE_START photoOutput == null || undefined"); console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_CAPTURE_START photoOutput == null || undefined");
...@@ -887,8 +897,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -887,8 +897,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
expect(true).assertTrue(); expect(true).assertTrue();
} }
} else { } else {
expect().assertFail(); expect().assertFail()
console.info(TAG + "PHOTO_CAP_CALLBACK_ON_CAPTURE_START FAILED: " + err.message);
} }
await sleep(1000); await sleep(1000);
done(); done();
...@@ -905,7 +914,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -905,7 +914,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('PHOTO_CAP_CALLBACK_ON_CAPTURE_END', 0, async function (done) { it('PHOTO_CAP_CALLBACK_ON_CAPTURE_END', 0, async function (done) {
if (photoOutputPromise == null || photoOutputPromise == undefined) { if (photoOutputPromise == null || photoOutputPromise == undefined) {
console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_CAPTURE_END photoOutput == null || undefined"); console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_CAPTURE_END photoOutput == null || undefined");
...@@ -921,7 +930,6 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -921,7 +930,6 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
} }
} else { } else {
expect().assertFail(); expect().assertFail();
console.info(TAG + 'PHOTO_CAP_CALLBACK_ON_CAPTURE_END FAILED' + err.message);
} }
await sleep(1000); await sleep(1000);
done(); done();
...@@ -938,7 +946,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -938,7 +946,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER', 0, async function (done) { it('PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER', 0, async function (done) {
if (photoOutputPromise == null || photoOutputPromise == undefined) { if (photoOutputPromise == null || photoOutputPromise == undefined) {
console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER photoOutput == null || undefined"); console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER photoOutput == null || undefined");
...@@ -948,13 +956,12 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -948,13 +956,12 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
if (!err) { if (!err) {
console.info(TAG + "frameShutter callback is success"); console.info(TAG + "frameShutter callback is success");
if (data != null || data != undefined) { if (data != null || data != undefined) {
console.info(TAG + "PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER with captureId: " + data.captureId); console.info(TAG + "frameShutter callback with captureId: " + data.captureId);
console.info(TAG + "PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER with timestamp: " + data.timestamp); console.info(TAG + "frameShutter callback with timestamp: " + data.timestamp);
expect(true).assertTrue(); expect(true).assertTrue();
} }
} else { } else {
expect().assertFail(); expect().assertFail();
console.info(TAG + "PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER FAILED: " + err.message);
} }
await sleep(1000); await sleep(1000);
done(); done();
...@@ -971,16 +978,19 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -971,16 +978,19 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('CAPTURE_SESSION_START_SUCCESS', 0, async function (done) { it('CAPTURE_SESSION_START_SUCCESS', 0, async function (done) {
if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) {
console.info(TAG + "Entering CAPTURE_SESSION_START_SUCCESS captureSession == null || undefined"); console.info(TAG + "Entering CAPTURE_SESSION_START_SUCCESS captureSession == null || undefined");
} else { } else {
console.info(TAG + "Entering CAPTURE_SESSION_START_SUCCESS to operate"); console.info(TAG + "Entering CAPTURE_SESSION_START_SUCCESS to operate");
await CaptureSessionPromise.start(); const promise = await CaptureSessionPromise.start();
console.info(TAG + "Entering captureSession start success"); console.info(TAG + "Entering captureSession start success");
expect(true).assertTrue(); if (promise != null || promise != undefined) {
console.info(TAG + "Entering CAPTURE_SESSION_START_SUCCESS PASSED"); console.info(TAG + "Entering CAPTURE_SESSION_START_SUCCESS data is not null || undefined" + promise);
expect(true).assertTrue();
console.info(TAG + "Entering CAPTURE_SESSION_START_SUCCESS PASSED");
}
console.info(TAG + "Entering CAPTURE_SESSION_START_SUCCESS ends here"); console.info(TAG + "Entering CAPTURE_SESSION_START_SUCCESS ends here");
await sleep(1000); await sleep(1000);
done(); done();
...@@ -997,7 +1007,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -997,7 +1007,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('HAS_FLASH', 0, async function (done) { it('HAS_FLASH', 0, async function (done) {
console.info("--------------HAS_FLASH--------------"); console.info("--------------HAS_FLASH--------------");
console.info(TAG + 'hasFlash called.') console.info(TAG + 'hasFlash called.')
...@@ -1005,12 +1015,12 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -1005,12 +1015,12 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
console.info(TAG + "Entering HAS_FLASH success"); console.info(TAG + "Entering HAS_FLASH success");
if (hasFlashPromise != null || hasFlashPromise != undefined) { if (hasFlashPromise != null || hasFlashPromise != undefined) {
console.info(TAG + "Entering HAS_FLASH data is not null || undefined"); console.info(TAG + "Entering HAS_FLASH data is not null || undefined");
expect(true).assertTrue();
console.info(TAG + "Entering HAS_FLASH PASSED with HAS_FLASH is: " + JSON.stringify(hasFlashPromise)); console.info(TAG + "Entering HAS_FLASH PASSED with HAS_FLASH is: " + JSON.stringify(hasFlashPromise));
expect(hasFlashPromise).assertEqual(true);
} }
else { else {
console.info(TAG + "Entering HAS_FLASH FAILED");
expect().assertFail(); expect().assertFail();
console.info(TAG + "Entering HAS_FLASH FAILED");
} }
console.info(TAG + "Entering HAS_FLASH ends here"); console.info(TAG + "Entering HAS_FLASH ends here");
await sleep(1000) await sleep(1000)
...@@ -1024,7 +1034,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -1024,7 +1034,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('IS_FLASH_MODE_OPEN_SUPPORTED', 0, async function (done) { it('IS_FLASH_MODE_OPEN_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED to operate"); console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED to operate");
var isFMOpenSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_OPEN); var isFMOpenSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_OPEN);
...@@ -1032,70 +1042,17 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -1032,70 +1042,17 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
if (isFMOpenSupported != null || isFMOpenSupported != undefined) { if (isFMOpenSupported != null || isFMOpenSupported != undefined) {
console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED data is not null || undefined"); console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED data is not null || undefined");
console.info(TAG + "FLASH_MODE_OPEN supported is: " + JSON.stringify(isFMOpenSupported)); console.info(TAG + "FLASH_MODE_OPEN supported is: " + JSON.stringify(isFMOpenSupported));
expect(isFMOpenSupported).assertEqual(true); expect(true).assertTrue();
console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED PASSED"); console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED PASSED");
} }
else { else {
console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED FAILED"); console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED FAILED");
expect().assertFail();
console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED ends here"); console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED ends here");
} }
await sleep(1000); await sleep(1000);
done(); done();
}) })
/**
* @tc.number : SET_FLASH_MODE_OPEN
* @tc.name : set flash mode open camera0 api
* @tc.desc : set flash mode open camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FLASH_MODE_OPEN', 0, async function (done) {
console.info(TAG + "Entering SET_FLASH_MODE_OPEN to operate");
var SetFMOpen = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_OPEN);
console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMOpen))
if (SetFMOpen == undefined) {
console.info(TAG + "Entering SET_FLASH_MODE_OPEN SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN);
console.info(TAG + "Entering SET_FLASH_MODE_OPEN PASSED")
expect(cameraObj.FlashMode.FLASH_MODE_OPEN).assertEqual(1)
} else {
console.info(TAG + "Entering SET_FLASH_MODE_OPEN FAILED");
expect().assertFail();
console.info(TAG + "Entering SET_FLASH_MODE_OPEN ends here");
}
await sleep(1000);
done();
})
/**
* @tc.number : GET_FLASH_MODE_OPEN
* @tc.name : get flash mode open camera0 api
* @tc.desc : get flash mode open camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FLASH_MODE_OPEN', 0, async function (done) {
console.info(TAG + "Entering GET_FLASH_MODE_OPEN to operate");
var GetFMOpen = await camera0InputPromise.getFlashMode();
console.info(TAG + "Entering GET_FLASH_MODE_OPEN success: " + JSON.stringify(GetFMOpen));
if (GetFMOpen == 1) {
console.info(TAG + "GET_FLASH_MODE_OPEN data is not null || undefined: ");
console.info(TAG + "Current FlashMode is: " + JSON.stringify(GetFMOpen));
expect(true).assertTrue();
console.info(TAG + "GET_FLASH_MODE_OPEN PASSED");
}
else {
expect().assertFail();
console.info(TAG + "GET_FLASH_MODE_OPEN FAILED");
console.info(TAG + "GET_FLASH_MODE_OPEN ends here");
}
await sleep(1000);
done();
})
/** /**
* @tc.number : IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED * @tc.number : IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED
* @tc.name : check if flash mode always open is supported-camera0Input api * @tc.name : check if flash mode always open is supported-camera0Input api
...@@ -1103,7 +1060,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -1103,7 +1060,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED', 0, async function (done) { it('IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED to operate"); console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED to operate");
var isFMAlwaysOpenSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); var isFMAlwaysOpenSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN);
...@@ -1111,70 +1068,17 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -1111,70 +1068,17 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
if (isFMAlwaysOpenSupported != null || isFMAlwaysOpenSupported != undefined) { if (isFMAlwaysOpenSupported != null || isFMAlwaysOpenSupported != undefined) {
console.info(TAG + "Entering FLASH_MODE_ALWAYS_OPEN data is not null || undefined"); console.info(TAG + "Entering FLASH_MODE_ALWAYS_OPEN data is not null || undefined");
console.info(TAG + "FLASH_MODE_OPEN supported is: " + isFMAlwaysOpenSupported); console.info(TAG + "FLASH_MODE_OPEN supported is: " + isFMAlwaysOpenSupported);
expect(isFMAlwaysOpenSupported).assertEqual(true); expect(true).assertTrue();
console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED PASSED"); console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED PASSED");
} }
else { else {
console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED FAILED"); console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED FAILED");
expect().assertFail();
console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED ends here"); console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED ends here");
} }
await sleep(1000); await sleep(1000);
done(); done();
}) })
/**
* @tc.number : SET_FLASH_MODE_ALWAYS_OPEN
* @tc.name : set flash mode always open camera0 api
* @tc.desc : set flash mode always open camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FLASH_MODE_ALWAYS_OPEN', 0, async function (done) {
console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN to operate");
var SetFMAlwaysOpen = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN);
console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMAlwaysOpen))
if (SetFMAlwaysOpen == undefined) {
console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN);
console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN PASSED")
expect(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN).assertEqual(3)
} else {
console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN FAILED");
expect().assertFail();
console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN ends here");
}
await sleep(1000);
done();
})
/**
* @tc.number : GET_FLASH_MODE_ALWAYS_OPEN
* @tc.name : get flash mode always open camera0 api
* @tc.desc : get flash mode always open camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FLASH_MODE_ALWAYS_OPEN', 0, async function (done) {
console.info(TAG + "Entering GET_FLASH_MODE_ALWAYS_OPEN to operate");
var GetFMAlwaysOpen = await camera0InputPromise.getFlashMode();
console.info(TAG + "Entering GET_FLASH_MODE_ALWAYS_OPEN success");
if (GetFMAlwaysOpen == 3) {
console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN data is not null || undefined: ");
console.info(TAG + "Current FlashMode is: " + GetFMAlwaysOpen);
expect(true).assertTrue();
console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN PASSED");
}
else {
expect().assertFail();
console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN FAILED");
console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN ends here");
}
await sleep(1000);
done();
})
/** /**
* @tc.number : IS_FLASH_MODE_AUTO_SUPPORTED * @tc.number : IS_FLASH_MODE_AUTO_SUPPORTED
* @tc.name : check if flash mode always open is supported-camera0Input api * @tc.name : check if flash mode always open is supported-camera0Input api
...@@ -1182,7 +1086,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -1182,7 +1086,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('IS_FLASH_MODE_AUTO_SUPPORTED', 0, async function (done) { it('IS_FLASH_MODE_AUTO_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED to operate"); console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED to operate");
var isFMAutoSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_AUTO); var isFMAutoSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_AUTO);
...@@ -1195,7 +1099,6 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -1195,7 +1099,6 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
} }
else { else {
console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED FAILED"); console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED FAILED");
expect().assertFail();
console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED ends here"); console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED ends here");
} }
await sleep(1000); await sleep(1000);
...@@ -1209,7 +1112,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -1209,7 +1112,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS', 0, async function (done) { it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS', 0, async function (done) {
if (photoOutputPromise == null || photoOutputPromise == undefined) { if (photoOutputPromise == null || photoOutputPromise == undefined) {
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined"); console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined");
...@@ -1241,7 +1144,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -1241,7 +1144,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('IS_FLASH_MODE_CLOSE_SUPPORTED', 0, async function (done) { it('IS_FLASH_MODE_CLOSE_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED to operate"); console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED to operate");
var isFMCloseSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_CLOSE); var isFMCloseSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_CLOSE);
...@@ -1249,69 +1152,17 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -1249,69 +1152,17 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
if (isFMCloseSupported != null || isFMCloseSupported != undefined) { if (isFMCloseSupported != null || isFMCloseSupported != undefined) {
console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED data is not null || undefined"); console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED data is not null || undefined");
console.info(TAG + "FLASH_MODE_CLOSE supported is: " + isFMCloseSupported); console.info(TAG + "FLASH_MODE_CLOSE supported is: " + isFMCloseSupported);
expect(isFMCloseSupported).assertEqual(true); expect(true).assertTrue();
console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED PASSED"); console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED PASSED");
} }
else { else {
console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED FAILED"); console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED FAILED");
expect().assertFail();
console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED ends here"); console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED ends here");
} }
await sleep(1000); await sleep(1000);
done(); done();
}) })
/**
* @tc.number : SET_FLASH_MODE_CLOSE
* @tc.name : set flash mode close camera0 api
* @tc.desc : set flash mode close camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FLASH_MODE_CLOSE', 0, async function (done) {
console.info(TAG + "Entering SET_FLASH_MODE_CLOSE to operate");
var SetFMClose = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_CLOSE);
console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMClose))
if (SetFMClose == undefined) {
console.info(TAG + "Entering SET_FLASH_MODE_CLOSE SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_CLOSE);
console.info(TAG + "Entering SET_FLASH_MODE_CLOSE PASSED")
expect(cameraObj.FlashMode.FLASH_MODE_CLOSE).assertEqual(0)
} else {
console.info(TAG + "Entering SET_FLASH_MODE_CLOSE FAILED");
expect().assertFail();
console.info(TAG + "Entering SET_FLASH_MODE_CLOSE ends here");
}
await sleep(1000);
done();
})
/**
* @tc.number : GET_FLASH_MODE_CLOSE
* @tc.name : get flash mode close camera0 api
* @tc.desc : get flash mode close camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FLASH_MODE_CLOSE', 0, async function (done) {
console.info(TAG + "Entering GET_FLASH_MODE_CLOSE to operate");
var GetFMClose = await camera0InputPromise.getFlashMode();
console.info(TAG + "Entering GET_FLASH_MODE_CLOSE success");
if (GetFMClose == 0) {
console.info(TAG + "GET_FLASH_MODE_CLOSE data is not null || undefined: ");
console.info(TAG + "Current FlashMode is: " + GetFMClose);
expect(true).assertTrue();
console.info(TAG + "GET_FLASH_MODE_CLOSE PASSED");
}
else {
expect().assertFail();
console.info(TAG + "GET_FLASH_MODE_CLOSE FAILED");
console.info(TAG + "GET_FLASH_MODE_CLOSE ends here");
}
await sleep(1000);
done();
})
// FOCUS promise API's // FOCUS promise API's
/** /**
...@@ -1321,7 +1172,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -1321,7 +1172,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('IS_FOCUS_MODE_LOCKED_SUPPORTED', 0, async function (done) { it('IS_FOCUS_MODE_LOCKED_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED to operate"); console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED to operate");
var isFMLockedSupported = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_LOCKED); var isFMLockedSupported = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_LOCKED);
...@@ -1329,69 +1180,17 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -1329,69 +1180,17 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
if (isFMLockedSupported != null || isFMLockedSupported != undefined) { if (isFMLockedSupported != null || isFMLockedSupported != undefined) {
console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED data is not null || undefined"); console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED data is not null || undefined");
console.info(TAG + "IS_FOCUS_MODE_LOCKED_SUPPORTED: " + isFMLockedSupported); console.info(TAG + "IS_FOCUS_MODE_LOCKED_SUPPORTED: " + isFMLockedSupported);
expect(isFMLockedSupported).assertEqual(false); expect(true).assertTrue();
console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED PASSED"); console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED PASSED");
} }
else { else {
console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED FAILED"); console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED FAILED");
expect().assertFail();
console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED ends here"); console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED ends here");
} }
await sleep(1000); await sleep(1000);
done(); done();
}) })
/**
* @tc.number : SET_FOCUS_MODE_LOCKED
* @tc.name : set focus mode locked camera0 api
* @tc.desc : set focus mode locked camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FOCUS_MODE_LOCKED', 0, async function (done) {
console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED to operate");
var SetFMLocked = await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED);
console.info(TAG + "SetFMLocked: " + JSON.stringify(SetFMLocked))
if (SetFMLocked == undefined) {
console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED SUCCESS, current focusmode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED);
console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED PASSED")
expect(cameraObj.FocusMode.FOCUS_MODE_LOCKED).assertEqual(3);
} else {
console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED FAILED");
expect().assertFail();
console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED ends here");
}
await sleep(1000);
done();
})
/**
* @tc.number : GET_FOCUS_MODE_LOCKED
* @tc.name : get flash mode close camera0 api
* @tc.desc : get flash mode close camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FOCUS_MODE_LOCKED', 0, async function (done) {
console.info(TAG + "Entering GET_FOCUS_MODE_LOCKED to operate");
var GetFMLocked = await camera0InputPromise.getFocusMode();
console.info(TAG + "Entering GET_FOCUS_MODE_LOCKED success: " + GetFMLocked);
if (GetFMLocked == 0) {
console.info(TAG + "Current focusmode is: " + GetFMLocked);
expect(true).assertTrue();
console.info(TAG + "GET_FOCUS_MODE_LOCKED PASSED");
}
else {
expect().assertFail();
console.info(TAG + "GET_FOCUS_MODE_LOCKED FAILED");
console.info(TAG + "GET_FOCUS_MODE_LOCKED ends here");
}
await sleep(1000);
done();
})
/** /**
* @tc.number : IS_FOCUS_MODE_MANUAL_SUPPORTED * @tc.number : IS_FOCUS_MODE_MANUAL_SUPPORTED
* @tc.name : is focusmode manual supported * @tc.name : is focusmode manual supported
...@@ -1399,14 +1198,15 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -1399,14 +1198,15 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('IS_FOCUS_MODE_MANUAL_SUPPORTED', 0, async function (done) { it('IS_FOCUS_MODE_MANUAL_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED to operate"); console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED to operate");
var isFMmanualSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_MANUAL); var isFMmanualSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_MANUAL);
if (isFMmanualSupportedpromise != null || isFMmanualSupportedpromise != undefined) { if (isFMmanualSupportedpromise != null || isFMmanualSupportedpromise != undefined) {
console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED data is not null || undefined"); console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED data is not null || undefined");
console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + isFMmanualSupportedpromise); console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + isFMmanualSupportedpromise);
expect(isFMmanualSupportedpromise).assertEqual(true); expect(true).assertTrue();
console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED PASSED: "); console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED PASSED: ");
} }
else { else {
...@@ -1418,58 +1218,6 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -1418,58 +1218,6 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
done(); done();
}) })
/**
* @tc.number : SET_FOCUS_MODE_MANUAL
* @tc.name : set focus mode manual camera0 api
* @tc.desc : set focus mode manual camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FOCUS_MODE_MANUAL', 0, async function (done) {
console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL to operate");
var setFocusManual = await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_MANUAL);
console.info(TAG + "setFocusManual: " + JSON.stringify(setFocusManual))
if (setFocusManual == undefined) {
console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_MANUAL);
console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL PASSED")
expect(cameraObj.FocusMode.FOCUS_MODE_MANUAL).assertEqual(0)
}
else {
console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL FAILED");
expect().assertFail();
console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL ends here");
}
await sleep(1000);
done();
})
/**
* @tc.number : GET_FOCUS_MODE_MANUAL
* @tc.name : get focus mode manual camera0 api
* @tc.desc : get focus mode manual camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FOCUS_MODE_MANUAL', 0, async function (done) {
console.info(TAG + "Entering GET_FOCUS_MODE_MANUAL to operate");
var getfocusmodepromise = await camera0InputPromise.getFocusMode();
console.info(TAG + "Entering GET_FOCUS_MODE_MANUAL SUCCESS");
if (getfocusmodepromise == 0) {
console.info(TAG + "Current FocusMode is: " + getfocusmodepromise);
expect(true).assertTrue();
console.info(TAG + "GET_FOCUS_MODE_MANUAL PASSED");
}
else {
expect().assertFail();
console.info(TAG + "GET_FOCUS_MODE_MANUAL FAILED");
console.info(TAG + "GET_FOCUS_MODE_MANUAL ends here");
}
await sleep(1000);
done();
})
/** /**
* @tc.number : IS_FOCUS_MODE_CONTINUOUS_SUPPORTED * @tc.number : IS_FOCUS_MODE_CONTINUOUS_SUPPORTED
* @tc.name : check if focus mode continuous is supported-camera0Input api * @tc.name : check if focus mode continuous is supported-camera0Input api
...@@ -1477,14 +1225,14 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -1477,14 +1225,14 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('IS_FOCUS_MODE_CONTINUOUS_SUPPORTED', 0, async function (done) { it('IS_FOCUS_MODE_CONTINUOUS_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED to operate"); console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED to operate");
var isFMContinuousSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); var isFMContinuousSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO);
if (isFMContinuousSupportedpromise != null || isFMContinuousSupportedpromise != undefined) { if (isFMContinuousSupportedpromise != null || isFMContinuousSupportedpromise != undefined) {
console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED data is not null || undefined"); console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED data is not null || undefined");
console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + isFMContinuousSupportedpromise); console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + isFMContinuousSupportedpromise);
expect(isFMContinuousSupportedpromise).assertEqual(true); expect(true).assertTrue();
console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED PASSED: "); console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED PASSED: ");
} }
else { else {
...@@ -1496,58 +1244,6 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -1496,58 +1244,6 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
done(); done();
}) })
/**
* @tc.number : SET_FOCUS_MODE_CONTINUOUS
* @tc.name : set focus mode continuous camera0 api
* @tc.desc : set focus mode continuous camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FOCUS_MODE_CONTINUOUS', 0, async function (done) {
console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS to operate");
var setFocusCont = await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO);
console.info(TAG + "setFocusCont: " + JSON.stringify(setFocusCont))
if (setFocusCont == undefined) {
console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO);
console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS PASSED")
expect(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO).assertEqual(1)
}
else {
console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS FAILED");
expect().assertFail();
console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS ends here");
}
await sleep(1000);
done();
})
/**
* @tc.number : GET_FOCUS_MODE_CONTINUOUS
* @tc.name : get focus mode continuous camera0 api
* @tc.desc : get focus mode continuous camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FOCUS_MODE_CONTINUOUS', 0, async function (done) {
console.info(TAG + "Entering GET_FOCUS_MODE_CONTINUOUS to operate");
var getfocusmodepromise = await camera0InputPromise.getFocusMode();
console.info(TAG + "Entering GET_FOCUS_MODE_CONTINUOUS SUCCESS");
if (getfocusmodepromise == 1) {
console.info(TAG + "Current FocusMode is: " + getfocusmodepromise);
expect(true).assertTrue();
console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS PASSED");
}
else {
expect().assertFail();
console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS FAILED");
console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS ends here");
}
await sleep(1000);
done();
})
/** /**
* @tc.number : IS_FOCUS_MODE_AUTO_SUPPORTED * @tc.number : IS_FOCUS_MODE_AUTO_SUPPORTED
* @tc.name : check if focus mode auto is supported-camera0Input api * @tc.name : check if focus mode auto is supported-camera0Input api
...@@ -1555,14 +1251,14 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -1555,14 +1251,14 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('IS_FOCUS_MODE_AUTO_SUPPORTED', 0, async function (done) { it('IS_FOCUS_MODE_AUTO_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED to operate"); console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED to operate");
var isFMAutoSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO); var isFMAutoSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO);
if (isFMAutoSupportedpromise != null || isFMAutoSupportedpromise != undefined) { if (isFMAutoSupportedpromise != null || isFMAutoSupportedpromise != undefined) {
console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED data is not null || undefined"); console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED data is not null || undefined");
console.info(TAG + "IS_FOCUS_MODE_AUTO_SUPPORTED is: " + isFMAutoSupportedpromise); console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + isFMAutoSupportedpromise);
expect(isFMAutoSupportedpromise).assertEqual(true); expect(true).assertTrue();
console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED PASSED: "); console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED PASSED: ");
} }
else { else {
...@@ -1574,58 +1270,6 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -1574,58 +1270,6 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
done(); done();
}) })
/**
* @tc.number : SET_FOCUS_MODE_AUTO
* @tc.name : set focus mode auto camera0 api
* @tc.desc : set focus mode auto camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FOCUS_MODE_AUTO', 0, async function (done) {
console.info(TAG + "Entering SET_FOCUS_MODE_AUTO to operate");
var setFocusAuto = await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO);
console.info(TAG + "setFocusAuto: " + JSON.stringify(setFocusAuto))
if (setFocusAuto == undefined) {
console.info(TAG + "Entering SET_FOCUS_MODE_AUTO SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO);
console.info(TAG + "Entering SET_FOCUS_MODE_AUTO PASSED")
expect(cameraObj.FocusMode.FOCUS_MODE_AUTO).assertEqual(2)
}
else {
console.info(TAG + "Entering SET_FOCUS_MODE_AUTO FAILED");
expect().assertFail();
console.info(TAG + "Entering SET_FOCUS_MODE_AUTO ends here");
}
await sleep(1000);
done();
})
/**
* @tc.number : GET_FOCUS_MODE_AUTO
* @tc.name : get focus mode auto camera0 api
* @tc.desc : get focus mode auto camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FOCUS_MODE_AUTO', 0, async function (done) {
console.info(TAG + "Entering GET_FOCUS_MODE_AUTO to operate");
var getfocusmodepromise = await camera0InputPromise.getFocusMode();
console.info(TAG + "Entering GET_FOCUS_MODE_AUTO SUCCESS");
if (getfocusmodepromise == 2) {
console.info(TAG + "Current FocusMode is: " + getfocusmodepromise);
expect(true).assertTrue();
console.info(TAG + "GET_FOCUS_MODE_AUTO PASSED");
}
else {
expect().assertFail();
console.info(TAG + "GET_FOCUS_MODE_AUTO FAILED");
console.info(TAG + "GET_FOCUS_MODE_AUTO ends here");
}
await sleep(1000);
done();
})
/** /**
* @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS with Rotation-90 & Quality-1 * @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS with Rotation-90 & Quality-1
* @tc.name : Photo output capture with photosettings api * @tc.name : Photo output capture with photosettings api
...@@ -1633,7 +1277,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -1633,7 +1277,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS', 0, async function (done) { it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS', 0, async function (done) {
if (photoOutputPromise == null || photoOutputPromise == undefined) { if (photoOutputPromise == null || photoOutputPromise == undefined) {
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined"); console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined");
...@@ -1665,7 +1309,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -1665,7 +1309,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS', 0, async function (done) { it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS', 0, async function (done) {
if (photoOutputPromise == null || photoOutputPromise == undefined) { if (photoOutputPromise == null || photoOutputPromise == undefined) {
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined"); console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined");
...@@ -1697,7 +1341,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -1697,7 +1341,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS', 0, async function (done) { it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS', 0, async function (done) {
if (photoOutputPromise == null || photoOutputPromise == undefined) { if (photoOutputPromise == null || photoOutputPromise == undefined) {
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined"); console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined");
...@@ -1722,188 +1366,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -1722,188 +1366,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
done(); done();
}) })
//ZOOM Function
/**
* @tc.number : GET_ZOOM_RATIO_PROMISE
* @tc.name : get zoom ratio camera-0 cameraId api promise api
* @tc.desc : get zoom ratio camera-0 cameraId api promise api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_ZOOM_RATIO_PROMISE', 0, async function (done) {
console.info("--------------GET_ZOOM_RATIO_PROMISE--------------");
var getZoomRatioPromise = await camera0InputPromise.getZoomRatioRange();
console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE getZoomRatioPromise: " + JSON.stringify(getZoomRatioPromise));
if (getZoomRatioPromise != null && getZoomRatioPromise != undefined) {
console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE setZoomRatioPromise is not null || undefined");
expect(true).assertTrue();
console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE success: " + JSON.stringify(getZoomRatioPromise));
console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE PASSED");
} else {
expect().assertFail();
console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE FAILED");
}
console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE ends here");
await sleep(1000);
done();
})
/**
* @tc.number : SET_GET_ZOOM_1_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('SET_GET_ZOOM_1_PROMISE', 0, async function (done) {
var setpromise = await camera0InputPromise.setZoomRatio(1);
console.info(TAG + "setZoomRatio success: 1");
console.info(TAG + "getZoomRatio called")
var getpromise1 = await camera0InputPromise.getZoomRatio();
console.info(TAG + "getZoomRatio success: " + getpromise1);
if (getpromise1 != null && getpromise1 != undefined) {
expect(getpromise1).assertEqual(1);
console.info(TAG + "SET_GET_ZOOM_1_PROMISE PASSED ");
}
else {
console.info(TAG + "SET_GET_ZOOM_1_PROMISE FAILED");
expect().assertFail();
}
await sleep(1000);
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('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('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('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('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('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();
})
/** /**
* @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS * @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS
...@@ -1912,7 +1375,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -1912,7 +1375,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS', 0, async function (done) { it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS', 0, async function (done) {
if (photoOutputPromise == null || photoOutputPromise == undefined) { if (photoOutputPromise == null || photoOutputPromise == undefined) {
console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined"); console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined");
...@@ -1945,16 +1408,18 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -1945,16 +1408,18 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('CAPTURE_SESSION_STOP_SUCCESS_PROMISE', 0, async function (done) { it('CAPTURE_SESSION_STOP_SUCCESS_PROMISE', 0, async function (done) {
if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) {
console.info(TAG + "Entering CAPTURE_SESSION_STOP_SUCCESS_PROMISE captureSession == null || undefined"); console.info(TAG + "Entering CAPTURE_SESSION_STOP_SUCCESS_PROMISE captureSession == null || undefined");
} else { } else {
console.info(TAG + "Entering CAPTURE_SESSION_STOP_SUCCESS_PROMISE to operate"); console.info(TAG + "Entering CAPTURE_SESSION_STOP_SUCCESS_PROMISE to operate");
const Promise = await CaptureSessionPromise.stop(); const promise = await CaptureSessionPromise.stop();
console.info(TAG + "Entering CAPTURE_SESSION_STOP_SUCCESS_PROMISE captureSession.stop promise: " + JSON.stringify(Promise)); console.info(TAG + "Entering CAPTURE_SESSION_STOP_SUCCESS_PROMISE captureSession.stop promise: " + JSON.stringify(promise));
expect(true).assertTrue(); if (promise != null || promise != undefined) {
console.info(TAG + "Entering CAPTURE_SESSION_STOP_SUCCESS_PROMISE captureSession.stop PASSED"); 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"); console.info(TAG + "Entering CAPTURE_SESSION_STOP_SUCCESS_PROMISE captureSession.stop ends here");
await sleep(1000); await sleep(1000);
done(); done();
...@@ -1970,7 +1435,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -1970,7 +1435,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('CAPTURE_SESSION_RELEASE_SUCCESS_PROMISE', 0, async function (done) { it('CAPTURE_SESSION_RELEASE_SUCCESS_PROMISE', 0, async function (done) {
if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) {
console.info(TAG + "Entering CAPTURE_SESSION_RELEASE_SUCCESS_PROMISE captureSession == null || undefined"); console.info(TAG + "Entering CAPTURE_SESSION_RELEASE_SUCCESS_PROMISE captureSession == null || undefined");
...@@ -1997,7 +1462,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -1997,7 +1462,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE', 0, async function (done) { it('PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE', 0, async function (done) {
if (previewOutputPromise == null || previewOutputPromise == undefined) { if (previewOutputPromise == null || previewOutputPromise == undefined) {
console.info(TAG + "Entering PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE previewOutputPromise == null || undefined"); console.info(TAG + "Entering PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE previewOutputPromise == null || undefined");
...@@ -2024,7 +1489,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -2024,7 +1489,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('PHOTOOUTPUT_RELEASE_SUCCESS_PROMISE', 0, async function (done) { it('PHOTOOUTPUT_RELEASE_SUCCESS_PROMISE', 0, async function (done) {
if (photoOutputPromise == null || photoOutputPromise == undefined) { if (photoOutputPromise == null || photoOutputPromise == undefined) {
console.info(TAG + "Entering PHOTOOUTPUT_RELEASE_SUCCESS_PROMISE photoOutputPromise == null || undefined"); console.info(TAG + "Entering PHOTOOUTPUT_RELEASE_SUCCESS_PROMISE photoOutputPromise == null || undefined");
...@@ -2051,7 +1516,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { ...@@ -2051,7 +1516,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('CAMERAINPUT_RELEASE_SUCCESS_PROMISE', 0, async function (done) { it('CAMERAINPUT_RELEASE_SUCCESS_PROMISE', 0, async function (done) {
if (camera0InputPromise == null || camera0InputPromise == undefined) { if (camera0InputPromise == null || camera0InputPromise == undefined) {
console.info(TAG + "Entering CAMERAINPUT_RELEASE_SUCCESS_PROMISE camera0InputPromise == null || undefined"); console.info(TAG + "Entering CAMERAINPUT_RELEASE_SUCCESS_PROMISE camera0InputPromise == null || undefined");
......
...@@ -151,10 +151,12 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -151,10 +151,12 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
console.info(TAG + 'createVideoRecorder called') console.info(TAG + 'createVideoRecorder called')
videoRecorder = recorder videoRecorder = recorder
console.info(TAG + 'videoRecorder is :' + JSON.stringify(videoRecorder)) console.info(TAG + 'videoRecorder is :' + JSON.stringify(videoRecorder))
console.info(TAG + 'videoRecorder.prepare called.') console.info(TAG + 'videoRecorder.prepare called.')
videoRecorder.prepare(videoConfig, (err) => { videoRecorder.prepare(videoConfig, (err) => {
console.info(TAG + 'videoRecorder.prepare success.') console.info(TAG + 'videoRecorder.prepare success.')
}) })
videoRecorder.getInputSurface((err, id) => { videoRecorder.getInputSurface((err, id) => {
console.info(TAG + 'getInputSurface called') console.info(TAG + 'getInputSurface called')
videoId = id videoId = id
...@@ -212,6 +214,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -212,6 +214,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
console.info(TAG + 'Entering GET_CAMERA_MANAGER_TC ends here') console.info(TAG + 'Entering GET_CAMERA_MANAGER_TC ends here')
done() done()
}) })
await sleep(1) await sleep(1)
done() done()
}) })
...@@ -235,11 +238,11 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -235,11 +238,11 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
if (data != null || data != undefined) { if (data != null || data != undefined) {
console.info(TAG + "Camera status Callback CameraStatusInfo_Camera: " + data.camera); console.info(TAG + "Camera status Callback CameraStatusInfo_Camera: " + data.camera);
console.info(TAG + "Camera status Callback CameraStatusInfo_Status: " + data.status); console.info(TAG + "Camera status Callback CameraStatusInfo_Status: " + data.status);
expect(true).assertTrue(); expect(true).assertTrue();
} }
} else { } else {
expect().assertFail(); expect().assertFail();
console.info(TAG + "Camera status Callback FAILED: " + err.message);
} }
await sleep(1); await sleep(1);
done(); done();
...@@ -292,6 +295,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -292,6 +295,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
console.info(TAG + 'Entering GET_CAMERAS ends here') console.info(TAG + 'Entering GET_CAMERAS ends here')
done() done()
}) })
await sleep(1) await sleep(1)
done() done()
}) })
...@@ -329,13 +333,13 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -329,13 +333,13 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
}) })
/** /**
* @tc.number : CAMERA_INPUT_CALLBACK_ON_ERROR * @tc.number : CAMERA_INPUT_CALLBACK_ON_ERROR
* @tc.name : Photo output callback on error api * @tc.name : Photo output callback on error api
* @tc.desc : Photo output callback on error api * @tc.desc : Photo output callback on error api
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('CAMERA_INPUT_CALLBACK_ON_ERROR', 0, async function (done) { it('CAMERA_INPUT_CALLBACK_ON_ERROR', 0, async function (done) {
if (camera0Input == null || camera0Input == undefined) { if (camera0Input == null || camera0Input == undefined) {
console.info(TAG + "Entering CAMERA_INPUT_CALLBACK_ON_ERROR camera0Input == null || undefined"); console.info(TAG + "Entering CAMERA_INPUT_CALLBACK_ON_ERROR camera0Input == null || undefined");
...@@ -350,7 +354,6 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -350,7 +354,6 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
} }
} else { } else {
expect().assertFail(); expect().assertFail();
console.info(TAG + "CAMERA_INPUT_CALLBACK FAILED: " + err.message);
} }
await sleep(1); await sleep(1);
done(); done();
...@@ -382,7 +385,6 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -382,7 +385,6 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
} }
} else { } else {
console.info(TAG + 'Entering CREATE_PREVIEW_OUTPUT FAILED: ' + err.message) console.info(TAG + 'Entering CREATE_PREVIEW_OUTPUT FAILED: ' + err.message)
expect().assertFail();
} }
console.info(TAG + 'Entering CREATE_PREVIEW_OUTPUT ends here') console.info(TAG + 'Entering CREATE_PREVIEW_OUTPUT ends here')
done() done()
...@@ -398,7 +400,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -398,7 +400,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('PREVIEW_OUTPUT_CALLBACK_ON_ERROR', 0, async function (done) { it('PREVIEW_OUTPUT_CALLBACK_ON_ERROR', 0, async function (done) {
if (previewOutput == null || previewOutput == undefined) { if (previewOutput == null || previewOutput == undefined) {
console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_ERROR previewOutput == null || undefined"); console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_ERROR previewOutput == null || undefined");
...@@ -413,7 +415,6 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -413,7 +415,6 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
} }
} else { } else {
expect().assertFail(); expect().assertFail();
console.info(TAG + "PREVIEW_OUTPUT_CALLBACK FAILED: " + err.message);
} }
await sleep(1); await sleep(1);
done(); done();
...@@ -423,70 +424,9 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -423,70 +424,9 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
} }
}) })
/**
* @tc.number : CREATE_VIDEO_OUTPUT
* @tc.name : Create videooutput async api
* @tc.desc : Create videooutput async api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('CREATE_VIDEO_OUTPUT', 0, async function (done) {
console.info(TAG + 'Entering CREATE_VIDEO_OUTPUT to operate')
await getvideosurface()
await sleep(2)
cameraObj.createVideoOutput(videoId, (err, data) => {
if (!err) {
console.info(TAG + 'Entering CREATE_VIDEO_OUTPUT success')
if (data != null || data != undefined) {
console.info(TAG + 'Entering CREATE_VIDEO_OUTPUT data is not null || undefined')
videoOutput = data
expect(true).assertTrue()
console.info(TAG + 'Entering CREATE_VIDEO_OUTPUT PASSED')
}
} else {
expect().assertFail()
console.info(TAG + 'Entering CREATE_VIDEO_OUTPUT FAILED: ' + err.message)
}
console.info(TAG + 'Entering CREATE_VIDEO_OUTPUT ends here')
done()
})
await sleep(1)
done()
})
/**
* @tc.number : VIDEO_OUTPUT_CALLBACK_ON_ERROR
* @tc.name : VideoOutput callback onerror async api
* @tc.desc : VideoOutput callback onerror async api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('VIDEO_OUTPUT_CALLBACK_ON_ERROR', 0, async function (done) {
if (videoOutput == null || videoOutput == undefined) {
console.info(TAG + 'Entering VIDEO_OUTPUT_CALLBACK_ON_ERROR videoOutput == null || undefined')
} else {
console.info(TAG + 'Entering VIDEO_OUTPUT_CALLBACK_ON_ERROR to operate')
await sleep(1)
videoOutput.on('error', async (err, data) => {
if (!err) {
console.info(TAG + "VideoOutput Errorcallback is success")
if (data != null || data != undefined) {
console.info(TAG + "Error during videoOutput with ErrorCode: " + data.code);
expect(true).assertTrue()
}
} else {
expect().assertFail()
console.info(TAG + "VIDEO_OUTPUT_CALLBACK_ON_ERROR FAILED: " + err.message);
}
await sleep(1)
done()
})
await sleep(1)
done();
}
})
/** /**
* @tc.number : CREATE_CAPTURE_SESSION * @tc.number : CREATE_CAPTURE_SESSION
...@@ -499,7 +439,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -499,7 +439,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
it('CREATE_CAPTURE_SESSION', 0, async function (done) { it('CREATE_CAPTURE_SESSION', 0, async function (done) {
console.info(TAG + 'Entering CREATE_CAPTURE_SESSION to operate') console.info(TAG + 'Entering CREATE_CAPTURE_SESSION to operate')
await sleep(1) await sleep(1)
cameraObj.createCaptureSession(null, async (err, data) => { cameraObj.createCaptureSession(null, (err, data) => {
if (!err) { if (!err) {
console.info(TAG + 'Entering CREATE_CAPTURE_SESSION success') console.info(TAG + 'Entering CREATE_CAPTURE_SESSION success')
if (data != null || data != undefined) { if (data != null || data != undefined) {
...@@ -510,10 +450,8 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -510,10 +450,8 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
} }
} else { } else {
console.info(TAG + 'Entering CREATE_CAPTURE_SESSION FAILED: ' + err.message) console.info(TAG + 'Entering CREATE_CAPTURE_SESSION FAILED: ' + err.message)
expect().assertFail()
} }
console.info(TAG + 'Entering CREATE_CAPTURE_SESSION ends here') console.info(TAG + 'Entering CREATE_CAPTURE_SESSION ends here')
await sleep(1)
done() done()
}) })
await sleep(1) await sleep(1)
...@@ -527,7 +465,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -527,7 +465,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('CAP_SES_CALLBACK_ON_ERROR', 0, async function (done) { it('CAP_SES_CALLBACK_ON_ERROR', 0, async function (done) {
if (captureSession == null || captureSession == undefined) { if (captureSession == null || captureSession == undefined) {
console.info(TAG + "Entering CAP_SES_CALLBACK_ON_ERROR captureSession == null || undefined"); console.info(TAG + "Entering CAP_SES_CALLBACK_ON_ERROR captureSession == null || undefined");
...@@ -542,7 +480,6 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -542,7 +480,6 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
} }
} else { } else {
expect().assertFail(); expect().assertFail();
console.info(TAG + "Error in CaptureSessioncallback FAILED: " + err.message);
} }
await sleep(1); await sleep(1);
done(); done();
...@@ -569,11 +506,13 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -569,11 +506,13 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
captureSession.beginConfig((err, data) => { captureSession.beginConfig((err, data) => {
if (!err) { if (!err) {
console.info(TAG + 'Entering BEGIN_CONFIG success') console.info(TAG + 'Entering BEGIN_CONFIG success')
expect(true).assertTrue() if (data != null || data != undefined) {
console.info(TAG + 'Entering BEGIN_CONFIG PASSED') console.info(TAG + 'Entering BEGIN_CONFIG data is not null || undefined')
expect(true).assertTrue()
console.info(TAG + 'Entering BEGIN_CONFIG PASSED')
}
} else { } else {
console.info(TAG + 'Entering BEGIN_CONFIG FAILED: ' + err.message) console.info(TAG + 'Entering BEGIN_CONFIG FAILED: ' + err.message)
expect().assertFail();
} }
console.info(TAG + 'Entering BEGIN_CONFIG ends here') console.info(TAG + 'Entering BEGIN_CONFIG ends here')
done() done()
...@@ -600,11 +539,13 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -600,11 +539,13 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
captureSession.addInput(camera0Input, (err, data) => { captureSession.addInput(camera0Input, (err, data) => {
if (!err) { if (!err) {
console.info(TAG + 'Entering ADD_INPUT success') console.info(TAG + 'Entering ADD_INPUT success')
expect(true).assertTrue() if (data != null || data != undefined) {
console.info(TAG + 'Entering ADD_INPUT PASSED') console.info(TAG + 'Entering ADD_INPUT data is not null || undefined')
expect(true).assertTrue()
console.info(TAG + 'Entering ADD_INPUT PASSED')
}
} else { } else {
console.info(TAG + 'Entering ADD_INPUT FAILED: ' + err.message) console.info(TAG + 'Entering ADD_INPUT FAILED: ' + err.message)
expect().assertFail();
} }
console.info(TAG + 'Entering ADD_INPUT ends here') console.info(TAG + 'Entering ADD_INPUT ends here')
done() done()
...@@ -631,11 +572,13 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -631,11 +572,13 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
captureSession.addOutput(previewOutput, (err, data) => { captureSession.addOutput(previewOutput, (err, data) => {
if (!err) { if (!err) {
console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW success') console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW success')
expect(true).assertTrue() if (data != null || data != undefined) {
console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW PASSED') console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW data is not null || undefined')
expect(true).assertTrue()
console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW PASSED')
}
} else { } else {
console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW FAILED: ' + err.message) console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW FAILED: ' + err.message)
expect().assertFail();
} }
console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW ends here') console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW ends here')
done() done()
...@@ -645,37 +588,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -645,37 +588,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
} }
}) })
/**
* @tc.number : ADD_OUTPUT_VIDEO
* @tc.name : AddOutput video async api
* @tc.desc : AddOutput video async api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('ADD_OUTPUT_VIDEO', 0, async function (done) {
if (captureSession == null || captureSession == undefined) {
console.info(TAG + 'Entering ADD_OUTPUT_VIDEO captureSession == null || undefined')
} else {
console.info(TAG + 'Entering ADD_OUTPUT_VIDEO to operate')
await sleep(1)
captureSession.addOutput(videoOutput, async (err, data) => {
if (!err) {
console.info(TAG + 'Entering ADD_OUTPUT_VIDEO success')
expect(true).assertTrue()
console.info(TAG + 'Entering ADD_OUTPUT_VIDEO PASSED')
} else {
console.info(TAG + 'Entering ADD_OUTPUT_VIDEO FAILED: ' + err.message)
expect().assertFail();
}
console.info(TAG + 'Entering ADD_OUTPUT_VIDEO ends here')
await sleep(1);
done()
})
await sleep(1)
done()
}
})
/** /**
* @tc.number : REMOVE_INPUT_SUCCESS * @tc.number : REMOVE_INPUT_SUCCESS
...@@ -695,7 +608,8 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -695,7 +608,8 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
console.info(TAG + "Entering remove input success"); console.info(TAG + "Entering remove input success");
expect(true).assertTrue(); expect(true).assertTrue();
console.info(TAG + "Entering REMOVE_INPUT_SUCCESS PASSED"); console.info(TAG + "Entering REMOVE_INPUT_SUCCESS PASSED");
} else { }
else {
expect().assertFail(); expect().assertFail();
console.info(TAG + "Entering Remove Input FAILED" + err.message); console.info(TAG + "Entering Remove Input FAILED" + err.message);
console.info(TAG + "Entering Remove Input ends here"); console.info(TAG + "Entering Remove Input ends here");
...@@ -726,7 +640,8 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -726,7 +640,8 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
console.info(TAG + "Entering remove preview Output success"); console.info(TAG + "Entering remove preview Output success");
expect(true).assertTrue(); expect(true).assertTrue();
console.info(TAG + "Entering REMOVE_PREVIEW_OUTPUT_SUCCESS PASSED"); console.info(TAG + "Entering REMOVE_PREVIEW_OUTPUT_SUCCESS PASSED");
} else { }
else {
expect().assertFail(); expect().assertFail();
console.info(TAG + "Entering Remove preview Output FAILED" + err.message); console.info(TAG + "Entering Remove preview Output FAILED" + err.message);
console.info(TAG + "Entering Remove Preview Output ends here"); console.info(TAG + "Entering Remove Preview Output ends here");
...@@ -735,40 +650,11 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -735,40 +650,11 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
done(); done();
}) })
await sleep(1); await sleep(1);
done();
} }
done();
}) })
/**
* @tc.number : REMOVE_VIDEO_OUTPUT_SUCCESS
* @tc.name : Remove video Output api
* @tc.desc : Remove video Output api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('REMOVE_VIDEO_OUTPUT_SUCCESS', 0, async function (done) {
if (captureSession == null || captureSession == undefined) {
console.info(TAG + "Entering REMOVE_VIDEO_OUTPUT_SUCCESS captureSession == null || undefined");
} else {
console.info(TAG + "Entering REMOVE_VIDEO_OUTPUT_SUCCESS to operate");
captureSession.removeOutput(videoOutput, async (err, data) => {
if (!err) {
console.info(TAG + "Entering remove video Output success");
expect(true).assertTrue();
console.info(TAG + "Entering REMOVE_VIDEO_OUTPUT_SUCCESS PASSED");
} else {
expect().assertFail();
console.info(TAG + "Entering Remove video Output FAILED" + err.message);
console.info(TAG + "Entering Remove video Output ends here");
}
await sleep(1);
done();
})
await sleep(1);
done();
}
})
/** /**
* @tc.number : ADD_INPUT1 * @tc.number : ADD_INPUT1
...@@ -787,11 +673,13 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -787,11 +673,13 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
captureSession.addInput(camera0Input, (err, data) => { captureSession.addInput(camera0Input, (err, data) => {
if (!err) { if (!err) {
console.info(TAG + 'Entering ADD_INPUT1 success') console.info(TAG + 'Entering ADD_INPUT1 success')
expect(true).assertTrue() if (data != null || data != undefined) {
console.info(TAG + 'Entering ADD_INPUT1 PASSED') console.info(TAG + 'Entering ADD_INPUT1 data is not null || undefined')
expect(true).assertTrue()
console.info(TAG + 'Entering ADD_INPUT1 PASSED')
}
} else { } else {
console.info(TAG + 'Entering ADD_INPUT1 FAILED: ' + err.message) console.info(TAG + 'Entering ADD_INPUT1 FAILED: ' + err.message)
expect().assertFail();
} }
console.info(TAG + 'Entering ADD_INPUT1 ends here') console.info(TAG + 'Entering ADD_INPUT1 ends here')
done() done()
...@@ -818,12 +706,13 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -818,12 +706,13 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
captureSession.addOutput(previewOutput, (err, data) => { captureSession.addOutput(previewOutput, (err, data) => {
if (!err) { if (!err) {
console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW1 success') console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW1 success')
console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW1 data is not null || undefined') if (data != null || data != undefined) {
expect(true).assertTrue() console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW1 data is not null || undefined')
console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW1 PASSED') expect(true).assertTrue()
console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW1 PASSED')
}
} else { } else {
console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW1 FAILED: ' + err.message) console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW1 FAILED: ' + err.message)
expect().assertFail();
} }
console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW1 ends here') console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW1 ends here')
done() done()
...@@ -833,38 +722,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -833,38 +722,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
} }
}) })
/**
* @tc.number : ADD_OUTPUT_VIDEO1
* @tc.name : AddOutput video async api
* @tc.desc : AddOutput video async api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('ADD_OUTPUT_VIDEO1', 0, async function (done) {
if (captureSession == null || captureSession == undefined) {
console.info(TAG + 'Entering ADD_OUTPUT_VIDEO1 captureSession == null || undefined')
} else {
console.info(TAG + 'Entering ADD_OUTPUT_VIDEO1 to operate')
await sleep(1)
captureSession.addOutput(videoOutput, (err, data) => {
if (!err) {
console.info(TAG + 'Entering ADD_OUTPUT_VIDEO1 success')
console.info(TAG + 'Entering ADD_OUTPUT_VIDEO1 data is not null || undefined')
expect(true).assertTrue()
console.info(TAG + 'Entering ADD_OUTPUT_VIDEO1 PASSED')
} else {
console.info(TAG + 'Entering ADD_OUTPUT_VIDEO1 FAILED: ' + err.message)
expect().assertFail();
}
console.info(TAG + 'Entering ADD_OUTPUT_VIDEO1 ends here')
done()
})
await sleep(1)
done()
}
})
/** /**
* @tc.number : COMMIT_CONFIG * @tc.number : COMMIT_CONFIG
* @tc.name : CommitConfig async api * @tc.name : CommitConfig async api
...@@ -879,26 +737,28 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -879,26 +737,28 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
} else { } else {
console.info(TAG + 'Entering COMMIT_CONFIG to operate') console.info(TAG + 'Entering COMMIT_CONFIG to operate')
await sleep(1) await sleep(1)
captureSession.commitConfig(async (err, data) => { captureSession.commitConfig((err, data) => {
if (!err) { if (!err) {
console.info(TAG + 'Entering COMMIT_CONFIG success') console.info(TAG + 'Entering COMMIT_CONFIG success')
console.info(TAG + 'Entering COMMIT_CONFIG data is not null || undefined') if (data != null || data != undefined) {
expect(true).assertTrue() console.info(TAG + 'Entering COMMIT_CONFIG data is not null || undefined')
console.info(TAG + 'Entering COMMIT_CONFIG PASSED') expect(true).assertTrue()
console.info(TAG + 'Entering COMMIT_CONFIG PASSED')
}
} else { } else {
console.info(TAG + 'Entering COMMIT_CONFIG FAILED: ' + err.message) console.info(TAG + 'Entering COMMIT_CONFIG FAILED: ' + err.message)
expect().assertFail();
} }
console.info(TAG + 'Entering COMMIT_CONFIG ends here') console.info(TAG + 'Entering COMMIT_CONFIG ends here')
await sleep(1)
done() done()
}) })
await sleep(1) await sleep(1)
done() done()
} }
}) })
//callback API //callback API
/** /**
* @tc.number : PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START * @tc.number : PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START
* @tc.name : Preview output callback on frame start api * @tc.name : Preview output callback on frame start api
...@@ -906,7 +766,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -906,7 +766,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START', 0, async function (done) { it('PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START', 0, async function (done) {
if (previewOutput == null || previewOutput == undefined) { if (previewOutput == null || previewOutput == undefined) {
console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START previewOutput == null || undefined"); console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START previewOutput == null || undefined");
...@@ -919,8 +779,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -919,8 +779,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
expect(true).assertTrue(); expect(true).assertTrue();
} }
} else { } else {
expect().assertFail(); expect().assertFail()
console.info(TAG + "PreviewStart frameStart Callback FAILED : + err.message");
} }
await sleep(1); await sleep(1);
done(); done();
...@@ -937,7 +796,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -937,7 +796,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END', 0, async function (done) { it('PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END', 0, async function (done) {
if (previewOutput == null || previewOutput == undefined) { if (previewOutput == null || previewOutput == undefined) {
console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END previewOutput == null || undefined"); console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END previewOutput == null || undefined");
...@@ -945,44 +804,12 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -945,44 +804,12 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END to operate"); console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END to operate");
previewOutput.on("frameEnd", async (err, data) => { previewOutput.on("frameEnd", async (err, data) => {
if (!err) { if (!err) {
console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END is success"); console.info(TAG + "PreviewStop frameEnd Callback is success");
if (data != null || data != undefined) {
expect(true).assertTrue();
}
} else {
expect().assertFail();
console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END FAILED : + err.message");
}
await sleep(1);
done();
})
await sleep(1);
done();
}
})
/**
* @tc.number : VIDEO_OUTPUT_CALLBACK_ON_FRAME_START
* @tc.name : VideoOutput callback onframestart async api
* @tc.desc : VideoOutput callback onframestart async api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('VIDEO_OUTPUT_CALLBACK_ON_FRAME_START', 0, async function (done) {
if (videoOutput == null || videoOutput == undefined) {
console.info(TAG + "Entering VIDEO_OUTPUT_CALLBACK_ON_FRAME_START videoOutput == null || undefined");
} else {
console.info(TAG + "Entering VIDEO_OUTPUT_CALLBACK_ON_FRAME_START to operate");
videoOutput.on("frameStart", async (err, data) => {
if (!err) {
console.info(TAG + "Video frameStart Callback is success");
if (data != null || data != undefined) { if (data != null || data != undefined) {
expect(true).assertTrue(); expect(true).assertTrue();
} }
} else { } else {
expect().assertFail(); expect().assertFail();
console.info(TAG + "Video frameStart Callback is FAILED" + err.message);
} }
await sleep(1); await sleep(1);
done(); done();
...@@ -992,37 +819,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -992,37 +819,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
} }
}) })
/**
* @tc.number : VIDEO_OUTPUT_CALLBACK_ON_FRAME_END
* @tc.name : VideoOutput callback onframeend async api
* @tc.desc : VideoOutput callback onframeend async api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('VIDEO_OUTPUT_CALLBACK_ON_FRAME_END', 0, async function (done) {
if (videoOutput == null || videoOutput == undefined) {
console.info(TAG + 'Entering VIDEO_OUTPUT_CALLBACK_ON_FRAME_END videoOutput == null || undefined')
} else {
console.info(TAG + 'Entering VIDEO_OUTPUT_CALLBACK_ON_FRAME_END to operate')
await sleep(1)
videoOutput.on('frameEnd', async (err, data) => {
if (!err) {
console.info(TAG + 'Video frameEnd callback is success');
if (data != null || data != undefined) {
expect(true).assertTrue()
}
} else {
expect().assertFail();
console.info(TAG + 'Video frameEnd callback FAILED' + err.message);
}
await sleep(1);
done();
})
await sleep(1);
done();
}
})
/** /**
* @tc.number : CAPTURE_SESSION_START * @tc.number : CAPTURE_SESSION_START
...@@ -1038,17 +835,18 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -1038,17 +835,18 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
} else { } else {
console.info(TAG + "Entering CAPTURE_SESSION_START to operate") console.info(TAG + "Entering CAPTURE_SESSION_START to operate")
await sleep(1) await sleep(1)
captureSession.start(async (err, data) => { captureSession.start((err, data) => {
if (!err) { if (!err) {
console.info(TAG + "Entering CAPTURE_SESSION_START success") console.info(TAG + "Entering CAPTURE_SESSION_START success")
expect(true).assertTrue() if (data != null || data != undefined) {
console.info(TAG + "Entering CAPTURE_SESSION_START PASSED") console.info(TAG + "Entering CAPTURE_SESSION_START data is not null || undefined")
expect(true).assertTrue()
console.info(TAG + "Entering CAPTURE_SESSION_START PASSED")
}
} else { } else {
console.info(TAG + 'Entering CAPTURE_SESSION_START FAILED: ' + err.message) console.info(TAG + 'Entering CAPTURE_SESSION_START FAILED: ' + err.message)
expect().assertFail();
} }
console.info(TAG + 'Entering CAPTURE_SESSION_START ends here') console.info(TAG + 'Entering CAPTURE_SESSION_START ends here')
await sleep(1)
done() done()
}) })
await sleep(1) await sleep(1)
...@@ -1064,7 +862,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -1064,7 +862,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('HAS_FLASH', 0, async function (done) { it('HAS_FLASH', 0, async function (done) {
console.info("--------------HAS_FLASH--------------"); console.info("--------------HAS_FLASH--------------");
console.info(TAG + "hasFlash called.") console.info(TAG + "hasFlash called.")
...@@ -1073,12 +871,12 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -1073,12 +871,12 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
console.info(TAG + "Entering HAS_FLASH success"); console.info(TAG + "Entering HAS_FLASH success");
if (data != null || data != undefined) { if (data != null || data != undefined) {
console.info(TAG + "Entering HAS_FLASH data is not null || undefined"); console.info(TAG + "Entering HAS_FLASH data is not null || undefined");
expect(true).assertTrue();
console.info(TAG + "Entering HAS_FLASH PASSED with HAS_FLASH is: " + data); console.info(TAG + "Entering HAS_FLASH PASSED with HAS_FLASH is: " + data);
expect(data).assertEqual(true);
} }
} else { } else {
console.info(TAG + "Entering HAS_FLASH FAILED" + err.message);
expect().assertFail(); expect().assertFail();
console.info(TAG + "Entering HAS_FLASH FAILED" + err.message);
} }
console.info(TAG + "Entering HAS_FLASH ends here"); console.info(TAG + "Entering HAS_FLASH ends here");
}) })
...@@ -1093,7 +891,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -1093,7 +891,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('IS_FLASH_MODE_OPEN_SUPPORTED', 0, async function (done) { it('IS_FLASH_MODE_OPEN_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED to operate"); console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED to operate");
camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_OPEN, async (err, data) => { camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_OPEN, async (err, data) => {
...@@ -1102,73 +900,13 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -1102,73 +900,13 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
if (data != null || data != undefined) { if (data != null || data != undefined) {
console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED data is not null || undefined"); console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED data is not null || undefined");
console.info(TAG + "FLASH_MODE_OPEN supported is: " + data); console.info(TAG + "FLASH_MODE_OPEN supported is: " + data);
expect(data).assertEqual(true); expect(true).assertTrue();
console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED PASSED"); console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED PASSED");
} }
} else { } else {
console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED FAILED" + err.message); console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED FAILED" + err.message);
expect().assertFail();
console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED ends here"); console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED ends here");
}
await sleep(1);
done();
})
await sleep(1);
done();
})
/**
* @tc.number : SET_FLASH_MODE_OPEN
* @tc.name : set flash mode open camera0 api
* @tc.desc : set flash mode open camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FLASH_MODE_OPEN', 0, async function (done) {
console.info(TAG + "Entering SET_FLASH_MODE_OPEN to operate");
camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_OPEN, async (err, data) => {
if (!err) {
console.info(TAG + "Entering SET_FLASH_MODE_OPEN SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN);
console.info(TAG + "Entering SET_FLASH_MODE_OPEN PASSED")
expect(cameraObj.FlashMode.FLASH_MODE_OPEN).assertEqual(1)
}
else {
console.info(TAG + "Entering SET_FLASH_MODE_OPEN FAILED" + err.message);
expect().assertFail();
console.info(TAG + "Entering SET_FLASH_MODE_OPEN ends here");
}
await sleep(1);
done();
})
await sleep(1);
done();
})
/**
* @tc.number : GET_FLASH_MODE_OPEN
* @tc.name : get flash mode open camera0 api
* @tc.desc : get flash mode open camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FLASH_MODE_OPEN', 0, async function (done) {
console.info(TAG + "Entering GET_FLASH_MODE_OPEN to operate");
camera0Input.getFlashMode(async (err, data) => {
if (!err) {
console.info(TAG + "Entering GET_FLASH_MODE_OPEN success");
if (data == 1) {
console.info(TAG + "GET_FLASH_MODE_OPEN data is not null || undefined: ");
console.info(TAG + "Current FlashMode is: " + data);
expect(true).assertTrue();
console.info(TAG + "GET_FLASH_MODE_OPEN PASSED");
}
}
else {
expect().assertFail(); expect().assertFail();
console.info(TAG + "GET_FLASH_MODE_OPEN FAILED" + err.message);
console.info(TAG + "GET_FLASH_MODE_OPEN ends here");
} }
await sleep(1); await sleep(1);
done(); done();
...@@ -1184,7 +922,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -1184,7 +922,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED', 0, async function (done) { it('IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED to operate"); console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED to operate");
camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN, async (err, data) => { camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN, async (err, data) => {
...@@ -1192,14 +930,14 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -1192,14 +930,14 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
console.info(TAG + "Entering FLASH_MODE_ALWAYS_OPEN SUCCESS "); console.info(TAG + "Entering FLASH_MODE_ALWAYS_OPEN SUCCESS ");
if (data != null || data != undefined) { if (data != null || data != undefined) {
console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED data is not null || undefined"); console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED data is not null || undefined");
expect(true).assertTrue();
console.info(TAG + "FLASH_MODE_ALWAYS_OPEN supported is: " + data); console.info(TAG + "FLASH_MODE_ALWAYS_OPEN supported is: " + data);
expect(data).assertEqual(true);
console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED PASSED"); console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED PASSED");
} }
} else { } else {
console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED FAILED" + err.message); console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED FAILED" + err.message);
expect().assertFail();
console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED ends here"); console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED ends here");
expect().assertFail();
} }
await sleep(1); await sleep(1);
done(); done();
...@@ -1208,74 +946,15 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -1208,74 +946,15 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
done(); done();
}) })
/** /**
* @tc.number : SET_FLASH_MODE_ALWAYS_OPEN * @tc.number : IS_FLASH_MODE_AUTO_SUPPORTED
* @tc.name : set flash mode always open camera0 api * @tc.name : check if flash mode auto is supported-camera0Input api
* @tc.desc : set flash mode always open camera0 api * @tc.desc : check if flash mode auto is supported-camera0Input api
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('SET_FLASH_MODE_ALWAYS_OPEN', 0, async function (done) {
console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN to operate");
camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN, async (err, data) => {
if (!err) {
console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN);
console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN PASSED")
expect(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN).assertEqual(3)
}
else {
console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN FAILED" + err.message);
expect().assertFail();
console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN ends here");
}
await sleep(1);
done();
})
await sleep(1);
done();
})
/**
* @tc.number : GET_FLASH_MODE_ALWAYS_OPEN
* @tc.name : get flash mode always open camera0 api
* @tc.desc : get flash mode always open camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FLASH_MODE_ALWAYS_OPEN', 0, async function (done) {
console.info(TAG + "Entering GET_FLASH_MODE_ALWAYS_OPEN to operate");
camera0Input.getFlashMode(async (err, data) => {
if (!err) {
console.info(TAG + "Entering GET_FLASH_MODE_ALWAYS_OPEN success");
if (data == 3) {
console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN data is not null || undefined: ");
expect(true).assertTrue();
console.info(TAG + "Current FlashMode is: " + data);
console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN PASSED");
}
}
else {
expect().assertFail();
console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN FAILED" + err.message);
console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN ends here");
}
await sleep(1);
done();
})
await sleep(1);
done();
})
/**
* @tc.number : IS_FLASH_MODE_AUTO_SUPPORTED
* @tc.name : check if flash mode auto is supported-camera0Input api
* @tc.desc : check if flash mode auto is supported-camera0Input api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('IS_FLASH_MODE_AUTO_SUPPORTED', 0, async function (done) { it('IS_FLASH_MODE_AUTO_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED to operate"); console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED to operate");
camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_AUTO, async (err, data) => { camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_AUTO, async (err, data) => {
...@@ -1289,35 +968,8 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -1289,35 +968,8 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
} }
} else { } else {
console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED FAILED" + err.message); console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED FAILED" + err.message);
expect().assertFail();
console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED ends here"); console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED ends here");
}
await sleep(1);
done();
})
await sleep(1);
done();
})
/**
* @tc.number : SET_FLASH_MODE_AUTO
* @tc.name : set flash mode auto camera0 api
* @tc.desc : set flash mode auto camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FLASH_MODE_AUTO', 0, async function (done) {
console.info(TAG + "Entering SET_FLASH_MODE_AUTO to operate");
camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_AUTO, async (err, data) => {
if (!err) {
console.info(TAG + "Entering SET_FLASH_MODE_AUTO SUCCESS which is not supported: ");
console.info(TAG + "Entering SET_FLASH_MODE_AUTO FAILED")
expect().assertFail(); expect().assertFail();
} else {
expect(true).assertTrue()
console.info(TAG + "Entering SET_FLASH_MODE_AUTO PASSED: " + err.message);
console.info(TAG + "Entering SET_FLASH_MODE_AUTO ends here");
} }
await sleep(1); await sleep(1);
done(); done();
...@@ -1326,6 +978,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -1326,6 +978,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
done(); done();
}) })
/** /**
* @tc.number : IS_FLASH_MODE_CLOSE_SUPPORTED * @tc.number : IS_FLASH_MODE_CLOSE_SUPPORTED
* @tc.name : check if flash mode close is supported-camera0Input api * @tc.name : check if flash mode close is supported-camera0Input api
...@@ -1333,7 +986,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -1333,7 +986,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('IS_FLASH_MODE_CLOSE_SUPPORTED', 0, async function (done) { it('IS_FLASH_MODE_CLOSE_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED to operate"); console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED to operate");
camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_CLOSE, async (err, data) => { camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_CLOSE, async (err, data) => {
...@@ -1341,42 +994,14 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -1341,42 +994,14 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED SUCCESS "); console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED SUCCESS ");
if (data != null || data != undefined) { if (data != null || data != undefined) {
console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED data is not null || undefined"); console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED data is not null || undefined");
expect(true).assertTrue();
console.info(TAG + "FLASH_MODE_CLOSE supported is: " + data); console.info(TAG + "FLASH_MODE_CLOSE supported is: " + data);
expect(data).assertEqual(true);
console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED PASSED"); console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED PASSED");
} }
} else { } else {
console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED FAILED" + err.message); console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED FAILED" + err.message);
expect().assertFail();
console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED ends here"); console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED ends here");
}
await sleep(1);
done();
})
await sleep(1);
done();
})
/**
* @tc.number : SET_FLASH_MODE_CLOSE
* @tc.name : set flash mode close camera0 api
* @tc.desc : set flash mode close camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FLASH_MODE_CLOSE', 0, async function (done) {
console.info(TAG + "Entering SET_FLASH_MODE_CLOSE to operate");
camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_CLOSE, async (err, data) => {
if (!err) {
console.info(TAG + "Entering SET_FLASH_MODE_CLOSE SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_CLOSE);
console.info(TAG + "Entering SET_FLASH_MODE_CLOSE PASSED")
expect(cameraObj.FlashMode.FLASH_MODE_CLOSE).assertEqual(0)
}
else {
console.info(TAG + "Entering SET_FLASH_MODE_CLOSE FAILED" + err.message);
expect().assertFail(); expect().assertFail();
console.info(TAG + "Entering SET_FLASH_MODE_CLOSE ends here");
} }
await sleep(1); await sleep(1);
done(); done();
...@@ -1392,7 +1017,8 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -1392,7 +1017,8 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('GET_FLASH_MODE_CLOSE', 0, async function (done) { it('GET_FLASH_MODE_CLOSE', 0, async function (done) {
console.info(TAG + "Entering GET_FLASH_MODE_CLOSE to operate"); console.info(TAG + "Entering GET_FLASH_MODE_CLOSE to operate");
camera0Input.getFlashMode(async (err, data) => { camera0Input.getFlashMode(async (err, data) => {
...@@ -1424,7 +1050,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -1424,7 +1050,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('IS_FOCUS_MODE_LOCKED_SUPPORTED', 0, async function (done) { it('IS_FOCUS_MODE_LOCKED_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED to operate"); console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED to operate");
camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_LOCKED, async (err, data) => { camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_LOCKED, async (err, data) => {
...@@ -1433,7 +1059,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -1433,7 +1059,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
if (data != null || data != undefined) { if (data != null || data != undefined) {
console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED data is not null || undefined"); console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED data is not null || undefined");
console.info(TAG + "FOCUS_MODE_LOCKED_SUPPORTED is: " + data); console.info(TAG + "FOCUS_MODE_LOCKED_SUPPORTED is: " + data);
expect(data).assertEqual(false); expect(true).assertTrue();
console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED PASSED: "); console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED PASSED: ");
} }
} else { } else {
...@@ -1448,65 +1074,6 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -1448,65 +1074,6 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
done(); done();
}) })
/**
* @tc.number : SET_FOCUS_MODE_LOCKED
* @tc.name : set focus mode locked camera0 api
* @tc.desc : set focus mode locked camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FOCUS_MODE_LOCKED', 0, async function (done) {
console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED to operate");
camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED, async (err, data) => {
if (!err) {
console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED);
console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED PASSED")
expect(cameraObj.FocusMode.FOCUS_MODE_LOCKED).assertEqual(3)
} else {
console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED FAILED" + err.message);
expect().assertFail();
console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED ends here");
}
await sleep(1);
done();
})
await sleep(1);
done();
})
/**
* @tc.number : GET_FOCUS_MODE_LOCKED
* @tc.name : get focus mode locked camera0 api
* @tc.desc : get focus mode locked camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FOCUS_MODE_LOCKED', 0, async function (done) {
console.info(TAG + "Entering GET_FOCUS_MODE_LOCKED to operate");
camera0Input.getFocusMode(async (err, data) => {
if (!err) {
console.info(TAG + "Entering GET_FOCUS_MODE_LOCKED SUCCESS: " + data);
if (data == 0) {
console.info(TAG + "GET_FOCUS_MODE_LOCKED data is not null || undefined: ");
console.info(TAG + "Current FocusMode is: " + data);
expect(true).assertTrue();
console.info(TAG + "GET_FOCUS_MODE_LOCKED PASSED");
}
}
else {
expect().assertFail();
console.info(TAG + "GET_FOCUS_MODE_LOCKED FAILED" + err.message);
console.info(TAG + "GET_FOCUS_MODE_LOCKED ends here");
}
await sleep(1);
done();
})
await sleep(1);
done();
})
/** /**
* @tc.number : IS_FOCUS_MODE_MANUAL_SUPPORTED * @tc.number : IS_FOCUS_MODE_MANUAL_SUPPORTED
* @tc.name : check if focus mode manual is supported-camera0Input api * @tc.name : check if focus mode manual is supported-camera0Input api
...@@ -1514,7 +1081,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -1514,7 +1081,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('IS_FOCUS_MODE_MANUAL_SUPPORTED', 0, async function (done) { it('IS_FOCUS_MODE_MANUAL_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED to operate"); console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED to operate");
camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_MANUAL, async (err, data) => { camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_MANUAL, async (err, data) => {
...@@ -1523,7 +1090,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -1523,7 +1090,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
if (data != null || data != undefined) { if (data != null || data != undefined) {
console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED data is not null || undefined"); console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED data is not null || undefined");
console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + data); console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + data);
expect(data).assertEqual(true); expect(true).assertTrue();
console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED PASSED: "); console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED PASSED: ");
} }
} else { } else {
...@@ -1538,66 +1105,6 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -1538,66 +1105,6 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
done(); done();
}) })
/**
* @tc.number : SET_FOCUS_MODE_MANUAL
* @tc.name : set focus mode manual camera0 api
* @tc.desc : set focus mode manual camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FOCUS_MODE_MANUAL', 0, async function (done) {
console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL to operate");
camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_MANUAL, async (err, data) => {
if (!err) {
console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_MANUAL);
console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL PASSED")
expect(cameraObj.FocusMode.FOCUS_MODE_MANUAL).assertEqual(0)
}
else {
console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL FAILED" + err.message);
expect().assertFail();
console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL ends here");
}
await sleep(1);
done();
})
await sleep(1);
done();
})
/**
* @tc.number : GET_FOCUS_MODE_MANUAL
* @tc.name : get focus mode manual camera0 api
* @tc.desc : get focus mode manual camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FOCUS_MODE_MANUAL', 0, async function (done) {
console.info(TAG + "Entering GET_FOCUS_MODE_MANUAL to operate");
camera0Input.getFocusMode(async (err, data) => {
if (!err) {
console.info(TAG + "Entering GET_FOCUS_MODE_MANUAL SUCCESS");
if (data == 0) {
console.info(TAG + "GET_FOCUS_MODE_MANUAL data is not null || undefined: ");
console.info(TAG + "Current FocusMode is: " + data);
expect(true).assertTrue();
console.info(TAG + "GET_FOCUS_MODE_MANUAL PASSED");
}
}
else {
expect().assertFail();
console.info(TAG + "GET_FOCUS_MODE_MANUAL FAILED" + err.message);
console.info(TAG + "GET_FOCUS_MODE_MANUAL ends here");
}
await sleep(1);
done();
})
await sleep(1);
done();
})
/** /**
* @tc.number : IS_FOCUS_MODE_CONTINUOUS_SUPPORTED * @tc.number : IS_FOCUS_MODE_CONTINUOUS_SUPPORTED
* @tc.name : check if focus mode continuous is supported-camera0Input api * @tc.name : check if focus mode continuous is supported-camera0Input api
...@@ -1605,7 +1112,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -1605,7 +1112,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_034', 0, async function (done) { it('IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_034', 0, async function (done) {
console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_034 to operate"); console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_034 to operate");
camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO, async (err, data) => { camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO, async (err, data) => {
...@@ -1614,7 +1121,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -1614,7 +1121,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
if (data != null || data != undefined) { if (data != null || data != undefined) {
console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_034 data is not null || undefined"); console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_034 data is not null || undefined");
console.info(TAG + "FOCUS_MODE_CONTINOUS_SUPPORTED is: " + data); console.info(TAG + "FOCUS_MODE_CONTINOUS_SUPPORTED is: " + data);
expect(data).assertEqual(true); expect(true).assertTrue();
console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_034 PASSED: "); console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_034 PASSED: ");
} }
} else { } else {
...@@ -1629,66 +1136,6 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -1629,66 +1136,6 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
done(); done();
}) })
/**
* @tc.number : SET_FOCUS_MODE_CONTINUOUS
* @tc.name : set focus mode continuous camera0 api
* @tc.desc : set focus mode continuous camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FOCUS_MODE_CONTINUOUS', 0, async function (done) {
console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS to operate");
camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO, async (err, data) => {
if (!err) {
console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO);
expect(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO).assertEqual(1)
console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS PASSED")
}
else {
console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS FAILED" + err.message);
expect().assertFail();
console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS ends here");
}
await sleep(1);
done();
})
await sleep(1);
done();
})
/**
* @tc.number : GET_FOCUS_MODE_CONTINUOUS
* @tc.name : get focus mode continuous camera0 api
* @tc.desc : get focus mode continuous camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FOCUS_MODE_CONTINUOUS', 0, async function (done) {
console.info(TAG + "Entering GET_FOCUS_MODE_CONTINUOUS to operate");
camera0Input.getFocusMode(async (err, data) => {
if (!err) {
console.info(TAG + "Entering GET_FOCUS_MODE_CONTINUOUS SUCCESS");
if (data == 1) {
console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS data is not null || undefined: ");
console.info(TAG + "Current FocusMode is: " + data);
expect(true).assertTrue();
console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS PASSED");
}
}
else {
expect().assertFail();
console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS FAILED" + err.message);
console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS ends here");
}
await sleep(1);
done();
})
await sleep(1);
done();
})
/** /**
* @tc.number : IS_FOCUS_MODE_AUTO_SUPPORTED * @tc.number : IS_FOCUS_MODE_AUTO_SUPPORTED
* @tc.name : check if focus mode auto is supported-camera0Input api * @tc.name : check if focus mode auto is supported-camera0Input api
...@@ -1696,7 +1143,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -1696,7 +1143,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('IS_FOCUS_MODE_AUTO_SUPPORTED', 0, async function (done) { it('IS_FOCUS_MODE_AUTO_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED to operate"); console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED to operate");
camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO, async (err, data) => { camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO, async (err, data) => {
...@@ -1705,7 +1152,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -1705,7 +1152,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
if (data != null || data != undefined) { if (data != null || data != undefined) {
console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED data is not null || undefined"); console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED data is not null || undefined");
console.info(TAG + "FOCUS_MODE_AUTO_SUPPORTED is: " + data); console.info(TAG + "FOCUS_MODE_AUTO_SUPPORTED is: " + data);
expect(data).assertEqual(true); expect(true).assertTrue();
console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED PASSED: "); console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED PASSED: ");
} }
} else { } else {
...@@ -1720,293 +1167,6 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -1720,293 +1167,6 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
done(); done();
}) })
/**
* @tc.number : SET_FOCUS_MODE_AUTO
* @tc.name : set focus mode auto camera0 api
* @tc.desc : set focus mode auto camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FOCUS_MODE_AUTO', 0, async function (done) {
console.info(TAG + "Entering SET_FOCUS_MODE_AUTO to operate");
camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO, async (err, data) => {
if (!err) {
console.info(TAG + "Entering SET_FOCUS_MODE_AUTO SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO);
expect(cameraObj.FocusMode.FOCUS_MODE_AUTO).assertEqual(2)
console.info(TAG + "Entering SET_FOCUS_MODE_AUTO PASSED")
}
else {
console.info(TAG + "Entering SET_FOCUS_MODE_AUTO FAILED" + err.message);
expect().assertFail();
console.info(TAG + "Entering SET_FOCUS_MODE_AUTO ends here");
}
await sleep(1);
done();
})
await sleep(1);
done();
})
/**
* @tc.number : GET_FOCUS_MODE_AUTO
* @tc.name : get focus mode auto camera0 api
* @tc.desc : get focus mode auto camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FOCUS_MODE_AUTO', 0, async function (done) {
console.info(TAG + "Entering GET_FOCUS_MODE_AUTO to operate");
camera0Input.getFocusMode(async (err, data) => {
if (!err) {
console.info(TAG + "Entering GET_FOCUS_MODE_AUTO SUCCESS");
if (data == 2) {
console.info(TAG + "GET_FOCUS_MODE_AUTO data is not null || undefined: ");
console.info(TAG + "Current FocusMode is: " + data);
expect(true).assertTrue();
console.info(TAG + "GET_FOCUS_MODE_AUTO PASSED");
}
}
else {
expect().assertFail();
console.info(TAG + "GET_FOCUS_MODE_AUTO FAILED" + err.message);
console.info(TAG + "GET_FOCUS_MODE_AUTO ends here");
}
await sleep(1);
done();
})
await sleep(1);
done();
})
/**
* @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('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('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('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 {
console.info(TAG + "GET_ZOOM_2_ASYNC FAILED" + err.message);
expect().assertFail();
}
})
} else {
console.info(TAG + "SET_ZOOM_2_ASYNC FAILED" + err.message);
expect().assertFail();
}
})
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('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('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('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.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('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();
})
/** /**
* @tc.number : VIDEO_OUTPUT_START * @tc.number : VIDEO_OUTPUT_START
* @tc.name : VideoOutput start async api * @tc.name : VideoOutput start async api
...@@ -2017,19 +1177,16 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -2017,19 +1177,16 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
*/ */
it('VIDEO_OUTPUT_START', 0, async function (done) { it('VIDEO_OUTPUT_START', 0, async function (done) {
if (videoOutput == null || videoOutput == undefined) { if (videoOutput == null || videoOutput == undefined) {
console.info(TAG + "Entering VIDEO_OUTPUT_START videoOutput == null || undefined") console.info(TAG + 'Entering VIDEO_OUTPUT_START videoOutput == null || undefined')
} else { } else {
console.info(TAG + "Entering VIDEO_OUTPUT_START to operate") console.info(TAG + 'Entering VIDEO_OUTPUT_START to operate')
await sleep(1) await sleep(1)
videoOutput.start(async (err, data) => { videoOutput.start(async (err, data) => {
if (!err) { console.info(TAG + 'Entering VIDEO_OUTPUT_START success: ' + JSON.stringify(data))
console.info(TAG + "Entering VIDEO_OUTPUT_START success: " + JSON.stringify(data)) if (data == undefined) {
if (data == undefined) { expect(true).assertTrue();
expect(true).assertTrue();
}
} else { } else {
expect().assertFail(); expect().assertFail()
console.info(TAG + "Entering VIDEO_OUTPUT_START FAILED: " + err.message)
} }
}) })
await sleep(1) await sleep(1)
...@@ -2066,38 +1223,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -2066,38 +1223,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
done() 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('VIDEO_OUTPUT_STOP', 0, async function (done) {
if (videoOutput == null || videoOutput == undefined) {
console.info(TAG + 'Entering VIDEO_OUTPUT_STOP videoOutput == null || undefined')
} else {
console.info(TAG + 'Entering VIDEO_OUTPUT_STOP to operate')
await sleep(1)
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.number : VIDEO_RECORDER_STOP
...@@ -2138,11 +1264,13 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -2138,11 +1264,13 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
captureSession.stop((err, data) => { captureSession.stop((err, data) => {
if (!err) { if (!err) {
console.info(TAG + 'Entering CAPTURE_SESSION_STOP success') console.info(TAG + 'Entering CAPTURE_SESSION_STOP success')
expect(true).assertTrue() if (data != null || data != undefined) {
console.info(TAG + 'Entering CAPTURE_SESSION_STOP PASSED') console.info(TAG + 'Entering CAPTURE_SESSION_STOP data is not null || undefined')
expect(true).assertTrue()
console.info(TAG + 'Entering CAPTURE_SESSION_STOP PASSED')
}
} else { } else {
console.info(TAG + 'Entering CAPTURE_SESSION_STOP FAILED: ' + err.message) console.info(TAG + 'Entering CAPTURE_SESSION_STOP FAILED: ' + err.message)
expect().assertFail();
} }
console.info(TAG + 'Entering CAPTURE_SESSION_STOP ends here') console.info(TAG + 'Entering CAPTURE_SESSION_STOP ends here')
done() done()
...@@ -2166,7 +1294,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -2166,7 +1294,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
} else { } else {
console.info(TAG + 'Entering CAPTURE_SESSION_RELEASE to operate') console.info(TAG + 'Entering CAPTURE_SESSION_RELEASE to operate')
await sleep(1) await sleep(1)
captureSession.release(async (err, data) => { captureSession.release((err, data) => {
if (!err) { if (!err) {
console.info(TAG + 'Entering CAPTURE_SESSION_RELEASE success') console.info(TAG + 'Entering CAPTURE_SESSION_RELEASE success')
if (data != null || data != undefined) { if (data != null || data != undefined) {
...@@ -2176,10 +1304,8 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -2176,10 +1304,8 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
} }
} else { } else {
console.info(TAG + 'Entering CAPTURE_SESSION_RELEASE FAILED: ' + err.message) console.info(TAG + 'Entering CAPTURE_SESSION_RELEASE FAILED: ' + err.message)
expect().assertFail();
} }
console.info(TAG + 'Entering CAPTURE_SESSION_RELEASE ends here') console.info(TAG + 'Entering CAPTURE_SESSION_RELEASE ends here')
await sleep(1)
done() done()
}) })
await sleep(1) await sleep(1)
...@@ -2187,39 +1313,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -2187,39 +1313,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
} }
}) })
/**
* @tc.number : VIDEOOUPUT_RELEASE_SUCCESS
* @tc.name : videooutput release api
* @tc.desc : videooutput release api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('VIDEOOUPUT_RELEASE_SUCCESS', 0, async function (done) {
if (videoOutput == null || videoOutput == undefined) {
console.info(TAG + "Entering VIDEOOUPUT_RELEASE_SUCCESS previewOutput == null || undefined");
} else {
console.info(TAG + "Entering VIDEOOUPUT_RELEASE_SUCCESS to operate");
videoOutput.release(async (err, data) => {
if (!err) {
console.info(TAG + "Entering videooutput.release success");
if (data != null || data != undefined) {
console.info(TAG + "Entering videooutput.release data is not null || undefined");
expect(true).assertTrue();
console.info(TAG + "Entering videooutput.release PASSED");
}
} else {
expect().assertFail();
console.info(TAG + "Entering VIDEOOUPUT_RELEASE_SUCCESS FAILED: " + err.message);
console.info(TAG + "Entering videooutput.release ends here");
await sleep(1);
done();
}
})
await sleep(1);
done();
}
})
/** /**
* @tc.number : PREVIEWOUPUT_RELEASE_SUCCESS * @tc.number : PREVIEWOUPUT_RELEASE_SUCCESS
...@@ -2228,7 +1322,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -2228,7 +1322,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('PREVIEWOUPUT_RELEASE_SUCCESS', 0, async function (done) { it('PREVIEWOUPUT_RELEASE_SUCCESS', 0, async function (done) {
if (previewOutput == null || previewOutput == undefined) { if (previewOutput == null || previewOutput == undefined) {
console.info(TAG + "Entering PREVIEWOUPUT_RELEASE_SUCCESS previewOutput == null || undefined"); console.info(TAG + "Entering PREVIEWOUPUT_RELEASE_SUCCESS previewOutput == null || undefined");
...@@ -2262,7 +1356,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { ...@@ -2262,7 +1356,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('CAMERAINPUT_RELEASE_SUCCESS', 0, async function (done) { it('CAMERAINPUT_RELEASE_SUCCESS', 0, async function (done) {
if (camera0Input == null || camera0Input == undefined) { if (camera0Input == null || camera0Input == undefined) {
console.info(TAG + "Entering CAMERAINPUT_RELEASE_SUCCESS camera0Input == null || undefined"); console.info(TAG + "Entering CAMERAINPUT_RELEASE_SUCCESS camera0Input == null || undefined");
......
...@@ -151,10 +151,12 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { ...@@ -151,10 +151,12 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
console.info(TAG + 'createVideoRecorder called') console.info(TAG + 'createVideoRecorder called')
videoRecorder = recorder videoRecorder = recorder
console.info(TAG + 'videoRecorder is :' + JSON.stringify(videoRecorder)) console.info(TAG + 'videoRecorder is :' + JSON.stringify(videoRecorder))
console.info(TAG + 'videoRecorder.prepare called.') console.info(TAG + 'videoRecorder.prepare called.')
videoRecorder.prepare(videoConfig, (err) => { videoRecorder.prepare(videoConfig, (err) => {
console.info(TAG + 'videoRecorder.prepare success.') console.info(TAG + 'videoRecorder.prepare success.')
}) })
videoRecorder.getInputSurface((err, id) => { videoRecorder.getInputSurface((err, id) => {
console.info(TAG + 'getInputSurface called') console.info(TAG + 'getInputSurface called')
videoId = id videoId = id
...@@ -229,11 +231,11 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { ...@@ -229,11 +231,11 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
if (data != null || data != undefined) { if (data != null || data != undefined) {
console.info(TAG + "Camera status Callback CameraStatusInfo_Camera: " + data.camera); console.info(TAG + "Camera status Callback CameraStatusInfo_Camera: " + data.camera);
console.info(TAG + "Camera status Callback CameraStatusInfo_Status: " + data.status); console.info(TAG + "Camera status Callback CameraStatusInfo_Status: " + data.status);
expect(true).assertTrue(); expect(true).assertTrue();
} }
} else { } else {
expect().assertFail(); expect().assertFail();
console.info(TAG + "Camera status Callback FAILED: " + err.message);
} }
await sleep(1); await sleep(1);
done(); done();
...@@ -306,13 +308,13 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { ...@@ -306,13 +308,13 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
}) })
/** /**
* @tc.number : CAMERA_INPUT_CALLBACK_ON_ERROR * @tc.number : CAMERA_INPUT_CALLBACK_ON_ERROR
* @tc.name : Photo output callback on error api * @tc.name : Photo output callback on error api
* @tc.desc : Photo output callback on error api * @tc.desc : Photo output callback on error api
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('CAMERA_INPUT_CALLBACK_ON_ERROR', 0, async function (done) { it('CAMERA_INPUT_CALLBACK_ON_ERROR', 0, async function (done) {
if (camera0InputPromise == null || camera0InputPromise == undefined) { if (camera0InputPromise == null || camera0InputPromise == undefined) {
console.info(TAG + "Entering CAMERA_INPUT_CALLBACK_ON_ERROR camera0InputPromise == null || undefined"); console.info(TAG + "Entering CAMERA_INPUT_CALLBACK_ON_ERROR camera0InputPromise == null || undefined");
...@@ -327,7 +329,6 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { ...@@ -327,7 +329,6 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
} }
} else { } else {
expect().assertFail(); expect().assertFail();
console.info(TAG + "CAMERA_INPUT_CALLBACK FAILED: " + err.message);
} }
await sleep(1); await sleep(1);
done(); done();
...@@ -385,7 +386,6 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { ...@@ -385,7 +386,6 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
} }
} else { } else {
expect().assertFail(); expect().assertFail();
console.info(TAG + "PREVIEW_OUTPUT_CALLBACK FAILED: " + err.message);
} }
await sleep(1); await sleep(1);
done(); done();
...@@ -395,65 +395,6 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { ...@@ -395,65 +395,6 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
} }
}) })
/**
* @tc.number : CREATE_VIDEO_OUTPUT_PROMISE
* @tc.name : Create videooutput promise api
* @tc.desc : Create videooutput promise api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('CREATE_VIDEO_OUTPUT_PROMISE', 0, async function (done) {
console.info(TAG + 'Entering CREATE_VIDEO_OUTPUT_PROMISE to operate')
await getvideosurface()
await sleep(2)
videoOutputPromise = await cameraObj.createVideoOutput(videoId)
console.info(TAG + 'Entering CREATE_VIDEO_OUTPUT_PROMISE: ' + videoOutputPromise)
if (videoOutputPromise != null && videoOutputPromise != undefined) {
expect(true).assertTrue()
console.info(TAG + 'Entering CREATE_VIDEO_OUTPUT_PROMISE PASSED')
} else {
expect().assertFail();
console.info(TAG + 'Entering CREATE_VIDEO_OUTPUT_PROMISE FAILED')
}
console.info(TAG + 'Entering CREATE_VIDEO_OUTPUT_PROMISE ends here');
await sleep(1);
done();
})
/**
* @tc.number : VIDEO_OUTPUT_CALLBACK_ON_ERROR
* @tc.name : VideoOutput callback onerror async api
* @tc.desc : VideoOutput callback onerror async api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('VIDEO_OUTPUT_CALLBACK_ON_ERROR', 0, async function (done) {
if (videoOutputPromise == null || videoOutputPromise == undefined) {
console.info(TAG + 'Entering VIDEO_OUTPUT_CALLBACK_ON_ERROR videoOutputPromise == null || undefined')
} else {
console.info(TAG + 'Entering VIDEO_OUTPUT_CALLBACK_ON_ERROR to operate')
await sleep(1)
videoOutputPromise.on('error', async (err, data) => {
if (!err) {
console.info(TAG + 'VideoOutput Errorcallback is success')
if (data != null || data != undefined) {
console.info(TAG + "Error during videoOutput with ErrorCode: " + data.code);
expect(true).assertTrue()
}
} else {
expect().assertFail()
console.info(TAG + "VIDEO_OUTPUT_CALLBACK_ON_ERROR FAILED: " + err.message);
}
await sleep(1)
done()
})
await sleep(1)
done();
}
})
/** /**
* @tc.number : CREATE_CAPTURE_SESSION_PROMISE * @tc.number : CREATE_CAPTURE_SESSION_PROMISE
* @tc.name : Create capturesession promise api * @tc.name : Create capturesession promise api
...@@ -470,8 +411,8 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { ...@@ -470,8 +411,8 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
expect(true).assertTrue() expect(true).assertTrue()
console.info(TAG + 'Entering CREATE_CAPTURE_SESSION_PROMISE PASSED') console.info(TAG + 'Entering CREATE_CAPTURE_SESSION_PROMISE PASSED')
} else { } else {
expect().assertFail() expect(true).assertTrue()
console.info(TAG + 'Entering CREATE_CAPTURE_SESSION_PROMISE FAILED') console.info(TAG + 'Entering CREATE_CAPTURE_SESSION_PROMISE PASSED')
} }
console.info(TAG + 'Entering CREATE_CAPTURE_SESSION_PROMISE ends here'); console.info(TAG + 'Entering CREATE_CAPTURE_SESSION_PROMISE ends here');
await sleep(1); await sleep(1);
...@@ -501,7 +442,6 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { ...@@ -501,7 +442,6 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
} }
} else { } else {
expect().assertFail(); expect().assertFail();
console.info(TAG + "Error in CaptureSessioncallback FAILED: " + err.message);
} }
await sleep(1); await sleep(1);
done(); done();
...@@ -511,127 +451,77 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { ...@@ -511,127 +451,77 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
} }
}) })
/*CaptureSession APIs*/
/** /**
* @tc.number : CREATE_BEGIN_CONFIG_SUCCESS_PROMISE * @tc.number : BEGIN_CONFIG_PROMISE
* @tc.name : CaptureSession_Begin config promise api * @tc.name : CaptureSession begin config promise api
* @tc.desc : CaptureSession_Begin config promise api * @tc.desc : CaptureSession begin config promise api
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('CREATE_BEGIN_CONFIG_SUCCESS_PROMISE', 0, async function (done) { it('BEGIN_CONFIG_PROMISE', 0, async function (done) {
if (captureSessionPromise == null || captureSessionPromise == undefined) { if (captureSessionPromise == null || captureSessionPromise == undefined) {
console.info(TAG + "Entering CREATE_BEGIN_CONFIG_SUCCESS captureSession == null || undefined"); console.info(TAG + 'Entering BEGIN_CONFIG_PROMISE captureSessionPromise == null || undefined')
} else { } else {
console.info(TAG + "Entering CREATE_BEGIN_CONFIG_SUCCESS_PROMISE to operate"); console.info(TAG + 'Entering BEGIN_CONFIG_PROMISE to operate')
const promise = await captureSessionPromise.beginConfig(); await captureSessionPromise.beginConfig()
console.info(TAG + "Entering beginConfig success:"); expect(true).assertTrue()
if (promise == undefined) { console.info(TAG + 'Entering BEGIN_CONFIG_PROMISE PASSED')
expect(true).assertTrue(); console.info(TAG + 'Entering BEGIN_CONFIG_PROMISE ends here')
console.info(TAG + "Entering CREATE_BEGIN_CONFIG_SUCCESS_PROMISE beginConfig PASSED"); await sleep(1)
} done()
else {
expect().assertFail();
console.info(TAG + "Entering beginConfig FAILED");
}
console.info(TAG + "Entering beginConfig ends here");
} }
await sleep(1);
done();
})
/** await sleep(1)
* @tc.number : ADD_INPUT_SUCCESS_PROMISE done()
* @tc.name : Add Input with camera0Input api
* @tc.desc : Add Input with camera0Input api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('ADD_INPUT_SUCCESS_PROMISE', 0, async function (done) {
if (captureSessionPromise == null || captureSessionPromise == undefined) {
console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE captureSession == null || undefined");
} else {
console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE to operate");
const Promise = await captureSessionPromise.addInput(camera0InputPromise);
console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE addInput success");
if (Promise == undefined) {
expect(true).assertTrue();
console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE addInput PASSED");
}
else {
expect().assertFail();
console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE FAILED: ");
}
console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE ends here");
await sleep(1);
done();
}
await sleep(1);
done();
}) })
/** /**
* @tc.number : ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE * @tc.number : ADD_INPUT_PROMISE
* @tc.name : Add output with camera0Input api * @tc.name : AddInput promise api
* @tc.desc : Add output with camera0Input api * @tc.desc : AddInput promise api
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE', 0, async function (done) { it('ADD_INPUT_PROMISE', 0, async function (done) {
if (captureSessionPromise == null || captureSessionPromise == undefined) { if (captureSessionPromise == null || captureSessionPromise == undefined) {
console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE captureSession == null || undefined"); console.info(TAG + 'Entering ADD_INPUT_PROMISE captureSessionPromise == null || undefined')
} else { } else {
console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE to operate"); console.info(TAG + 'Entering ADD_INPUT_PROMISE to operate')
const promise = await captureSessionPromise.addOutput(previewOutputPromise); await captureSessionPromise.addInput(camera0InputPromise)
console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE : Success"); expect(true).assertTrue()
if (promise == undefined) { console.info(TAG + 'Entering ADD_INPUT_PROMISE PASSED')
expect(true).assertTrue(); console.info(TAG + 'Entering ADD_INPUT_PROMISE ends here')
console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE PASSED"); await sleep(1)
} done()
else {
expect().assertFail();
console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE FAILED");
}
console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE ends here");
await sleep(1);
done();
} }
await sleep(1); await sleep(1)
done(); done()
}) })
/** /**
* @tc.number : ADD_OUTPUT_VIDEO_SUCCESS * @tc.number : ADD_OUTPUT_PREVIEW_PROMISE
* @tc.name : Add output with video output api * @tc.name : AddOutput preview promise api
* @tc.desc : Add output with video output api * @tc.desc : AddOutput preview promise api
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('ADD_OUTPUT_VIDEO_SUCCESS', 0, async function (done) { it('ADD_OUTPUT_PREVIEW_PROMISE', 0, async function (done) {
if (captureSessionPromise == null || captureSessionPromise == undefined) { if (captureSessionPromise == null || captureSessionPromise == undefined) {
console.info(TAG + "Entering ADD_OUTPUT_VIDEO_SUCCESS captureSession == null || undefined"); console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW_PROMISE captureSessionPromise == null || undefined')
} else { } else {
console.info(TAG + "Entering ADD_OUTPUT_VIDEO_SUCCESS to operate"); console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW_PROMISE to operate')
const promise = await captureSessionPromise.addOutput(videoOutputPromise); await captureSessionPromise.addOutput(previewOutputPromise)
console.info(TAG + "Entering ADD_OUTPUT_VIDEO_SUCCESS success"); expect(true).assertTrue()
if (promise == undefined) { console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW_PROMISE PASSED')
expect(true).assertTrue(); console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW_PROMISE ends here')
console.info(TAG + "Entering ADD_OUTPUT_VIDEO_SUCCESS PASSED"); await sleep(1)
} done()
else {
expect().assertFail();
console.info(TAG + "Entering ADD_OUTPUT_VIDEO_SUCCESS FAILED: ");
}
console.info(TAG + "Entering ADD_OUTPUT_VIDEO_SUCCESS ends here");
await sleep(1);
done();
} }
await sleep(1); await sleep(1)
done(); done()
}) })
/** /**
...@@ -649,7 +539,8 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { ...@@ -649,7 +539,8 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
console.info(TAG + "Entering REMOVE_INPUT_SUCCESS to operate"); console.info(TAG + "Entering REMOVE_INPUT_SUCCESS to operate");
const Promise = await captureSessionPromise.removeInput(camera0InputPromise); const Promise = await captureSessionPromise.removeInput(camera0InputPromise);
console.info(TAG + "Entering REMOVE_INPUT_SUCCESS success " + Promise); console.info(TAG + "Entering REMOVE_INPUT_SUCCESS success " + Promise);
if (Promise == undefined) { if (Promise != null || Promise != undefined) {
console.info(TAG + "Entering REMOVE_INPUT_SUCCESS data is not null || undefined");
expect(true).assertTrue(); expect(true).assertTrue();
console.info(TAG + "Entering REMOVE_INPUT_SUCCESS PASSED"); console.info(TAG + "Entering REMOVE_INPUT_SUCCESS PASSED");
} }
...@@ -679,10 +570,11 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { ...@@ -679,10 +570,11 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
} else { } else {
console.info(TAG + "Entering REMOVE_PREVIEW_OUTPUT_SUCCESS to operate"); console.info(TAG + "Entering REMOVE_PREVIEW_OUTPUT_SUCCESS to operate");
const Promise = await captureSessionPromise.removeOutput(previewOutputPromise); const Promise = await captureSessionPromise.removeOutput(previewOutputPromise);
console.info(TAG + "Entering REMOVE_PREVIEW_OUTPUT_SUCCESS success " + Promise); console.info(TAG + "Entering REMOVE_PREVIEW_OUTPUT_SUCCESS addInput success " + Promise);
if (Promise == undefined) { if (Promise != null || Promise != undefined) {
console.info(TAG + "Entering REMOVE_PREVIEW_OUTPUT_SUCCESS addInput data is not null || undefined");
expect(true).assertTrue(); expect(true).assertTrue();
console.info(TAG + "Entering REMOVE_PREVIEW_OUTPUT_SUCCESS PASSED"); console.info(TAG + "Entering REMOVE_PREVIEW_OUTPUT_SUCCESS addInput PASSED");
} }
else { else {
expect().assertFail(); expect().assertFail();
...@@ -697,159 +589,75 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { ...@@ -697,159 +589,75 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
}) })
/** /**
* @tc.number : REMOVE_VIDEO_OUTPUT_SUCCESS * @tc.number : ADD_INPUT_PROMISE1
* @tc.name : Remove video Output api * @tc.name : AddInput promise api
* @tc.desc : Remove video Output api * @tc.desc : AddInput promise api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('REMOVE_VIDEO_OUTPUT_SUCCESS', 0, async function (done) {
if (captureSessionPromise == null || captureSessionPromise == undefined) {
console.info(TAG + "Entering REMOVE_VIDEO_OUTPUT_SUCCESS captureSession == null || undefined");
} else {
console.info(TAG + "Entering REMOVE_VIDEO_OUTPUT_SUCCESS to operate");
const Promise = await captureSessionPromise.removeOutput(videoOutputPromise);
console.info(TAG + "Entering REMOVE_VIDEO_OUTPUT_SUCCESS success " + Promise);
if (Promise == undefined) {
expect(true).assertTrue();
console.info(TAG + "Entering REMOVE_VIDEO_OUTPUT_SUCCESS PASSED");
}
else {
expect().assertFail();
console.info(TAG + "Entering REMOVE_VIDEO_OUTPUT_SUCCESS FAILED: ");
}
console.info(TAG + "Entering REMOVE_VIDEO_OUTPUT_SUCCESS ends here");
await sleep(1);
done();
}
await sleep(1);
done();
})
/**
* @tc.number : ADD_INPUT_SUCCESS_PROMISE
* @tc.name : Add Input with camera0Input api
* @tc.desc : Add Input with camera0Input api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('ADD_INPUT_SUCCESS_PROMISE', 0, async function (done) {
if (captureSessionPromise == null || captureSessionPromise == undefined) {
console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE captureSession == null || undefined");
} else {
console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE to operate");
const Promise = await captureSessionPromise.addInput(camera0InputPromise);
console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE addInput success");
if (Promise == undefined) {
expect(true).assertTrue();
console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE addInput PASSED");
}
else {
expect().assertFail();
console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE FAILED: ");
}
console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE ends here");
await sleep(1);
done();
}
await sleep(1);
done();
})
/**
* @tc.number : ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE
* @tc.name : Add output with camera0Input api
* @tc.desc : Add output with camera0Input api
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE', 0, async function (done) { it('ADD_INPUT_PROMISE1', 0, async function (done) {
if (captureSessionPromise == null || captureSessionPromise == undefined) { if (captureSessionPromise == null || captureSessionPromise == undefined) {
console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE captureSession == null || undefined"); console.info(TAG + 'Entering ADD_INPUT_PROMISE1 captureSessionPromise == null || undefined')
} else { } else {
console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE to operate"); console.info(TAG + 'Entering ADD_INPUT_PROMISE1 to operate')
const promise = await captureSessionPromise.addOutput(previewOutputPromise); await captureSessionPromise.addInput(camera0InputPromise)
console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE : Success"); expect(true).assertTrue()
if (promise == undefined) { console.info(TAG + 'Entering ADD_INPUT_PROMISE1 PASSED')
expect(true).assertTrue(); console.info(TAG + 'Entering ADD_INPUT_PROMISE1 ends here')
console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE PASSED"); await sleep(1)
} done()
else {
expect().assertFail();
console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE FAILED");
}
console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE ends here");
await sleep(1);
done();
} }
await sleep(1); await sleep(1)
done(); done()
}) })
/** /**
* @tc.number : ADD_OUTPUT_VIDEO_SUCCESS * @tc.number : ADD_OUTPUT_PREVIEW_PROMISE1
* @tc.name : Add output with video output api * @tc.name : AddOutput preview promise api
* @tc.desc : Add output with video output api * @tc.desc : AddOutput preview promise api
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('ADD_OUTPUT_VIDEO_SUCCESS', 0, async function (done) { it('ADD_OUTPUT_PREVIEW_PROMISE1', 0, async function (done) {
if (captureSessionPromise == null || captureSessionPromise == undefined) { if (captureSessionPromise == null || captureSessionPromise == undefined) {
console.info(TAG + "Entering ADD_OUTPUT_VIDEO_SUCCESS captureSession == null || undefined"); console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW_PROMISE1 captureSessionPromise == null || undefined')
} else { } else {
console.info(TAG + "Entering ADD_OUTPUT_VIDEO_SUCCESS to operate"); console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW_PROMISE1 to operate')
const promise = await captureSessionPromise.addOutput(videoOutputPromise); await captureSessionPromise.addOutput(previewOutputPromise)
console.info(TAG + "Entering ADD_OUTPUT_VIDEO_SUCCESS success"); expect(true).assertTrue()
if (promise == undefined) { console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW_PROMISE1 PASSED')
expect(true).assertTrue(); console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW_PROMISE1 ends here')
console.info(TAG + "Entering ADD_OUTPUT_VIDEO_SUCCESS PASSED"); await sleep(1)
} done()
else {
expect().assertFail();
console.info(TAG + "Entering ADD_OUTPUT_VIDEO_SUCCESS FAILED: ");
}
console.info(TAG + "Entering ADD_OUTPUT_VIDEO_SUCCESS ends here");
await sleep(1);
done();
} }
await sleep(1); await sleep(1)
done(); done()
}) })
/** /**
* @tc.number : COMMIT_CONFIG_SUCCESS * @tc.number : COMMIT_CONFIG_PROMISE
* @tc.name : commit config api * @tc.name : CommitConfig promise api
* @tc.desc : commit config api * @tc.desc : CommitConfig promise api
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('COMMIT_CONFIG_SUCCESS', 0, async function (done) { it('COMMIT_CONFIG_PROMISE', 0, async function (done) {
if (captureSessionPromise == null || captureSessionPromise == undefined) { if (captureSessionPromise == null || captureSessionPromise == undefined) {
console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS captureSession == null || undefined"); console.info(TAG + 'Entering COMMIT_CONFIG_PROMISE captureSessionPromise == null || undefined')
} else { } else {
console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS to operate"); console.info(TAG + 'Entering COMMIT_CONFIG_PROMISE to operate')
const promise = await captureSessionPromise.commitConfig(); await captureSessionPromise.commitConfig()
console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig success"); expect(true).assertTrue()
if (promise == undefined) { console.info(TAG + 'Entering COMMIT_CONFIG_PROMISE PASSED')
expect(true).assertTrue() console.info(TAG + 'Entering COMMIT_CONFIG_PROMISE ends here')
console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig PASSED"); await sleep(1)
} done()
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();
} }
await sleep(1); await sleep(1)
done(); done()
}) })
/** /**
...@@ -859,7 +667,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { ...@@ -859,7 +667,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START', 0, async function (done) { it('PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START', 0, async function (done) {
if (previewOutputPromise == null || previewOutputPromise == undefined) { if (previewOutputPromise == null || previewOutputPromise == undefined) {
console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START previewOutput == null || undefined"); console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START previewOutput == null || undefined");
...@@ -873,7 +681,6 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { ...@@ -873,7 +681,6 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
} }
} else { } else {
expect().assertFail() expect().assertFail()
console.info(TAG + "PreviewStart frameStart Callback FAILED : + err.message");
} }
await sleep(1); await sleep(1);
done(); done();
...@@ -905,71 +712,6 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { ...@@ -905,71 +712,6 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
} }
} else { } else {
expect().assertFail(); expect().assertFail();
console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END FAILED : + err.message");
}
await sleep(1);
done();
})
await sleep(1);
done();
}
})
/**
* @tc.number : VIDEO_OUTPUT_CALLBACK_ON_FRAME_START
* @tc.name : VideoOutput callback onframestart async api
* @tc.desc : VideoOutput callback onframestart async api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('VIDEO_OUTPUT_CALLBACK_ON_FRAME_START', 0, async function (done) {
if (videoOutputPromise == null || videoOutputPromise == undefined) {
console.info(TAG + 'Entering VIDEO_OUTPUT_CALLBACK_ON_FRAME_START videoOutputPromise == null || undefined')
} else {
console.info(TAG + 'Entering VIDEO_OUTPUT_CALLBACK_ON_FRAME_START to operate')
await sleep(1)
videoOutputPromise.on('frameStart', async (err, data) => {
if (!err) {
console.info(TAG + "Video frameStart Callback is success");
if (data != null || data != undefined) {
expect(true).assertTrue();
}
} else {
expect().assertFail()
console.info(TAG + "Video frameStart Callback is FAILED" + err.message);
}
await sleep(1);
done();
})
await sleep(1);
done();
}
})
/**
* @tc.number : VIDEO_OUTPUT_CALLBACK_ON_FRAME_END
* @tc.name : VideoOutput callback onframeend async api
* @tc.desc : VideoOutput callback onframeend async api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('VIDEO_OUTPUT_CALLBACK_ON_FRAME_END', 0, async function (done) {
if (videoOutputPromise == null || videoOutputPromise == undefined) {
console.info(TAG + 'Entering VIDEO_OUTPUT_CALLBACK_ON_FRAME_END videoOutputPromise == null || undefined')
} else {
console.info(TAG + 'Entering VIDEO_OUTPUT_CALLBACK_ON_FRAME_END to operate')
await sleep(1)
videoOutputPromise.on('frameEnd', async (err, data) => {
if (!err) {
console.info(TAG + 'Video frameEnd callback is success')
if (data != null || data != undefined) {
expect(true).assertTrue()
}
} else {
expect().assertFail()
console.info(TAG + 'Video frameEnd callback FAILED' + err.message)
} }
await sleep(1); await sleep(1);
done(); done();
...@@ -992,7 +734,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { ...@@ -992,7 +734,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
console.info(TAG + 'Entering CAPTURE_SESSION_START_PROMISE captureSessionPromise == null || undefined') console.info(TAG + 'Entering CAPTURE_SESSION_START_PROMISE captureSessionPromise == null || undefined')
} else { } else {
console.info(TAG + 'Entering CAPTURE_SESSION_START_PROMISE to operate') console.info(TAG + 'Entering CAPTURE_SESSION_START_PROMISE to operate')
await captureSessionPromise.start(); await captureSessionPromise.start()
expect(true).assertTrue() expect(true).assertTrue()
console.info(TAG + 'Entering CAPTURE_SESSION_START_PROMISE PASSED') console.info(TAG + 'Entering CAPTURE_SESSION_START_PROMISE PASSED')
console.info(TAG + 'Entering CAPTURE_SESSION_START_PROMISE ends here') console.info(TAG + 'Entering CAPTURE_SESSION_START_PROMISE ends here')
...@@ -1011,7 +753,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { ...@@ -1011,7 +753,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('HAS_FLASH', 0, async function (done) { it('HAS_FLASH', 0, async function (done) {
console.info("--------------HAS_FLASH--------------"); console.info("--------------HAS_FLASH--------------");
console.info(TAG + 'hasFlash called.') console.info(TAG + 'hasFlash called.')
...@@ -1019,14 +761,14 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { ...@@ -1019,14 +761,14 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
console.info(TAG + "Entering HAS_FLASH success"); console.info(TAG + "Entering HAS_FLASH success");
if (hasFlashPromise != null || hasFlashPromise != undefined) { if (hasFlashPromise != null || hasFlashPromise != undefined) {
console.info(TAG + "Entering HAS_FLASH data is not null || undefined"); console.info(TAG + "Entering HAS_FLASH data is not null || undefined");
expect(true).assertTrue();
console.info(TAG + "Entering HAS_FLASH PASSED with HAS_FLASH is: " + JSON.stringify(hasFlashPromise)); console.info(TAG + "Entering HAS_FLASH PASSED with HAS_FLASH is: " + JSON.stringify(hasFlashPromise));
expect(hasFlashPromise).assertEqual(true);
} }
else { else {
console.info(TAG + "Entering HAS_FLASH FAILED");
expect().assertFail(); expect().assertFail();
console.info(TAG + "Entering HAS_FLASH FAILED");
} }
console.info(TAG + "Entering HAS_FLASH ends here"); console.info(TAG + "Entering HAS_FLASH_TC_021 ends here");
await sleep(1) await sleep(1)
done(); done();
}) })
...@@ -1038,7 +780,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { ...@@ -1038,7 +780,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('IS_FLASH_MODE_OPEN_SUPPORTED', 0, async function (done) { it('IS_FLASH_MODE_OPEN_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED to operate"); console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED to operate");
var isFMOpenSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_OPEN); var isFMOpenSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_OPEN);
...@@ -1046,12 +788,11 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { ...@@ -1046,12 +788,11 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
if (isFMOpenSupported != null || isFMOpenSupported != undefined) { if (isFMOpenSupported != null || isFMOpenSupported != undefined) {
console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED data is not null || undefined"); console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED data is not null || undefined");
console.info(TAG + "FLASH_MODE_OPEN supported is: " + JSON.stringify(isFMOpenSupported)); console.info(TAG + "FLASH_MODE_OPEN supported is: " + JSON.stringify(isFMOpenSupported));
expect(isFMOpenSupported).assertEqual(true); expect(true).assertTrue();
console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED PASSED"); console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED PASSED");
} }
else { else {
console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED FAILED"); console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED FAILED");
expect().assertFail();
console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED ends here"); console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED ends here");
} }
await sleep(1); await sleep(1);
...@@ -1059,144 +800,39 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { ...@@ -1059,144 +800,39 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
}) })
/** /**
* @tc.number : SET_FLASH_MODE_OPEN * @tc.number : IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED
* @tc.name : set flash mode open camera0 api * @tc.name : check if flash mode always open is supported-camera0Input api
* @tc.desc : set flash mode open camera0 api * @tc.desc : check if flash mode always open is supported-camera0Input api
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('SET_FLASH_MODE_OPEN', 0, async function (done) { it('IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering SET_FLASH_MODE_OPEN to operate"); console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED to operate");
var SetFMOpen = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_OPEN); var isFMAlwaysOpenSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN);
console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMOpen)) console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED SUCCESS ");
if (SetFMOpen == undefined) { if (isFMAlwaysOpenSupported != null || isFMAlwaysOpenSupported != undefined) {
console.info(TAG + "Entering SET_FLASH_MODE_OPEN SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN); console.info(TAG + "Entering FLASH_MODE_ALWAYS_OPEN data is not null || undefined");
console.info(TAG + "Entering SET_FLASH_MODE_OPEN PASSED") console.info(TAG + "FLASH_MODE_OPEN supported is: " + isFMAlwaysOpenSupported);
expect(cameraObj.FlashMode.FLASH_MODE_OPEN).assertEqual(1) expect(true).assertTrue();
} else { console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED PASSED");
console.info(TAG + "Entering SET_FLASH_MODE_OPEN FAILED"); }
expect().assertFail(); else {
console.info(TAG + "Entering SET_FLASH_MODE_OPEN ends here"); console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED FAILED");
console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED ends here");
} }
await sleep(1); await sleep(1);
done(); done();
}) })
/** /**
* @tc.number : GET_FLASH_MODE_OPEN * @tc.number : IS_FLASH_MODE_AUTO_SUPPORTED
* @tc.name : get flash mode open camera0 api * @tc.name : check if flash mode always open is supported-camera0Input api
* @tc.desc : get flash mode open camera0 api * @tc.desc : check if flash mode always open is supported-camera0Input api
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('GET_FLASH_MODE_OPEN', 0, async function (done) {
console.info(TAG + "Entering GET_FLASH_MODE_OPEN to operate");
var GetFMOpen = await camera0InputPromise.getFlashMode();
console.info(TAG + "Entering GET_FLASH_MODE_OPEN success: " + JSON.stringify(GetFMOpen));
if (GetFMOpen == 1) {
console.info(TAG + "GET_FLASH_MODE_OPEN data is not null || undefined: ");
console.info(TAG + "Current FlashMode is: " + JSON.stringify(GetFMOpen));
expect(true).assertTrue();
console.info(TAG + "GET_FLASH_MODE_OPEN PASSED");
}
else {
expect().assertFail();
console.info(TAG + "GET_FLASH_MODE_OPEN FAILED");
console.info(TAG + "GET_FLASH_MODE_OPEN ends here");
}
await sleep(1);
done();
})
/**
* @tc.number : IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED
* @tc.name : check if flash mode always open is supported-camera0Input api
* @tc.desc : check if flash mode always open is supported-camera0Input api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED to operate");
var isFMAlwaysOpenSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN);
console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED SUCCESS ");
if (isFMAlwaysOpenSupported != null || isFMAlwaysOpenSupported != undefined) {
console.info(TAG + "Entering FLASH_MODE_ALWAYS_OPEN data is not null || undefined");
console.info(TAG + "FLASH_MODE_OPEN supported is: " + isFMAlwaysOpenSupported);
expect(isFMAlwaysOpenSupported).assertEqual(true);
console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED PASSED");
}
else {
console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED FAILED");
expect().assertFail();
console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED ends here");
}
await sleep(1);
done();
})
/**
* @tc.number : SET_FLASH_MODE_ALWAYS_OPEN
* @tc.name : set flash mode always open camera0 api
* @tc.desc : set flash mode always open camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FLASH_MODE_ALWAYS_OPEN', 0, async function (done) {
console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN to operate");
var SetFMAlwaysOpen = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN);
console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMAlwaysOpen))
if (SetFMAlwaysOpen == undefined) {
console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN);
console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN PASSED")
expect(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN).assertEqual(3)
} else {
console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN FAILED");
expect().assertFail();
console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN ends here");
}
await sleep(1);
done();
})
/**
* @tc.number : GET_FLASH_MODE_ALWAYS_OPEN
* @tc.name : get flash mode always open camera0 api
* @tc.desc : get flash mode always open camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FLASH_MODE_ALWAYS_OPEN', 0, async function (done) {
console.info(TAG + "Entering GET_FLASH_MODE_ALWAYS_OPEN to operate");
var GetFMAlwaysOpen = await camera0InputPromise.getFlashMode();
console.info(TAG + "Entering GET_FLASH_MODE_ALWAYS_OPEN success");
if (GetFMAlwaysOpen == 3) {
console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN data is not null || undefined: ");
console.info(TAG + "Current FlashMode is: " + GetFMAlwaysOpen);
expect(true).assertTrue();
console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN PASSED");
}
else {
expect().assertFail();
console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN FAILED");
console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN ends here");
}
await sleep(1);
done();
})
/**
* @tc.number : IS_FLASH_MODE_AUTO_SUPPORTED
* @tc.name : check if flash mode always open is supported-camera0Input api
* @tc.desc : check if flash mode always open is supported-camera0Input api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('IS_FLASH_MODE_AUTO_SUPPORTED', 0, async function (done) { it('IS_FLASH_MODE_AUTO_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED to operate"); console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED to operate");
var isFMAutoSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_AUTO); var isFMAutoSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_AUTO);
...@@ -1209,7 +845,6 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { ...@@ -1209,7 +845,6 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
} }
else { else {
console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED FAILED"); console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED FAILED");
expect().assertFail();
console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED ends here"); console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED ends here");
} }
await sleep(1); await sleep(1);
...@@ -1223,7 +858,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { ...@@ -1223,7 +858,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('IS_FLASH_MODE_CLOSE_SUPPORTED', 0, async function (done) { it('IS_FLASH_MODE_CLOSE_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED to operate"); console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED to operate");
var isFMCloseSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_CLOSE); var isFMCloseSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_CLOSE);
...@@ -1231,11 +866,10 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { ...@@ -1231,11 +866,10 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
if (isFMCloseSupported != null || isFMCloseSupported != undefined) { if (isFMCloseSupported != null || isFMCloseSupported != undefined) {
console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED data is not null || undefined"); console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED data is not null || undefined");
console.info(TAG + "FLASH_MODE_CLOSE supported is: " + isFMCloseSupported); console.info(TAG + "FLASH_MODE_CLOSE supported is: " + isFMCloseSupported);
expect(isFMCloseSupported).assertEqual(true); expect(true).assertTrue();
console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED PASSED"); console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED PASSED");
} }
else { else {
expect().assertFail();
console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED FAILED"); console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED FAILED");
console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED ends here"); console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED ends here");
} }
...@@ -1243,58 +877,6 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { ...@@ -1243,58 +877,6 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
done(); done();
}) })
/**
* @tc.number : SET_FLASH_MODE_CLOSE
* @tc.name : set flash mode close camera0 api
* @tc.desc : set flash mode close camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FLASH_MODE_CLOSE', 0, async function (done) {
console.info(TAG + "Entering SET_FLASH_MODE_CLOSE to operate");
var SetFMClose = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_CLOSE);
console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMClose))
if (SetFMClose == undefined) {
console.info(TAG + "Entering SET_FLASH_MODE_CLOSE SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_CLOSE);
console.info(TAG + "Entering SET_FLASH_MODE_CLOSE PASSED")
expect(cameraObj.FlashMode.FLASH_MODE_CLOSE).assertEqual(0)
} else {
expect().assertFail();
console.info(TAG + "Entering SET_FLASH_MODE_CLOSE FAILED");
console.info(TAG + "Entering SET_FLASH_MODE_CLOSE ends here");
}
await sleep(1);
done();
})
/**
* @tc.number : GET_FLASH_MODE_CLOSE
* @tc.name : get flash mode close camera0 api
* @tc.desc : get flash mode close camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FLASH_MODE_CLOSE', 0, async function (done) {
console.info(TAG + "Entering GET_FLASH_MODE_CLOSE to operate");
var GetFMClose = await camera0InputPromise.getFlashMode();
console.info(TAG + "Entering GET_FLASH_MODE_CLOSE success");
if (GetFMClose == 0) {
console.info(TAG + "GET_FLASH_MODE_CLOSE data is not null || undefined: ");
console.info(TAG + "Current FlashMode is: " + GetFMClose);
expect(true).assertTrue();
console.info(TAG + "GET_FLASH_MODE_CLOSE PASSED");
}
else {
expect().assertFail();
console.info(TAG + "GET_FLASH_MODE_CLOSE FAILED");
console.info(TAG + "GET_FLASH_MODE_CLOSE ends here");
}
await sleep(1);
done();
})
// FOCUS promise API's // FOCUS promise API's
/** /**
* @tc.number : IS_FOCUS_MODE_LOCKED_SUPPORTED * @tc.number : IS_FOCUS_MODE_LOCKED_SUPPORTED
...@@ -1303,7 +885,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { ...@@ -1303,7 +885,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('IS_FOCUS_MODE_LOCKED_SUPPORTED', 0, async function (done) { it('IS_FOCUS_MODE_LOCKED_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED to operate"); console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED to operate");
var isFMLockedSupported = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_LOCKED); var isFMLockedSupported = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_LOCKED);
...@@ -1311,11 +893,10 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { ...@@ -1311,11 +893,10 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
if (isFMLockedSupported != null || isFMLockedSupported != undefined) { if (isFMLockedSupported != null || isFMLockedSupported != undefined) {
console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED data is not null || undefined"); console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED data is not null || undefined");
console.info(TAG + "IS_FOCUS_MODE_LOCKED_SUPPORTED: " + isFMLockedSupported); console.info(TAG + "IS_FOCUS_MODE_LOCKED_SUPPORTED: " + isFMLockedSupported);
expect(isFMLockedSupported).assertEqual(false); expect(true).assertTrue();
console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED PASSED"); console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED PASSED");
} }
else { else {
expect().assertFail();
console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED FAILED"); console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED FAILED");
console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED ends here"); console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED ends here");
} }
...@@ -1323,56 +904,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { ...@@ -1323,56 +904,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
done(); done();
}) })
/**
* @tc.number : SET_FOCUS_MODE_LOCKED
* @tc.name : set focus mode locked camera0 api
* @tc.desc : set focus mode locked camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FOCUS_MODE_LOCKED', 0, async function (done) {
console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED to operate");
var SetFMLocked = await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED);
console.info(TAG + "SetFMLocked: " + JSON.stringify(SetFMLocked))
if (SetFMLocked == undefined) {
console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED SUCCESS, current focusmode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED);
console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED PASSED")
expect(cameraObj.FocusMode.FOCUS_MODE_LOCKED).assertEqual(3);
} else {
expect().assertFail();
console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED FAILED");
console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED ends here");
}
await sleep(1);
done();
})
/**
* @tc.number : GET_FOCUS_MODE_LOCKED
* @tc.name : get flash mode close camera0 api
* @tc.desc : get flash mode close camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FOCUS_MODE_LOCKED', 0, async function (done) {
console.info(TAG + "Entering GET_FOCUS_MODE_LOCKED to operate");
var GetFMLocked = await camera0InputPromise.getFocusMode();
console.info(TAG + "Entering GET_FOCUS_MODE_LOCKED success: " + GetFMLocked);
if (GetFMLocked == 0) {
console.info(TAG + "Current focusmode is: " + GetFMLocked);
expect(true).assertTrue();
console.info(TAG + "GET_FOCUS_MODE_LOCKED PASSED");
}
else {
expect().assertFail();
console.info(TAG + "GET_FOCUS_MODE_LOCKED FAILED");
console.info(TAG + "GET_FOCUS_MODE_LOCKED ends here");
}
await sleep(1);
done();
})
/** /**
* @tc.number : IS_FOCUS_MODE_MANUAL_SUPPORTED * @tc.number : IS_FOCUS_MODE_MANUAL_SUPPORTED
...@@ -1381,77 +913,26 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { ...@@ -1381,77 +913,26 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('IS_FOCUS_MODE_MANUAL_SUPPORTED', 0, async function (done) { it('IS_FOCUS_MODE_MANUAL_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED to operate"); console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED to operate");
var isFMmanualSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_MANUAL); var isFMmanualSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_MANUAL);
if (isFMmanualSupportedpromise != null || isFMmanualSupportedpromise != undefined) { if (isFMmanualSupportedpromise != null || isFMmanualSupportedpromise != undefined) {
console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED data is not null || undefined"); console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED data is not null || undefined");
console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + isFMmanualSupportedpromise); console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + isFMmanualSupportedpromise);
expect(isFMmanualSupportedpromise).assertEqual(true); expect(true).assertTrue();
console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED PASSED: "); console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED PASSED: ");
} }
else { else {
expect().assertFail();
console.info(TAG + "IS_FOCUS_MODE_MANUAL_SUPPORTED FAILED"); console.info(TAG + "IS_FOCUS_MODE_MANUAL_SUPPORTED FAILED");
console.info(TAG + "IS_FOCUS_MODE_MANUAL_SUPPORTED ends here");
}
await sleep(1);
done();
})
/**
* @tc.number : SET_FOCUS_MODE_MANUAL
* @tc.name : set focus mode manual camera0 api
* @tc.desc : set focus mode manual camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FOCUS_MODE_MANUAL', 0, async function (done) {
console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL to operate");
var setFocusManual = await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_MANUAL);
console.info(TAG + "setFocusManual: " + JSON.stringify(setFocusManual))
if (setFocusManual == undefined) {
console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_MANUAL);
console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL PASSED")
expect(cameraObj.FocusMode.FOCUS_MODE_MANUAL).assertEqual(0)
}
else {
expect().assertFail();
console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL FAILED");
console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL ends here");
}
await sleep(1);
done();
})
/**
* @tc.number : GET_FOCUS_MODE_MANUAL
* @tc.name : get focus mode manual camera0 api
* @tc.desc : get focus mode manual camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FOCUS_MODE_MANUAL', 0, async function (done) {
console.info(TAG + "Entering GET_FOCUS_MODE_MANUAL to operate");
var getfocusmodepromise = await camera0InputPromise.getFocusMode();
console.info(TAG + "Entering GET_FOCUS_MODE_MANUAL SUCCESS");
if (getfocusmodepromise == 0) {
console.info(TAG + "Current FocusMode is: " + getfocusmodepromise);
expect(true).assertTrue();
console.info(TAG + "GET_FOCUS_MODE_MANUAL PASSED");
}
else {
expect().assertFail(); expect().assertFail();
console.info(TAG + "GET_FOCUS_MODE_MANUAL FAILED"); console.info(TAG + "IS_FOCUS_MODE_MANUAL_SUPPORTED ends here");
console.info(TAG + "GET_FOCUS_MODE_MANUAL ends here");
} }
await sleep(1); await sleep(1);
done(); done();
}) })
/** /**
* @tc.number : IS_FOCUS_MODE_CONTINUOUS_SUPPORTED * @tc.number : IS_FOCUS_MODE_CONTINUOUS_SUPPORTED
* @tc.name : check if focus mode continuous is supported-camera0Input api * @tc.name : check if focus mode continuous is supported-camera0Input api
...@@ -1459,14 +940,14 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { ...@@ -1459,14 +940,14 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('IS_FOCUS_MODE_CONTINUOUS_SUPPORTED', 0, async function (done) { it('IS_FOCUS_MODE_CONTINUOUS_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED to operate"); console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED to operate");
var isFMContinuousSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); var isFMContinuousSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO);
if (isFMContinuousSupportedpromise != null || isFMContinuousSupportedpromise != undefined) { if (isFMContinuousSupportedpromise != null || isFMContinuousSupportedpromise != undefined) {
console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED data is not null || undefined"); console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED data is not null || undefined");
console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + isFMContinuousSupportedpromise); console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + isFMContinuousSupportedpromise);
expect(isFMContinuousSupportedpromise).assertEqual(true); expect(true).assertTrue();
console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED PASSED: "); console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED PASSED: ");
} }
else { else {
...@@ -1478,58 +959,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { ...@@ -1478,58 +959,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
done(); done();
}) })
/**
* @tc.number : SET_FOCUS_MODE_CONTINUOUS
* @tc.name : set focus mode continuous camera0 api
* @tc.desc : set focus mode continuous camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FOCUS_MODE_CONTINUOUS', 0, async function (done) {
console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS to operate");
var setFocusCont = await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO);
console.info(TAG + "setFocusCont: " + JSON.stringify(setFocusCont))
if (setFocusCont == undefined) {
console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO);
console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS PASSED")
expect(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO).assertEqual(1)
}
else {
expect().assertFail();
console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS FAILED");
console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS ends here");
}
await sleep(1);
done();
})
/**
* @tc.number : GET_FOCUS_MODE_CONTINUOUS
* @tc.name : get focus mode continuous camera0 api
* @tc.desc : get focus mode continuous camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FOCUS_MODE_CONTINUOUS', 0, async function (done) {
console.info(TAG + "Entering GET_FOCUS_MODE_CONTINUOUS to operate");
var getfocusmodepromise = await camera0InputPromise.getFocusMode();
console.info(TAG + "Entering GET_FOCUS_MODE_CONTINUOUS SUCCESS");
if (getfocusmodepromise == 1) {
console.info(TAG + "Current FocusMode is: " + getfocusmodepromise);
expect(true).assertTrue();
console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS PASSED");
}
else {
expect().assertFail();
console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS FAILED");
console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS ends here");
}
await sleep(1);
done();
})
/** /**
* @tc.number : IS_FOCUS_MODE_AUTO_SUPPORTED * @tc.number : IS_FOCUS_MODE_AUTO_SUPPORTED
* @tc.name : check if focus mode auto is supported-camera0Input api * @tc.name : check if focus mode auto is supported-camera0Input api
...@@ -1537,14 +967,14 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { ...@@ -1537,14 +967,14 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('IS_FOCUS_MODE_AUTO_SUPPORTED', 0, async function (done) { it('IS_FOCUS_MODE_AUTO_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED to operate"); console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED to operate");
var isFMAutoSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO); var isFMAutoSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO);
if (isFMAutoSupportedpromise != null || isFMAutoSupportedpromise != undefined) { if (isFMAutoSupportedpromise != null || isFMAutoSupportedpromise != undefined) {
console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED data is not null || undefined"); console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED data is not null || undefined");
console.info(TAG + "IS_FOCUS_MODE_AUTO_SUPPORTED is: " + isFMAutoSupportedpromise); console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + isFMAutoSupportedpromise);
expect(isFMAutoSupportedpromise).assertEqual(true); expect(true).assertTrue();
console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED PASSED: "); console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED PASSED: ");
} }
else { else {
...@@ -1556,341 +986,6 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { ...@@ -1556,341 +986,6 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
done(); done();
}) })
/**
* @tc.number : SET_FOCUS_MODE_AUTO
* @tc.name : set focus mode auto camera0 api
* @tc.desc : set focus mode auto camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FOCUS_MODE_AUTO', 0, async function (done) {
console.info(TAG + "Entering SET_FOCUS_MODE_AUTO to operate");
var setFocusAuto = await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO);
console.info(TAG + "setFocusAuto: " + JSON.stringify(setFocusAuto))
if (setFocusAuto == undefined) {
console.info(TAG + "Entering SET_FOCUS_MODE_AUTO SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO);
console.info(TAG + "Entering SET_FOCUS_MODE_AUTO PASSED")
expect(cameraObj.FocusMode.FOCUS_MODE_AUTO).assertEqual(2)
}
else {
console.info(TAG + "Entering SET_FOCUS_MODE_AUTO FAILED");
expect().assertFail();
console.info(TAG + "Entering SET_FOCUS_MODE_AUTO ends here");
}
await sleep(1);
done();
})
/**
* @tc.number : GET_FOCUS_MODE_AUTO
* @tc.name : get focus mode auto camera0 api
* @tc.desc : get focus mode auto camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FOCUS_MODE_AUTO', 0, async function (done) {
console.info(TAG + "Entering GET_FOCUS_MODE_AUTO to operate");
var getfocusmodepromise = await camera0InputPromise.getFocusMode();
console.info(TAG + "Entering GET_FOCUS_MODE_AUTO SUCCESS");
if (getfocusmodepromise == 2) {
console.info(TAG + "Current FocusMode is: " + getfocusmodepromise);
expect(true).assertTrue();
console.info(TAG + "GET_FOCUS_MODE_AUTO PASSED");
}
else {
expect().assertFail();
console.info(TAG + "GET_FOCUS_MODE_AUTO FAILED");
console.info(TAG + "GET_FOCUS_MODE_AUTO ends here");
}
await sleep(1);
done();
})
//ZOOM Function
/**
* @tc.number : GET_ZOOM_RATIO_PROMISE
* @tc.name : get zoom ratio camera-0 cameraId api promise api
* @tc.desc : get zoom ratio camera-0 cameraId api promise api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_ZOOM_RATIO_PROMISE', 0, async function (done) {
console.info("--------------GET_ZOOM_RATIO_PROMISE--------------");
var getZoomRatioPromise = await camera0InputPromise.getZoomRatioRange();
console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE getZoomRatioPromise: " + JSON.stringify(getZoomRatioPromise));
if (getZoomRatioPromise != null && getZoomRatioPromise != undefined) {
console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE setZoomRatioPromise is not null || undefined");
expect(true).assertTrue();
console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE success: " + JSON.stringify(getZoomRatioPromise));
console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE PASSED");
} else {
console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE FAILED");
expect().assertFail();
}
console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE ends here");
await sleep(1);
done();
})
/**
* @tc.number : SET_GET_ZOOM_1_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('SET_GET_ZOOM_1_PROMISE', 0, async function (done) {
var setpromise = await camera0InputPromise.setZoomRatio(1);
console.info(TAG + "setZoomRatio success: 1");
console.info(TAG + "getZoomRatio called")
var getpromise1 = await camera0InputPromise.getZoomRatio();
console.info(TAG + "getZoomRatio success: " + getpromise1);
if (getpromise1 != null && getpromise1 != undefined) {
expect(getpromise1).assertEqual(1);
console.info(TAG + "SET_GET_ZOOM_1_PROMISE PASSED ");
}
else {
console.info(TAG + "SET_GET_ZOOM_1_PROMISE FAILED");
expect().assertFail();
}
await sleep(1);
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('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(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
*/
it('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
*/
it('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
*/
it('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
*/
it('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();
})
/**
* @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('VIDEO_OUTPUT_START_PROMISE', 0, async function (done) {
if (videoOutputPromise == null || videoOutputPromise == undefined) {
console.info(TAG + 'Entering VIDEO_OUTPUT_START_PROMISE 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_RECORDER_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('VIDEO_RECORDER_START_PROMISE', 0, async function (done) {
if (videoRecorder == null || videoRecorder == undefined) {
console.info(TAG + 'Entering VIDEO_RECORDER_START_PROMISE videoRecorderPromise == null || undefined')
} else {
console.info(TAG + 'Entering VIDEO_RECORDER_START_PROMISE to operate')
await videoRecorder.start()
console.info(TAG + 'VIDEO_RECORDER_START_PROMISE called');
sleep(3);
console.info(TAG + 'VIDEO_RECORDER_START_PROMISE done.')
expect(true).assertTrue()
console.info(TAG + 'Entering VIDEO_RECORDER_START_PROMISE PASSED')
console.info(TAG + 'Entering VIDEO_RECORDER_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('VIDEO_OUTPUT_STOP_PROMISE', 0, async function (done) {
if (videoOutputPromise == null || videoOutputPromise == undefined) {
console.info(TAG + 'Entering VIDEO_OUTPUT_STOP_PROMISE 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 : VIDEO_RECORDER_STOP_PROMISE
* @tc.name : VideoRecorder stop promise api
* @tc.desc : VideoRecorder stop promise api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('VIDEO_RECORDER_STOP_PROMISE', 0, async function (done) {
if (videoOutputPromise == null || videoOutputPromise == undefined) {
console.info(TAG + 'Entering VIDEO_RECORDER_STOP_PROMISE videoOutputPromise == null || undefined')
} else {
console.info(TAG + 'Entering VIDEO_RECORDER_STOP_PROMISE to operate')
await videoRecorder.stop()
expect(true).assertTrue()
console.info(TAG + 'VIDEO_RECORDER_STOP done.')
console.info(TAG + 'Entering VIDEO_RECORDER_STOP_PROMISE PASSED')
console.info(TAG + 'Entering VIDEO_RECORDER_STOP_PROMISE ends here')
await sleep(1)
done()
}
await sleep(1)
done()
})
/** /**
* @tc.number : CAPTURE_SESSION_STOP_PROMISE * @tc.number : CAPTURE_SESSION_STOP_PROMISE
* @tc.name : CaptureSession stop promise api * @tc.name : CaptureSession stop promise api
...@@ -1939,33 +1034,6 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { ...@@ -1939,33 +1034,6 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
done() done()
}) })
/**
* @tc.number : VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE
* @tc.name : videoOutput release api
* @tc.desc : videoOutput release api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE', 0, async function (done) {
if (videoOutputPromise == null || videoOutputPromise == undefined) {
console.info(TAG + "Entering VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE previewOutputPromise == null || undefined");
} else {
console.info(TAG + "Entering VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE to operate");
const promise = await videoOutputPromise.release();
console.info(TAG + "Entering VideoOutputPromise.release promise: " + JSON.stringify(promise));
if (promise != null || promise != undefined) {
expect(true).assertTrue();
console.info(TAG + "Entering VideoOutputPromise.release PASSED");
}
console.info(TAG + "Entering VideoOutputPromise.release ends here");
await sleep(1);
done();
}
await sleep(1);
done();
})
/** /**
* @tc.number : PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE * @tc.number : PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE
* @tc.name : PreviewOutput release api * @tc.name : PreviewOutput release api
...@@ -1973,7 +1041,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { ...@@ -1973,7 +1041,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE', 0, async function (done) { it('PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE', 0, async function (done) {
if (previewOutputPromise == null || previewOutputPromise == undefined) { if (previewOutputPromise == null || previewOutputPromise == undefined) {
console.info(TAG + "Entering PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE previewOutputPromise == null || undefined"); console.info(TAG + "Entering PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE previewOutputPromise == null || undefined");
...@@ -2000,7 +1068,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { ...@@ -2000,7 +1068,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('CAMERAINPUT_RELEASE_SUCCESS_PROMISE', 0, async function (done) { it('CAMERAINPUT_RELEASE_SUCCESS_PROMISE', 0, async function (done) {
if (camera0InputPromise == null || camera0InputPromise == undefined) { if (camera0InputPromise == null || camera0InputPromise == undefined) {
console.info(TAG + "Entering CAMERAINPUT_RELEASE_SUCCESS_PROMISE camera0InputPromise == null || undefined"); console.info(TAG + "Entering CAMERAINPUT_RELEASE_SUCCESS_PROMISE camera0InputPromise == null || undefined");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册