diff --git a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/Camera.test.ets b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/Camera.test.ets index 6af7673008c41ef7c203aa070646d76fc678d665..72dffb41a6f8a78a9e9ce60299a4baf595e483f7 100644 --- a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/Camera.test.ets +++ b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/Camera.test.ets @@ -15,10 +15,10 @@ import cameraJSUnitEnum from './CameraJSUnitEnum.test.ets' import cameraJSUnitCameraFormat from './CameraJSUnitCameraFormat.test.ets' -//import cameraJSUnitPhotoAsync from './CameraJSUnitPhotoAsync.test.ets' -//import cameraJSUnitPhotoPromise from './CameraJSUnitPhotoPromise.test.ets' -//import cameraJSUnitVideoAsync from './CameraJSUnitVideoAsync.test.ets' -//import cameraJSUnitVideoPromise from './CameraJSUnitVideoPromise.test.ets' +import cameraJSUnitPhotoAsync from './CameraJSUnitPhotoAsync.test.ets' +import cameraJSUnitPhotoPromise from './CameraJSUnitPhotoPromise.test.ets' +import cameraJSUnitVideoAsync from './CameraJSUnitVideoAsync.test.ets' +import cameraJSUnitVideoPromise from './CameraJSUnitVideoPromise.test.ets' let TAG = 'CameraModuleTest: ' @@ -28,8 +28,8 @@ export default function cameraKit(surfaceId: any) { cameraJSUnitEnum(surfaceId) cameraJSUnitCameraFormat(surfaceId) - //cameraJSUnitPhotoAsync(surfaceId) - //cameraJSUnitPhotoPromise(surfaceId) - //cameraJSUnitVideoAsync(surfaceId) - //cameraJSUnitVideoPromise(surfaceId) + cameraJSUnitPhotoAsync(surfaceId) + cameraJSUnitPhotoPromise(surfaceId) + cameraJSUnitVideoAsync(surfaceId) + cameraJSUnitVideoPromise(surfaceId) } \ No newline at end of file diff --git a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitCameraFormat.test.ets b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitCameraFormat.test.ets index ff85c291b20ae014c24bf348c69ad92be3864253..b0ed4273eb7811150cf0fe12b5d87dbc3dce9ca1 100644 --- a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitCameraFormat.test.ets +++ b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitCameraFormat.test.ets @@ -286,7 +286,6 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { console.info(TAG + "Entering CREATE_CAMERA_INPUT_TC_005 FAILED: " + err.message); } console.info(TAG + "Entering CREATE_CAMERA_INPUT_TC_005 ends here"); - camera0Input.release(); await sleep(1000); done(); }) @@ -689,7 +688,6 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { */ it('CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_TC_021', 0, async function (done) { console.info("--------------CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_TC_021--------------"); - camera0InputPromise.release(); cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_BACK, cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED, async (err, data) => { if (!err) { console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_TC_021 success"); @@ -704,7 +702,6 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { expect().assertFail(); } console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_TC_021 ends here"); - camera0InputPosBack.release(); await sleep(1000); done(); }) @@ -1007,7 +1004,6 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { expect().assertFail(); } console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_TC_031 ends here"); - camera0InputPosFront.release(); await sleep(1000); done(); }) diff --git a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitEnum.test.ets b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitEnum.test.ets index 1cdbfe82b01347a3ab63d3d626a97a86cf5a4962..4bcc0fb337ee6713d01647d1890c2963bb8298c3 100644 --- a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitEnum.test.ets +++ b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitEnum.test.ets @@ -226,7 +226,6 @@ export default function cameraJSUnitEnum(surfaceId: any) { console.info(TAG + "Entering CREATE_CAMERA_INPUT_TC_003 FAILED: " + err.message); } console.info(TAG + "Entering CREATE_CAMERA_INPUT_TC_003 ends here"); - camera0Input.release(); await sleep(1000); done(); }) @@ -481,5 +480,29 @@ export default function cameraJSUnitEnum(surfaceId: any) { await sleep(1000); done(); }) + +/** + * @tc.number : VIDEOSTABILIZATION_ENUM + * @tc.name : VIDEOSTABILIZATION ENAME + * @tc.desc : VIDEOSTABILIZATION ENAME + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('VideoStabilization', 0, async function (done) { + console.info(TAG + "--------------VideoStabilization ------------") + console.info(TAG + "VideoStabilization OFF : " + cameraObj.VideoStabilizationMode.OFF); + expect(cameraObj.VideoStabilizationMode.OFF).assertEqual(0); + console.info(TAG + "VideoStabilization LOW : " + cameraObj.VideoStabilizationMode.LOW); + expect(cameraObj.VideoStabilizationMode.LOW).assertEqual(1); + console.info(TAG + "VideoStabilization MIDDLE : " + cameraObj.VideoStabilizationMode.MIDDLE); + expect(cameraObj.VideoStabilizationMode.MIDDLE).assertEqual(2); + console.info(TAG + "VideoStabilization HIGH : " + cameraObj.VideoStabilizationMode.HIGH); + expect(cameraObj.VideoStabilizationMode.HIGH).assertEqual(3); + console.info(TAG + "VideoStabilization AUTO : " + cameraObj.VideoStabilizationMode.AUTO); + expect(cameraObj.VideoStabilizationMode.AUTO).assertEqual(4); + await sleep(1000); + done(); + }) }) } \ No newline at end of file diff --git a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitPhotoAsync.test.ets b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitPhotoAsync.test.ets index ea9cd68aad6a63ea53858122c243d0895c1bfd89..1a242ef9b0b866be30fa4997724c3d7e0afa4d95 100644 --- a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitPhotoAsync.test.ets +++ b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitPhotoAsync.test.ets @@ -456,35 +456,6 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { done(); }) - /** - * @tc.number : isMirrorSupported_PHOTO_OUTPUT - * @tc.name : isMirrorSupported - * @tc.desc : isMirrorSupported - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('isMirrorSupported_PHOTO_OUTPUT', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering isMirrorSupported_PHOTO_OUTPUT to operate"); - photoOutputAsync.isMirrorSupported(async (err, data) => { - if (!err) { - console.info(TAG + "Entering isMirrorSupported_PHOTO_OUTPUT is success"); - console.info(TAG + "isMirrorSupported : " + data); - expect(true).assertTrue(); - } else { - expect().assertFail(); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - /** * @tc.number : PHOTO_OUTPUT_CALLBACK_ON_ERROR * @tc.name : Photo output callback on error api @@ -868,64 +839,6 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { } }) - /** - * @tc.number : setMirror_1 - * @tc.name : setMirror 1 - * @tc.desc : setMirror 1 - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('setMirror_1', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering setMirror_1 to operate"); - photoOutputAsync.setMirror(1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering setMirror_1 is success:"); - console.info(TAG + "setMirror is : " + '1'); - expect(true).assertTrue(); - } else { - expect().assertFail(); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : setMirror_0 - * @tc.name : setMirror 0 - * @tc.desc : setMirror 0 - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('setMirror_0', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering setMirror_0 to operate"); - photoOutputAsync.setMirror(0, async (err, data) => { - if (!err) { - console.info(TAG + "Entering setMirror_0 is success:"); - console.info(TAG + "setMirror is : " + '0'); - expect(true).assertTrue(); - } else { - expect().assertFail(); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - /*CaptureSession APIs*/ /** * @tc.number : BEGIN_CONFIG_SUCCESS diff --git a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitPhotoPromise.test.ets b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitPhotoPromise.test.ets index 30a1e8f5e77c9fda3f92d58c2227b91458e98379..859e0789c1df65311b8757d5c11e18f1bf5492e0 100644 --- a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitPhotoPromise.test.ets +++ b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitPhotoPromise.test.ets @@ -419,36 +419,6 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { done(); }) - /** - * @tc.number : isMirrorSupported_PHOTO_OUTPUT - * @tc.name : isMirrorSupported - * @tc.desc : isMirrorSupported - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('isMirrorSupported_PHOTO_OUTPUT', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering isMirrorSupported_PHOTO_OUTPUT to operate"); - await photoOutputPromise.isMirrorSupported() - .then(function (data) { - console.info(TAG + "Entering isMirrorSupported_PHOTO_OUTPUT is success"); - console.info(TAG + "isMirrorSupported : " + data); - expect(true).assertTrue(); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "isMirrorSupported_PHOTO_OUTPUT FAILED : " + err.message); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - /** * @tc.number : PHOTO_OUTPUT_CALLBACK_ON_ERROR * @tc.name : Photo output callback on error api @@ -778,10 +748,10 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { expect().assertFail(); console.info(TAG + "setMirror_true FAILED : " + err.message); }); - await sleep(2000); + await sleep(1000); done(); } - await sleep(2000); + await sleep(1000); done(); }) @@ -808,70 +778,10 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { expect().assertFail(); console.info(TAG + "setMirror_false FAILED : " + err.message); }); - await sleep(2000); - done(); - } - await sleep(2000); - done(); - }) - - /** - * @tc.number : setMirror_1 - * @tc.name : setMirror 1 - * @tc.desc : setMirror 1 - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('setMirror_1', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering setMirror_1 to operate"); - await photoOutputPromise.setMirror(1) - .then(function (data) { - console.info(TAG + "Entering setMirror_1 is success:"); - console.info(TAG + "setMirror is : " + '1'); - expect(true).assertTrue(); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "setMirror_1 FAILED : " + err.message); - }); - await sleep(2000); - done(); - } - await sleep(2000); - done(); - }) - - /** - * @tc.number : setMirror_0 - * @tc.name : setMirror 0 - * @tc.desc : setMirror 0 - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('setMirror_0', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering setMirror_0 to operate"); - await photoOutputPromise.setMirror(0) - .then(function (data) { - console.info(TAG + "Entering setMirror_0 is success:"); - console.info(TAG + "setMirror is : " + '0'); - expect(true).assertTrue(); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "setMirror_0 FAILED : " + err.message); - }); - await sleep(2000); + await sleep(1000); done(); } - await sleep(2000); + await sleep(1000); done(); }) diff --git a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitVideoAsync.test.ets b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitVideoAsync.test.ets index 2b635d2d613955eb77aa9642718bc08e0698730a..0f3bbddd3e16b2414b554ff59df37ac4a3b4412e 100644 --- a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitVideoAsync.test.ets +++ b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitVideoAsync.test.ets @@ -32,6 +32,20 @@ var previewOutput var photoOutputAsync var videoRecorder var surfaceId1 + +var minFrameRate_Grp0=12; +var maxFrameRate_Grp0=12; +var minFrameRate_Mix=14; +var maxFrameRate_Mix=15; +var minFrameRate_Err1=11; +var maxFrameRate_Err1=31; +var minFrameRate_Err2=14; +var maxFrameRate_Err2=28; +var minFrameRate_Err3=16; +var maxFrameRate_Err3=25; +var minFrameRate_Grp20=30; +var maxFrameRate_Grp20=30; + var Point = { x: 1, y: 1 } var photosettings1 = { rotation: 0, @@ -83,7 +97,7 @@ let configFile = { videoCodec: 'video/mp4v-es', videoFrameWidth: 640, videoFrameHeight: 480, - videoFrameRate: 10 + videoFrameRate: 30 } let videoConfig = { @@ -512,35 +526,6 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { done(); }) - /** - * @tc.number : isMirrorSupported_PHOTO_OUTPUT - * @tc.name : isMirrorSupported - * @tc.desc : isMirrorSupported - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('isMirrorSupported_PHOTO_OUTPUT', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering isMirrorSupported_PHOTO_OUTPUT to operate"); - photoOutputAsync.isMirrorSupported(async (err, data) => { - if (!err) { - console.info(TAG + "Entering isMirrorSupported_PHOTO_OUTPUT is success"); - console.info(TAG + "isMirrorSupported : " + data); - expect(true).assertTrue(); - } else { - expect().assertFail(); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - /** * @tc.number : PHOTO_OUTPUT_CALLBACK_ON_ERROR * @tc.name : Photo output callback on error api @@ -860,6 +845,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { done() } }) + /** * @tc.number : REMOVE_INPUT_SUCCESS * @tc.name : remove input api @@ -1113,6 +1099,635 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { done() } }) + + //framerate + /** + * @tc.number : GET_FRAME_RATE_RANGE + * @tc.name : get frame rate range camera0 api + * @tc.desc : get frame rate range async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_FRAME_RATE_RANGE', 0, async function (done) { + console.info(TAG + "Entering GET_FRAME_RATE_RANGE to operate"); + videoOutput.getFrameRateRange(async (err, data) => { + if (!err) { + console.info(TAG + "Entering get frame rate range success"); + expect(true).assertTrue(); + console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); + console.info(TAG + "GET_FRAME_RATE_RANGE PASSED"); + } + else { + expect().assertFail(); + console.info(TAG + "GET_FRAME_RATE_RANGE FAILED : " + err.message); + console.info(TAG + "GET_FRAME_RATE_RANGE ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) + + /** + * @tc.number : SET_FRAME_RATE_RANGE_Grp0 + * @tc.name : set frame rate range camera0 api + * @tc.desc : set frame rate range async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_FRAME_RATE_RANGE_Grp0', 0, async function (done) { + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Grp0 to operate"); + videoOutput.setFrameRateRange(minFrameRate_Grp0,maxFrameRate_Grp0, async (err, data) => { + if (!err) { + console.info(TAG + "Entering set frame rate range, current framerateRange is: " + JSON.stringify(data)); + console.info(TAG + "Entering set frame rate range PASSED") + expect(true).assertTrue(); + } + else { + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Grp0 FAILED : " + err.message); + expect().assertFail(); + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Grp0 ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) + + /** + * @tc.number : SET_FRAME_RATE_RANGE_Mix + * @tc.name : set frame rate range camera0 api + * @tc.desc : set frame rate range async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_FRAME_RATE_RANGE_Mix', 0, async function (done) { + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Mix to operate"); + videoOutput.setFrameRateRange(minFrameRate_Mix,maxFrameRate_Mix, async (err, data) => { + if (!err) { + console.info(TAG + "Entering set frame rate range, current framerateRange is: " + JSON.stringify(data)); + console.info(TAG + "Entering set frame rate range FAILED") + expect().assertFail(); + } + else { + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Mix PASSED : " + err.message); + expect(true).assertTrue(); + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Mix ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) + + /** + * @tc.number : SET_FRAME_RATE_RANGE_Err1 + * @tc.name : set frame rate range camera0 api_err + * @tc.desc : set frame rate range async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_FRAME_RATE_RANGE_Err1', 0, async function (done) { + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Err1 to operate"); + videoOutput.setFrameRateRange(minFrameRate_Err1,maxFrameRate_Err1, async (err, data) => { + if (!err) { + console.info(TAG + "Entering set frame rate range, current framerateRange is: " + JSON.stringify(data)); + console.info(TAG + "Entering set frame rate range FAILED") + expect().assertFail(); + } + else { + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Err1 PASSED : " + err.message); + expect(true).assertTrue(); + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Err1 ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) + + /** + * @tc.number : SET_FRAME_RATE_RANGE_Err2 + * @tc.name : set frame rate range camera0 api + * @tc.desc : set frame rate range async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_FRAME_RATE_RANGE_Err2', 0, async function (done) { + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Err2 to operate"); + videoOutput.setFrameRateRange(minFrameRate_Err2,maxFrameRate_Err2, async (err, data) => { + if (!err) { + console.info(TAG + "Entering set frame rate range, current framerateRange is: " + JSON.stringify(data)); + console.info(TAG + "Entering set frame rate range FAILED"); + expect().assertFail(); + } + else { + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Err2 PASSED : " + err.message); + expect(true).assertTrue(); + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Err2 ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) + + /** + * @tc.number : SET_FRAME_RATE_RANGE_Err3 + * @tc.name : set frame rate range camera0 api + * @tc.desc : set frame rate range async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_FRAME_RATE_RANGE_Err3', 0, async function (done) { + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Err3 to operate"); + videoOutput.setFrameRateRange(minFrameRate_Err3,maxFrameRate_Err3, async (err, data) => { + if (!err) { + console.info(TAG + "Entering set frame rate range, current framerateRange is: " + JSON.stringify(data)); + console.info(TAG + "Entering set frame rate range FAILED"); + expect().assertFail(); + } + else { + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Err3 PASSED : " + err.message); + expect(true).assertTrue(); + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Err3 ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) + + /** + * @tc.number : SET_FRAME_RATE_RANGE_Grp20 + * @tc.name : set frame rate range camera0 api + * @tc.desc : set frame rate range async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_FRAME_RATE_RANGE_Grp20', 0, async function (done) { + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Grp20 to operate"); + videoOutput.setFrameRateRange(minFrameRate_Grp20,maxFrameRate_Grp20, async (err, data) => { + if (!err) { + console.info(TAG + "Entering set frame rate range, current framerateRange is: " + JSON.stringify(data)); + console.info(TAG + "Entering set frame rate range PASSED") + expect(true).assertTrue(); + } + else { + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Grp20 FAILED : " + err.message); + expect().assertFail(); + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Grp20 ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) + + /** + * @tc.number : ISVIDEOSTABILIZATIONMODESUPPORTEDOFF + * @tc.name : isVideoStabilizationModeSupported Off + * @tc.desc : isVideoStabilizationModeSupported async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('ISVIDEOSTABILIZATIONMODESUPPORTEDOFF', 0, async function (done) { + console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTEDOFF to operate') + captureSession.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.OFF, async (err, data) => { + if (!err) { + console.info(TAG + 'Entering Create isVideoStabilizationModeSupported success') + expect(data).assertEqual(true) + console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTEDOFF PASSED :' + data) + } + else { + console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTEDOFF FAILED: ' + err.message) + expect().assertFail() + } + console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTEDOFF ends here') + await sleep(1) + done() + }) + await sleep(1) + done() + }) + + /** + * @tc.number : SET_VIDEOSTABILIZATIONMODEOFF + * @tc.name : SetVideoStabilizationModeOff + * @tc.desc : SetVideoStabilizationModeOff async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_VIDEOSTABILIZATIONMODEOFF', 0, async function (done) { + console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEOFF to operate') + captureSession.setVideoStabilizationMode(cameraObj.VideoStabilizationMode.OFF, async (err, data) => { + if (!err) { + console.info(TAG + 'Entering Set VideoStabilization Mode Off success') + console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEOFF PASSED: ' + data) + expect(cameraObj.VideoStabilizationMode.OFF).assertEqual(0) + } + else { + console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEOFF FAILED: ' + err.message) + expect().assertFail() + } + console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEOFF ends here') + await sleep(1) + done() + }) + await sleep(1) + done() + }) + + /** + * @tc.number : GET_VIDEOSTABILIZATION_MODE_OFF + * @tc.name : getVideoStabilizationModeOff + * @tc.desc : getVideoStabilizationModeOff async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_VIDEOSTABILIZATION_MODE_OFF', 0, async function (done) { + console.info(TAG + "Entering GET_VIDEOSTABILIZATION_MODE_OFF to operate"); + captureSession.getActiveVideoStabilizationMode(async (err, data) => { + if (!err) { + console.info(TAG + "Entering get Video Stabilization Mode Off success"); + console.info(TAG + "Current VideoStabilizationMode is: " + data); + expect(data).assertEqual(0); + console.info(TAG + "GET_VIDEOSTABILIZATION_MODE_OFF PASSED"); + } + else { + expect().assertFail(); + console.info(TAG + "GET_VIDEOSTABILIZATION_MODE_OFF FAILED :" + err.message); + console.info(TAG + "GET_VIDEOSTABILIZATION_MODE_OFF ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) + + /** + * @tc.number : ISVIDEOSTABILIZATIONMODESUPPORTED_LOW + * @tc.name : is VideoStabilization Mode Low Supported + * @tc.desc : isVideoStabilizationModeSupported low async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('ISVIDEOSTABILIZATIONMODESUPPORTED_LOW', 0, async function (done) { + console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_LOW to operate') + captureSession.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.LOW, async (err, data) => { + if (!err) { + console.info(TAG + 'Entering isVideoStabilizationModeSupported success') + if (data != null || data != undefined) { + console.info(TAG + 'Entering isVideoStabilizationModeSupported data is not null || undefined') + expect(data).assertEqual(true) + console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_LOW PASSED: ' + data) + } + } else { + console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_LOW FAILED: ' + err.message) + expect().assertFail() + } + console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_LOW ends here') + await sleep(1) + done() + }) + await sleep(1) + done() + }) + + /** + * @tc.number : SET_VIDEOSTABILIZATIONMODELOW + * @tc.name : SetVideoStabilizationModelow + * @tc.desc : SetVideoStabilizationModelow async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_VIDEOSTABILIZATIONMODELOW', 0, async function (done) { + console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODELOW to operate') + captureSession.setVideoStabilizationMode(cameraObj.VideoStabilizationMode.LOW, async (err, data) => { + if (!err) { + console.info(TAG + 'Entering Set VideoStabilization Mode Low success') + console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODELOW PASSED: ' + data) + expect(cameraObj.VideoStabilizationMode.LOW).assertEqual(1); + } + else { + console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODELOW FAILED: ' + err.message) + expect().assertFail(); + } + console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODELOW ends here') + await sleep(1) + done() + }) + await sleep(1) + done() + }) + + /** + * @tc.number : GET_VIDEOSTABILIZATION_MODE_LOW + * @tc.name : getVideoStabilizationModeLow + * @tc.desc : getVideoStabilizationModeLOw async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_VIDEOSTABILIZATION_MODE_LOW', 0, async function (done) { + console.info(TAG + "Entering GET_VIDEOSTABILIZATION_MODE_LOW to operate"); + captureSession.getActiveVideoStabilizationMode(async (err, data) => { + if (!err) { + console.info(TAG + "Entering get Video Stabilization Mode low success"); + console.info(TAG + "Current VideoStabilizationMode is: " + data); + expect(data).assertEqual(1) + console.info(TAG + "GET_VIDEOSTABILIZATION_MODE_LOW PASSED"); + } + else { + expect().assertFail(); + console.info(TAG + "GET_VIDEOSTABILIZATION_MODE_LOW FAILED :" + err.message); + console.info(TAG + "GET_VIDEOSTABILIZATION_MODE_LOW ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) + + /** + * @tc.number : ISVIDEOSTABILIZATIONMODESUPPORTED_MIDDLE + * @tc.name : is VideoStabilization Mode Middle Supported + * @tc.desc : isVideoStabilizationModeSupported Middle async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('ISVIDEOSTABILIZATIONMODESUPPORTED_MIDDLE', 0, async function (done) { + console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_MIDDLE to operate') + captureSession.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.MIDDLE, async (err, data) => { + if (!err) { + console.info(TAG + 'Entering is VideoStabilization Mode middle Supported success') + if (data != null || data != undefined) { + console.info(TAG + 'Entering isVideoStabilizationModeSupported data is not null || undefined') + expect(data).assertEqual(false) + console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_MIDDLE PASSED : ' + data) + } + } else { + console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_MIDDLE FAILED: ' + err.message) + expect().assertFail() + } + console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_MIDDLE ends here') + await sleep(1) + done() + }) + await sleep(1) + done() + }) + + /** + * @tc.number : SET_VIDEOSTABILIZATIONMODEMIDDLE + * @tc.name : SetVideoStabilizationModeMedium + * @tc.desc : SetVideoStabilizationModeMedium async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_VIDEOSTABILIZATIONMODEMIDDLE', 0, async function (done) { + console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEMIDDLE to operate') + captureSession.setVideoStabilizationMode(cameraObj.VideoStabilizationMode.MIDDLE, async (err, data) => { + if (!err) { + console.info(TAG + 'Entering Create Set VideoStabilization Mode middle success') + console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEMIDDLE FAILED: ' + data) + expect().assertFail(); + } + else { + console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEMIDDLE PASSED: ' + err.message) + expect(true).assertTrue(); + } + console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEMIDDLE ends here') + await sleep(1) + done() + }) + await sleep(1) + done() + }) + + /** + * @tc.number : GET_VIDEOSTABILIZATION_MODE_MIDDLE + * @tc.name : getVideoStabilizationModeMedium + * @tc.desc : getVideoStabilizationModeMedium async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_VIDEOSTABILIZATION_MODE_MIDDLE', 0, async function (done) { + console.info(TAG + "Entering GET_VIDEOSTABILIZATION_MODE_MIDDLE to operate"); + captureSession.getActiveVideoStabilizationMode(async (err, data) => { + if (!err) { + console.info(TAG + "Entering get Video Stabilization Mode medium success"); + console.info(TAG + "Current VideoStabilizationMode is: " + data); + expect(true).assertTrue(); + console.info(TAG + "GET_VIDEOSTABILIZATION_MODE_MIDDLE PASSED"); + } + else { + expect().assertFail(); + console.info(TAG + "GET_VIDEOSTABILIZATION_MODE_MIDDLE FAILED :" + err.message); + console.info(TAG + "GET_VIDEOSTABILIZATION_MODE_MIDDLE ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) + + /** + * @tc.number : ISVIDEOSTABILIZATIONMODESUPPORTED_HIGH + * @tc.name : is VideoStabilization Mode High Supported + * @tc.desc : isVideoStabilizationModeSupported High async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('ISVIDEOSTABILIZATIONMODESUPPORTED_HIGH', 0, async function (done) { + console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_HIGH to operate') + captureSession.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.HIGH, async (err, data) => { + if (!err) { + console.info(TAG + 'Entering is VideoStabilization Mode High Supported success') + expect(data).assertEqual(false) + console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_HIGH PASSED : ' + data) + } + else { + console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_HIGH FAILED: ' + err.message) + expect().assertFail() + } + console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_HIGH ends here') + await sleep(1) + done() + }) + await sleep(1) + done() + }) + + /** + * @tc.number : SET_VIDEOSTABILIZATIONMODEHIGH + * @tc.name : SetVideoStabilizationModeHigh + * @tc.desc : SetVideoStabilizationModeHigh async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_VIDEOSTABILIZATIONMODEHIGH', 0, async function (done) { + console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEHIGH to operate') + captureSession.setVideoStabilizationMode(cameraObj.VideoStabilizationMode.HIGH, async (err, data) => { + if (!err) { + console.info(TAG + 'Entering Create Set VideoStabilization Mode High success') + console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEHIGH FAILED: ' + data) + expect().assertFail(); + } + else { + console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEHIGH PASSED: ' + err.message) + expect(true).assertTrue(); + } + console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEHIGH ends here') + await sleep(1) + done() + }) + await sleep(1) + done() + }) + + /** + * @tc.number : GET_VIDEOSTABILIZATION_MODE_HIGH + * @tc.name : getVideoStabilizationModeHigh + * @tc.desc : getVideoStabilizationModeHigh async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_VIDEOSTABILIZATION_MODE_HIGH', 0, async function (done) { + console.info(TAG + "Entering GET_VIDEOSTABILIZATION_MODE_HIGH to operate"); + captureSession.getActiveVideoStabilizationMode(async (err, data) => { + if (!err) { + console.info(TAG + "Entering get Video Stabilization Mode High success"); + console.info(TAG + "Current VideoStabilizationMode is: " + data); + expect(true).assertTrue(); + console.info(TAG + "GET_VIDEOSTABILIZATION_MODE_HIGH PASSED"); + } + else { + expect().assertFail(); + console.info(TAG + "GET_VIDEOSTABILIZATION_MODE_HIGH FAILED :" + err.message); + console.info(TAG + "GET_VIDEOSTABILIZATION_MODE_HIGH ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) + + /** + * @tc.number : ISVIDEOSTABILIZATIONMODESUPPORTED_AUTO + * @tc.name : is VideoStabilization Mode Auto Supported + * @tc.desc : isVideoStabilizationModeSupported Auto async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('ISVIDEOSTABILIZATIONMODESUPPORTED_AUTO', 0, async function (done) { + console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_AUTO to operate') + captureSession.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.AUTO, async (err, data) => { + if (!err) { + console.info(TAG + 'Entering is VideoStabilization Mode Auto Supported success') + if (data != null || data != undefined) { + console.info(TAG + 'Entering isVideoStabilizationModeSupported data is not null || undefined') + expect(data).assertEqual(false) + console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_AUTO PASSED : ' + data) + } + } else { + console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_AUTO FAILED: ' + err.message) + expect().assertFail() + } + console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_AUTO ends here') + await sleep(1) + done() + }) + await sleep(1) + done() + }) + + /** + * @tc.number : SET_VIDEOSTABILIZATIONMODEAUTO + * @tc.name : SetVideoStabilizationModeAuto + * @tc.desc : SetVideoStabilizationModeAuto async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_VIDEOSTABILIZATIONMODEAUTO', 0, async function (done) { + console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEAUTO to operate') + captureSession.setVideoStabilizationMode(cameraObj.VideoStabilizationMode.AUTO, async (err, data) => { + if (!err) { + console.info(TAG + 'Entering Create Set VideoStabilization Mode auto success') + console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEAUTO FAILED: ' + data) + expect().assertFail(); + } + else { + console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEAUTO PASSED: ' + err.message) + expect(true).assertTrue(); + } + console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEAUTO ends here') + await sleep(1) + done() + }) + await sleep(1) + done() + }) + + /** + * @tc.number : GET_VIDEOSTABILIZATION_MODE_AUTO + * @tc.name : getVideoStabilizationModeAuto + * @tc.desc : getVideoStabilizationModeAuto async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_VIDEOSTABILIZATION_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering GET_VIDEOSTABILIZATION_MODE_AUTO to operate"); + captureSession.getActiveVideoStabilizationMode(async (err, data) => { + if (!err) { + console.info(TAG + "Entering get Video Stabilization Mode Auto success"); + console.info(TAG + "Current VideoStabilizationMode is: " + data); + expect(true).assertTrue(); + console.info(TAG + "GET_VIDEOSTABILIZATION_MODE_AUTO PASSED"); + } + else { + expect().assertFail(); + console.info(TAG + "GET_VIDEOSTABILIZATION_MODE_AUTO FAILED :" + err.message); + console.info(TAG + "GET_VIDEOSTABILIZATION_MODE_AUTO ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) /** * @tc.number : COMMIT_CONFIG @@ -1712,6 +2327,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { await sleep(1); done(); }) + /** * @tc.number : IS_FLASH_MODE_AUTO_SUPPORTED * @tc.name : check if flash mode auto is supported-camera0Input api @@ -1892,6 +2508,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { await sleep(1); done(); }) + /** * @tc.number : GET_ZOOM_RATIO * @tc.name : get zoom ratio camera-0 cameraId api @@ -3320,10 +3937,10 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { } else { expect().assertFail(); } - await sleep(2); + await sleep(1); done(); }) - await sleep(2); + await sleep(1); done(); } }) @@ -3402,7 +4019,6 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { console.info(TAG + 'Entering VideoOutput 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)) @@ -3435,7 +4051,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { console.info(TAG + 'Entering VideoRecorder stop videoRecorder == null || undefined') } else { console.info(TAG + 'Entering VIDEO_RECORDER_STOP to operate') - await videoRecorder.stop() + videoRecorder.stop() console.info(TAG + 'VideoRecorder stop stopVideo done.') console.info(TAG + 'Entering VIDEO_RECORDER_STOP PASSED') expect(true).assertTrue() diff --git a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitVideoPromise.test.ets b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitVideoPromise.test.ets index c0dffb634da2cfc7b1eabd9fc59cfb07afbcd3f3..64b7b985c06c2b1227a4fa06fbb766140ceaa7e9 100644 --- a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitVideoPromise.test.ets +++ b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitVideoPromise.test.ets @@ -35,6 +35,19 @@ let fdPath; let fileAsset; let fdNumber; +var minFrameRate_Grp0=12; +var maxFrameRate_Grp0=12; +var minFrameRate_Mix=14; +var maxFrameRate_Mix=15; +var minFrameRate_Err1=11; +var maxFrameRate_Err1=31; +var minFrameRate_Err2=14; +var maxFrameRate_Err2=28; +var minFrameRate_Err3=16; +var maxFrameRate_Err3=25; +var minFrameRate_Grp20=30; +var maxFrameRate_Grp20=30; + var Point1 = { x: 1, y: 1 } var Point2 = { x: 2, y: 2 } var Point3 = { x: 3, y: 3 } @@ -88,7 +101,7 @@ let configFile = { videoCodec: 'video/mp4v-es', videoFrameWidth: 640, videoFrameHeight: 480, - videoFrameRate: 10 + videoFrameRate: 30 } let videoConfig = { @@ -607,36 +620,6 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { done(); }) - /** - * @tc.number : isMirrorSupported_PHOTO_OUTPUT - * @tc.name : isMirrorSupported - * @tc.desc : isMirrorSupported - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('isMirrorSupported_PHOTO_OUTPUT', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering isMirrorSupported_PHOTO_OUTPUT to operate"); - await photoOutputPromise.isMirrorSupported() - .then(function (data) { - console.info(TAG + "Entering isMirrorSupported_PHOTO_OUTPUT is success"); - console.info(TAG + "isMirrorSupported : " + data); - expect(true).assertTrue(); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "isMirrorSupported_PHOTO_OUTPUT FAILED : " + err.message); - }); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - /** * @tc.number : PHOTO_OUTPUT_CALLBACK_ON_ERROR * @tc.name : Photo output callback on error api @@ -879,6 +862,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { await sleep(1); done(); }) + /** * @tc.number : REMOVE_INPUT_SUCCESS * @tc.name : remove input api @@ -1127,6 +1111,572 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { done(); }) + /** + * @tc.number : GET_FRAME_RATE_RANGE + * @tc.name : get frame rate range camera0 api + * @tc.desc : get frame rate range promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_FRAME_RATE_RANGE', 0, async function (done) { + console.info(TAG + "Entering GET_FRAME_RATE_RANGE to operate"); + await videoOutputPromise.getFrameRateRange() + .then(function (data) { + console.info(TAG + "Entering get frame rate range SUCCESS "); + console.info(TAG + "Entering GET_FRAME_RATE_RANGE PASSED : " + JSON.stringify(data)) + expect(true).assertTrue(); + }) + .catch((err) => { + console.info(TAG + "Entering GET_FRAME_RATE_RANGE FAILED : " + err.message); + expect().assertFail(); + }); + console.info(TAG + "Entering GET_FRAME_RATE_RANGE ends here"); + await sleep(1); + done(); + }) + + /** + * @tc.number : SET_FRAME_RATE_RANGE_Grp0 + * @tc.name : set frame rate range camera0 api + * @tc.desc : set frame rate range promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_FRAME_RATE_RANGE_Grp0', 0, async function (done) { + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Grp0 to operate"); + await videoOutputPromise.setFrameRateRange(minFrameRate_Grp0,maxFrameRate_Grp0) + .then(function (data) { + console.info(TAG + "Entering setFrameRateRange SUCCESS"); + console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); + expect(true).assertTrue(); + console.info(TAG + "SET_FRAME_RATE_RANGE_Grp0 PASSED"); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "SET_FRAME_RATE_RANGE_Grp0 FAILED: " + err.message); + }); + console.info(TAG + "SET_FRAME_RATE_RANGE_Grp0 ends here"); + await sleep(1); + done(); + }) + + /** + * @tc.number : SET_FRAME_RATE_RANGE_MIX + * @tc.name : set frame rate range camera0 api + * @tc.desc : set frame rate range promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_FRAME_RATE_RANGE_MIX', 0, async function (done) { + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_MIX to operate"); + await videoOutputPromise.setFrameRateRange(minFrameRate_Mix,maxFrameRate_Mix) + .then(function (data) { + console.info(TAG + "Entering setFrameRateRange"); + console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); + expect().assertFail(); + console.info(TAG + "SET_FRAME_RATE_RANGE_MIX FAILED"); + }) + .catch((err) => { + expect(true).assertTrue(); + console.info(TAG + "SET_FRAME_RATE_RANGE_MIX PASSED: " + err.message); + }); + console.info(TAG + "SET_FRAME_RATE_RANGE_MIX ends here"); + await sleep(1); + done(); + }) + + /** + * @tc.number : SET_FRAME_RATE_RANGE_Err1 + * @tc.name : set frame rate range camera0 api + * @tc.desc : set frame rate range promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_FRAME_RATE_RANGE_Err1', 0, async function (done) { + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Err1 to operate"); + await videoOutputPromise.setFrameRateRange(minFrameRate_Err1,maxFrameRate_Err1) + .then(function (data) { + console.info(TAG + "Entering setFrameRateRange"); + console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); + expect().assertFail(); + console.info(TAG + "SET_FRAME_RATE_RANGE_Err1 FAILED"); + }) + .catch((err) => { + expect(true).assertTrue(); + console.info(TAG + "SET_FRAME_RATE_RANGE_Err1 PASSED: " + err.message); + }); + console.info(TAG + "SET_FRAME_RATE_RANGE_Err1 ends here"); + await sleep(1); + done(); + }) + + /** + * @tc.number : SET_FRAME_RATE_RANGE_Err2 + * @tc.name : set frame rate range camera0 api + * @tc.desc : set frame rate range promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_FRAME_RATE_RANGE_Err2', 0, async function (done) { + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Err2 to operate"); + await videoOutputPromise.setFrameRateRange(minFrameRate_Err2,maxFrameRate_Err2) + .then(function (data) { + console.info(TAG + "Entering setFrameRateRange SUCCESS"); + console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); + expect().assertFail(); + console.info(TAG + "SET_FRAME_RATE_RANGE_Err2 FAILED"); + }) + .catch((err) => { + expect(true).assertTrue(); + console.info(TAG + "SET_FRAME_RATE_RANGE_Err2 PASSED: " + err.message); + }); + console.info(TAG + "SET_FRAME_RATE_RANGE_Err2 ends here"); + await sleep(1); + done(); + }) + + /** + * @tc.number : SET_FRAME_RATE_RANGE_Err3 + * @tc.name : set frame rate range camera0 api + * @tc.desc : set frame rate range promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_FRAME_RATE_RANGE_Err3', 0, async function (done) { + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Err3 to operate"); + await videoOutputPromise.setFrameRateRange(minFrameRate_Err3,maxFrameRate_Err3) + .then(function (data) { + console.info(TAG + "Entering setFrameRateRange SUCCESS"); + console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); + expect().assertFail(); + console.info(TAG + "SET_FRAME_RATE_RANGE_Err3 FAILED"); + }) + .catch((err) => { + expect(true).assertTrue(); + console.info(TAG + "SET_FRAME_RATE_RANGE_Err3 PASSED: " + err.message); + }); + console.info(TAG + "SET_FRAME_RATE_RANGE_Err3 ends here"); + await sleep(1); + done(); + }) + + /** + * @tc.number : SET_FRAME_RATE_RANGE_Grp20 + * @tc.name : set frame rate range camera0 api + * @tc.desc : set frame rate range promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_FRAME_RATE_RANGE_Grp20', 0, async function (done) { + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Grp20 to operate"); + await videoOutputPromise.setFrameRateRange(minFrameRate_Grp20,maxFrameRate_Grp20) + .then(function (data) { + console.info(TAG + "Entering setFrameRateRange SUCCESS"); + console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); + expect(true).assertTrue(); + console.info(TAG + "SET_FRAME_RATE_RANGE_Grp20 PASSED"); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "SET_FRAME_RATE_RANGE_Grp20 FAILED: " + err.message); + }); + console.info(TAG + "SET_FRAME_RATE_RANGE_Grp20 ends here"); + await sleep(1); + done(); + }) + + /** + * @tc.number : ISVIDEOSTABILIZATIONMODESUPPORTEDOFF + * @tc.name : isVideoStabilizationModeSupportedOff + * @tc.desc : isVideoStabilizationModeSupported promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('ISVIDEOSTABILIZATIONMODESUPPORTEDOFF', 0, async function (done) { + console.info(TAG + "Entering ISVIDEOSTABILIZATIONMODESUPPORTEDOFF to operate"); + await captureSessionPromise.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.OFF) + .then(function (data){ + console.info(TAG + "Entering is Video Stabilization Mode OFF Supported SUCCESS "); + console.info(TAG + "isVideoStabilizationModeSupported : " + data); + expect(data).assertEqual(true); + console.info(TAG + "Entering ISVIDEOSTABILIZATIONMODESUPPORTEDOFF PASSED"); + }) + .catch((err) => { + console.info(TAG + "Entering ISVIDEOSTABILIZATIONMODESUPPORTEDOFF FAILED : " + err.message); + expect().assertFail(); + console.info(TAG + "Entering ISVIDEOSTABILIZATIONMODESUPPORTEDOFF ends here"); + }); + await sleep(1); + done(); + }) + + /** + * @tc.number : SET_VIDEOSTABILIZATIONMODEOFF + * @tc.name : SetVideoStabilizationModeOff + * @tc.desc : SetVideoStabilizationModeOff promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_VIDEOSTABILIZATIONMODEOFF', 0, async function (done) { + console.info(TAG + "Entering SET_VIDEOSTABILIZATIONMODEOFF to operate"); + await captureSessionPromise.setVideoStabilizationMode(cameraObj.VideoStabilizationMode.OFF) + .then(function (){ + console.info(TAG + "Entering Set VideoStabilization Mode Off SUCCESS, current VideoStabilization Mode is: " + cameraObj.VideoStabilizationMode.OFF); + console.info(TAG + "Entering SET_VIDEOSTABILIZATIONMODEOFF PASSED") + expect(cameraObj.VideoStabilizationMode.OFF).assertEqual(0) + }) + .catch((err) => { + console.info(TAG + "Entering SET_VIDEOSTABILIZATIONMODEOFF FAILED : " + err.message); + expect().assertFail(); + }); + console.info(TAG + "Entering SET_VIDEOSTABILIZATIONMODEOFF ends here"); + await sleep(1); + done(); + }) + + /** + * @tc.number : GET_VIDEOSTABILIZATIONMODEOFF + * @tc.name : getVideoStabilizationModeOff + * @tc.desc : getVideoStabilizationModeOff promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_VIDEOSTABILIZATIONMODEOFF', 0, async function (done) { + console.info(TAG + "Entering GET_VIDEOSTABILIZATIONMODEOFF to operate"); + await captureSessionPromise.getActiveVideoStabilizationMode() + .then(function (data){ + console.info(TAG + "Entering getVideoStabilizationModeOff SUCCESS"); + console.info(TAG + "Current VideoStabilizationMode is: " + data); + expect(data).assertEqual(0); + console.info(TAG + "GET_VIDEOSTABILIZATIONMODEOFF PASSED"); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "GET_VIDEOSTABILIZATIONMODEOFF FAILED : " + err.message); + }); + console.info(TAG + "GET_VIDEOSTABILIZATIONMODEOFF ends here"); + await sleep(1); + done(); + }) + + /** + * @tc.number : ISVIDEOSTABILIZATIONMODESUPPORTED_LOW + * @tc.name : isVideoStabilizationModeSupported low + * @tc.desc : isVideoStabilizationModeSupported low promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('ISVIDEOSTABILIZATIONMODESUPPORTED_LOW', 0, async function (done) { + console.info(TAG + "Entering ISVIDEOSTABILIZATIONMODESUPPORTED_LOW to operate"); + await captureSessionPromise.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.LOW) + .then(function (data){ + console.info(TAG + "Entering is Video Stabilization Mode LOW Supported SUCCESS "); + console.info(TAG + "isVideoStabilizationModeSupported : " + data); + expect(data).assertEqual(true); + console.info(TAG + "Entering ISVIDEOSTABILIZATIONMODESUPPORTED_LOW PASSED"); + }) + .catch((err) => { + console.info(TAG + "Entering ISVIDEOSTABILIZATIONMODESUPPORTED_LOW FAILED : " + err.message); + expect().assertFail(); + console.info(TAG + "Entering ISVIDEOSTABILIZATIONMODESUPPORTED_LOW ends here"); + }); + await sleep(1); + done(); + }) + + /** + * @tc.number : SET_VIDEOSTABILIZATIONMODELOW + * @tc.name : SetVideoStabilizationModelow + * @tc.desc : SetVideoStabilizationModelow promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_VIDEOSTABILIZATIONMODELOW', 0, async function (done) { + console.info(TAG + "Entering SET_VIDEOSTABILIZATIONMODELOW to operate"); + await captureSessionPromise.setVideoStabilizationMode(cameraObj.VideoStabilizationMode.LOW) + .then(function (){ + console.info(TAG + "Entering Set VideoStabilization Mode Off SUCCESS, current VideoStabilization Mode is: " + cameraObj.VideoStabilizationMode.LOW); + console.info(TAG + "Entering SET_VIDEOSTABILIZATIONMODELOW PASSED") + expect(cameraObj.VideoStabilizationMode.LOW).assertEqual(1) + }) + .catch((err) => { + console.info(TAG + "Entering SET_VIDEOSTABILIZATIONMODELOW FAILED : " + err.message); + expect().assertFail(); + }); + console.info(TAG + "Entering SET_VIDEOSTABILIZATIONMODELOW ends here"); + await sleep(1); + done(); + }) + + /** + * @tc.number : GET_VIDEOSTABILIZATIONMODELOW + * @tc.name : getVideoStabilizationModeLow + * @tc.desc : getVideoStabilizationModeLow promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_VIDEOSTABILIZATIONMODELOW', 0, async function (done) { + console.info(TAG + "Entering GET_VIDEOSTABILIZATIONMODELOW to operate"); + await captureSessionPromise.getActiveVideoStabilizationMode() + .then(function (data){ + console.info(TAG + "Entering getVideoStabilizationModeLow SUCCESS"); + console.info(TAG + "Current VideoStabilizationMode is: " + data); + expect(data).assertEqual(1); + console.info(TAG + "GET_VIDEOSTABILIZATIONMODELOW PASSED"); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "GET_VIDEOSTABILIZATIONMODELOW FAILED : " + err.message); + }); + console.info(TAG + "GET_VIDEOSTABILIZATIONMODELOW ends here"); + await sleep(1); + done(); + }) + + /** + * @tc.number : ISVIDEOSTABILIZATIONMODESUPPORTED_MIDDLE + * @tc.name : isVideoStabilizationModeSupported MIDDLE + * @tc.desc : isVideoStabilizationModeSupported MIDDLE promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('ISVIDEOSTABILIZATIONMODESUPPORTED_MIDDLE', 0, async function (done) { + console.info(TAG + "Entering ISVIDEOSTABILIZATIONMODESUPPORTED_MIDDLE to operate"); + await captureSessionPromise.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.MIDDLE) + .then(function (data){ + console.info(TAG + "Entering is Video Stabilization Mode MIDDLE Supported SUCCESS "); + console.info(TAG + "isVideoStabilizationModeSupported : " + data); + expect(data).assertEqual(false); + console.info(TAG + "Entering ISVIDEOSTABILIZATIONMODESUPPORTED_MIDDLE PASSED"); + }) + .catch((err) => { + console.info(TAG + "Entering ISVIDEOSTABILIZATIONMODESUPPORTED_MIDDLE FAILED : " + err.message); + expect().assertFail(); + console.info(TAG + "Entering ISVIDEOSTABILIZATIONMODESUPPORTED_MIDDLE ends here"); + }); + await sleep(1); + done(); + }) + + /** + * @tc.number : SET_VIDEOSTABILIZATIONMODEMIDDLE + * @tc.name : SetVideoStabilizationModeMIDDLE + * @tc.desc : SetVideoStabilizationModeMIDDLE promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_VIDEOSTABILIZATIONMODEMIDDLE', 0, async function (done) { + console.info(TAG + "Entering SET_VIDEOSTABILIZATIONMODEMIDDLE to operate"); + await captureSessionPromise.setVideoStabilizationMode(cameraObj.VideoStabilizationMode.MIDDLE) + .then(function (){ + console.info(TAG + "Entering Set VideoStabilization Mode MIDDLE SUCCESS, current VideoStabilization Mode is: " + cameraObj.VideoStabilizationMode.MIDDLE); + console.info(TAG + "Entering SET_VIDEOSTABILIZATIONMODEMIDDLE FAILED") + expect().assertFail(); + }) + .catch((err) => { + console.info(TAG + "Entering SET_VIDEOSTABILIZATIONMODEMIDDLE PASSED : " + err.message); + expect(true).assertTrue(); + }); + console.info(TAG + "Entering SET_VIDEOSTABILIZATIONMODEMIDDLE ends here"); + await sleep(1); + done(); + }) + + /** + * @tc.number : GET_VIDEOSTABILIZATIONMODEMIDDLE + * @tc.name : getVideoStabilizationModeMIDDLE + * @tc.desc : getVideoStabilizationModeMIDDLE promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_VIDEOSTABILIZATIONMODEMIDDLE', 0, async function (done) { + console.info(TAG + "Entering GET_VIDEOSTABILIZATIONMODEMIDDLE to operate"); + await captureSessionPromise.getActiveVideoStabilizationMode() + .then(function (data){ + console.info(TAG + "Entering getVideoStabilizationModeMIDDLE SUCCESS"); + console.info(TAG + "Current VideoStabilizationMode is: " + data); + expect(true).assertTrue(); + console.info(TAG + "GET_VIDEOSTABILIZATIONMODEMIDDLE PASSED"); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "GET_VIDEOSTABILIZATIONMODEMIDDLE FAILED : " + err.message); + }); + console.info(TAG + "GET_VIDEOSTABILIZATIONMODEMIDDLE ends here"); + await sleep(1); + done(); + }) + + /** + * @tc.number : ISVIDEOSTABILIZATIONMODESUPPORTED_HIGH + * @tc.name : isVideoStabilizationModeSupported High + * @tc.desc : isVideoStabilizationModeSupported High promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('ISVIDEOSTABILIZATIONMODESUPPORTED_HIGH', 0, async function (done) { + console.info(TAG + "Entering ISVIDEOSTABILIZATIONMODESUPPORTED_HIGH to operate"); + await captureSessionPromise.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.HIGH) + .then(function (data){ + console.info(TAG + "Entering is Video Stabilization Mode HIGH Supported SUCCESS "); + console.info(TAG + "isVideoStabilizationModeSupported : " + data); + expect(data).assertEqual(false); + console.info(TAG + "Entering ISVIDEOSTABILIZATIONMODESUPPORTED_HIGH PASSED"); + }) + .catch((err) => { + console.info(TAG + "Entering ISVIDEOSTABILIZATIONMODESUPPORTED_HIGH FAILED : " + err.message); + expect().assertFail(); + console.info(TAG + "Entering ISVIDEOSTABILIZATIONMODESUPPORTED_HIGH ends here"); + }); + await sleep(1); + done(); + }) + + /** + * @tc.number : SET_VIDEOSTABILIZATIONMODEHIGH + * @tc.name : SetVideoStabilizationModeHigh + * @tc.desc : SetVideoStabilizationModeHigh promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_VIDEOSTABILIZATIONMODEHIGH', 0, async function (done) { + console.info(TAG + "Entering SET_VIDEOSTABILIZATIONMODEHIGH to operate"); + await captureSessionPromise.setVideoStabilizationMode(cameraObj.VideoStabilizationMode.HIGH) + .then(function (){ + console.info(TAG + "Entering Set VideoStabilization Mode High SUCCESS, current VideoStabilization Mode is: " + cameraObj.VideoStabilizationMode.HIGH); + console.info(TAG + "Entering SET_VIDEOSTABILIZATIONMODEHIGH FAILED") + expect().assertFail(); + }) + .catch((err) => { + console.info(TAG + "Entering SET_VIDEOSTABILIZATIONMODEHIGH PASSED : " + err.message); + expect(true).assertTrue(); + }); + console.info(TAG + "Entering SET_VIDEOSTABILIZATIONMODEHIGH ends here"); + await sleep(1); + done(); + }) + + /** + * @tc.number : GET_VIDEOSTABILIZATIONMODEHIGH + * @tc.name : getVideoStabilizationModeHigh + * @tc.desc : getVideoStabilizationModeHigh promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_VIDEOSTABILIZATIONMODEHIGH', 0, async function (done) { + console.info(TAG + "Entering GET_VIDEOSTABILIZATIONMODEHIGH to operate"); + await captureSessionPromise.getActiveVideoStabilizationMode() + .then(function (data){ + console.info(TAG + "Entering getVideoStabilizationModeHigh SUCCESS"); + console.info(TAG + "Current VideoStabilizationMode is: " + data); + expect(true).assertTrue(); + console.info(TAG + "GET_VIDEOSTABILIZATIONMODEHIGH PASSED"); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "GET_VIDEOSTABILIZATIONMODEHIGH FAILED : " + err.message); + }); + console.info(TAG + "GET_VIDEOSTABILIZATIONMODEHIGH ends here"); + await sleep(1); + done(); + }) + + /** + * @tc.number : ISVIDEOSTABILIZATIONMODESUPPORTED_AUTO + * @tc.name : isVideoStabilizationModeSupported Auto + * @tc.desc : isVideoStabilizationModeSupported Auto promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('ISVIDEOSTABILIZATIONMODESUPPORTED_AUTO', 0, async function (done) { + console.info(TAG + "Entering ISVIDEOSTABILIZATIONMODESUPPORTED_AUTO to operate"); + await captureSessionPromise.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.AUTO) + .then(function (data){ + console.info(TAG + "Entering is Video Stabilization Mode AUTO Supported SUCCESS "); + console.info(TAG + "isVideoStabilizationModeSupported : " + data); + expect(data).assertEqual(false); + console.info(TAG + "Entering ISVIDEOSTABILIZATIONMODESUPPORTED_AUTO PASSED"); + }) + .catch((err) => { + console.info(TAG + "Entering ISVIDEOSTABILIZATIONMODESUPPORTED_AUTO FAILED : " + err.message); + expect().assertFail(); + console.info(TAG + "Entering ISVIDEOSTABILIZATIONMODESUPPORTED_AUTO ends here"); + }); + await sleep(1); + done(); + }) + + /** + * @tc.number : SET_VIDEOSTABILIZATIONMODEAUTO + * @tc.name : SetVideoStabilizationModeAuto + * @tc.desc : SetVideoStabilizationModeAuto promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_VIDEOSTABILIZATIONMODEAUTO', 0, async function (done) { + console.info(TAG + "Entering SET_VIDEOSTABILIZATIONMODEAUTO to operate"); + await captureSessionPromise.setVideoStabilizationMode(cameraObj.VideoStabilizationMode.AUTO) + .then(function (){ + console.info(TAG + "Entering Set VideoStabilization Mode Auto SUCCESS, current VideoStabilization Mode is: " + cameraObj.VideoStabilizationMode.AUTO); + console.info(TAG + "Entering SET_VIDEOSTABILIZATIONMODEAUTO FAILED") + expect().assertFail(); + }) + .catch((err) => { + console.info(TAG + "Entering SET_VIDEOSTABILIZATIONMODEAUTO PASSED : " + err.message); + expect(true).assertTrue(); + }); + console.info(TAG + "Entering SET_VIDEOSTABILIZATIONMODEAUTO ends here"); + await sleep(1); + done(); + }) + + /** + * @tc.number : GET_VIDEOSTABILIZATIONMODEAUTO + * @tc.name : getVideoStabilizationModeAuto + * @tc.desc : getVideoStabilizationModeAuto promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_VIDEOSTABILIZATIONMODEAUTO', 0, async function (done) { + console.info(TAG + "Entering GET_VIDEOSTABILIZATIONMODEAUTO to operate"); + await captureSessionPromise.getActiveVideoStabilizationMode() + .then(function (data){ + console.info(TAG + "Entering getVideoStabilizationModeAuto SUCCESS"); + console.info(TAG + "Current VideoStabilizationMode is: " + data); + expect(true).assertTrue(); + console.info(TAG + "GET_VIDEOSTABILIZATIONMODEAUTO PASSED"); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "GET_VIDEOSTABILIZATIONMODEAUTO FAILED : " + err.message); + }); + console.info(TAG + "GET_VIDEOSTABILIZATIONMODEAUTO ends here"); + await sleep(1); + done(); + }) + /** * @tc.number : COMMIT_CONFIG_SUCCESS * @tc.name : commit config api @@ -3072,35 +3622,6 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { 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 videoRecorderPromise == null || undefined') - } else { - console.info(TAG + 'Entering VIDEO_RECORDER_START_PROMISE to operate') - await videoRecorder.start() - console.info(TAG + 'Video recorder start called'); - sleep(3); - console.info(TAG + 'Capture with photosettings1 during video - Start & setMirror : true.'); - photoOutputPromise.capture(photosettings1) - console.info(TAG + 'Capture during video - End.') - 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 @@ -3125,31 +3646,6 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { 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 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.name : CaptureSession stop promise api