提交 5fa420fb 编写于 作者: S SongChunPeng

fix sync

Signed-off-by: NSongChunPeng <songchunpeng@huawei.com>
上级 77b0ed5f
...@@ -96,10 +96,16 @@ export default function cameraEnumTest() { ...@@ -96,10 +96,16 @@ export default function cameraEnumTest() {
*/ */
it('SUB_MULTIMEDIA_CAMERA_ENUM_CAMERATYPE_0100', 2, async function (done) { it('SUB_MULTIMEDIA_CAMERA_ENUM_CAMERATYPE_0100', 2, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_ENUM_CAMERATYPE_0100--------------"); console.info("--------------SUB_MULTIMEDIA_CAMERA_ENUM_CAMERATYPE_0100--------------");
expect(camera.CameraType.CAMERA_TYPE_DEFAULT == 0).assertTrue(); console.info("CameraType: "+ JSON.stringify(camera.CameraType));
// expect(camera.CameraType.CAMERA_TYPE_DEFAULT == 0).assertTrue();
// expect(camera.CameraType.CAMERA_TYPE_UNSPECIFIED == 0).assertTrue();
console.info("CAMERA_TYPE_WIDE_ANGLE:"+camera.CameraType.CAMERA_TYPE_WIDE_ANGLE);
expect(camera.CameraType.CAMERA_TYPE_WIDE_ANGLE == 1).assertTrue(); expect(camera.CameraType.CAMERA_TYPE_WIDE_ANGLE == 1).assertTrue();
console.info("CAMERA_TYPE_ULTRA_WIDE"+camera.CameraType.CAMERA_TYPE_ULTRA_WIDE);
expect(camera.CameraType.CAMERA_TYPE_ULTRA_WIDE == 2).assertTrue(); expect(camera.CameraType.CAMERA_TYPE_ULTRA_WIDE == 2).assertTrue();
console.info("CAMERA_TYPE_TELEPHOTO"+camera.CameraType.CAMERA_TYPE_TELEPHOTO);
expect(camera.CameraType.CAMERA_TYPE_TELEPHOTO == 3).assertTrue(); expect(camera.CameraType.CAMERA_TYPE_TELEPHOTO == 3).assertTrue();
console.info("CAMERA_TYPE_TRUE_DEPTH"+camera.CameraType.CAMERA_TYPE_TRUE_DEPTH);
expect(camera.CameraType.CAMERA_TYPE_TRUE_DEPTH == 4).assertTrue(); expect(camera.CameraType.CAMERA_TYPE_TRUE_DEPTH == 4).assertTrue();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ENUM_CAMERATYPE_0100 ends here"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ENUM_CAMERATYPE_0100 ends here");
done(); done();
......
...@@ -69,10 +69,10 @@ export default function CameraInputTest() { ...@@ -69,10 +69,10 @@ export default function CameraInputTest() {
} }
} }
async function getCameraManagerInstance() { function getCameraManagerInstance() {
console.info('Enter getCameraManagerInstance'); console.info('Enter getCameraManagerInstance');
mCameraManager = await cameraObj.getCameraManager(null); mCameraManager = cameraObj.getCameraManager(null);
if (isEmpty(mCameraManager)) { if (isEmpty(mCameraManager)) {
console.info(TAG + "getCameraManager FAILED"); console.info(TAG + "getCameraManager FAILED");
return false; return false;
...@@ -83,10 +83,10 @@ export default function CameraInputTest() { ...@@ -83,10 +83,10 @@ export default function CameraInputTest() {
return true; return true;
} }
async function getCameraSupportDevicesArray() { function getCameraSupportDevicesArray() {
console.info('Enter getCameraSupportDevicesArray'); console.info('Enter getCameraSupportDevicesArray');
mCameraDevicesArray = await mCameraManager.getSupportedCameras(); mCameraDevicesArray = mCameraManager.getSupportedCameras();
/* /*
mCameraManager.getSupportedCameras(async (err, data) => { mCameraManager.getSupportedCameras(async (err, data) => {
console.info(TAG + "Entering getCameraSupportDevicesArray callback"); console.info(TAG + "Entering getCameraSupportDevicesArray callback");
...@@ -118,15 +118,12 @@ export default function CameraInputTest() { ...@@ -118,15 +118,12 @@ export default function CameraInputTest() {
return true; return true;
} }
async function beginCameraSessionConfig() { function beginCameraSessionConfig() {
console.info('Enter beginCameraSessionConfig'); console.info('Enter beginCameraSessionConfig');
console.info(TAG + "Entering beginConfig start"); console.info(TAG + "Entering beginConfig start");
mCameraSession.beginConfig(); mCameraSession.beginConfig();
console.info(TAG + "Entering beginConfig end"); console.info(TAG + "Entering beginConfig end");
await sleep(30);
console.info('Exit beginCameraSessionConfig'); console.info('Exit beginCameraSessionConfig');
return true; return true;
...@@ -150,11 +147,11 @@ export default function CameraInputTest() { ...@@ -150,11 +147,11 @@ export default function CameraInputTest() {
return true; return true;
} }
async function createCameraSessionInstance() { function createCameraSessionInstance() {
console.info('Enter createCameraSessionInstance'); console.info('Enter createCameraSessionInstance');
try { try {
mCameraSession = await mCameraManager.createCaptureSession(); mCameraSession = mCameraManager.createCaptureSession();
} }
catch { catch {
console.info('createCaptureSession FAILED'); console.info('createCaptureSession FAILED');
...@@ -165,7 +162,7 @@ export default function CameraInputTest() { ...@@ -165,7 +162,7 @@ export default function CameraInputTest() {
return false; return false;
} }
await beginCameraSessionConfig(); beginCameraSessionConfig();
console.info('Exit createCameraSessionInstance'); console.info('Exit createCameraSessionInstance');
...@@ -184,23 +181,16 @@ export default function CameraInputTest() { ...@@ -184,23 +181,16 @@ export default function CameraInputTest() {
return false; return false;
} }
mCameraInput = await mCameraManager.createCameraInput(mCameraDevicesArray[idx]); mCameraInput = mCameraManager.createCameraInput(mCameraDevicesArray[idx]);
if (isEmpty(mCameraInput)) { if (isEmpty(mCameraInput)) {
console.info(TAG + "createCameraInput FAILED"); console.info(TAG + "createCameraInput FAILED");
return false; return false;
} }
mCameraInput.open(async (err) => { await mCameraInput.open();
console.info(TAG + "Entering mCameraInput open callback");
if (!err) {
console.info(TAG + "Entering mCameraInput open PASSED ");
} else {
console.info(TAG + "Entering mCameraInput open FAILED : " + err.message);
}
})
await sleep(100); sleep(100);
console.info(idx + 'th CameraInput is: ' + mCameraInput); console.info(idx + 'th CameraInput is: ' + mCameraInput);
...@@ -221,16 +211,16 @@ export default function CameraInputTest() { ...@@ -221,16 +211,16 @@ export default function CameraInputTest() {
return true; return true;
} }
async function createOutput(idx:any) { function createOutput(idx:any) {
console.info('Enter createOutput'); console.info('Enter createOutput');
let cameraOutputCap = mCameraManager.getSupportedOutputCapability(); let cameraOutputCap = mCameraManager.getSupportedOutputCapability(mCameraDevicesArray[idx]);
if (!isEmpty(cameraOutputCap)) { if (!isEmpty(cameraOutputCap)) {
if (!isEmpty(cameraOutputCap.previewProfiles)) { if (!isEmpty(cameraOutputCap.previewProfiles)) {
console.info(TAG + "cameraOutputCap.previewProfiles.length: " + cameraOutputCap.previewProfiles.length); console.info(TAG + "cameraOutputCap.previewProfiles.length: " + cameraOutputCap.previewProfiles.length);
for (let i = 0; i < cameraOutputCap.previewProfiles.length; i++) { for (let i = 0; i < cameraOutputCap.previewProfiles.length; i++) {
mPreviewOutput = await mCameraManager.createPreviewOutput(cameraOutputCap.previewProfiles[i], globalThis.surfaceId); mPreviewOutput = mCameraManager.createPreviewOutput(cameraOutputCap.previewProfiles[i], globalThis.surfaceId);
if (!isEmpty(mPreviewOutput)) { if (!isEmpty(mPreviewOutput)) {
break; break;
} }
...@@ -253,7 +243,6 @@ export default function CameraInputTest() { ...@@ -253,7 +243,6 @@ export default function CameraInputTest() {
console.info('Enter releaseOutput'); console.info('Enter releaseOutput');
if (!isEmpty(mPreviewOutput)) { if (!isEmpty(mPreviewOutput)) {
await mPreviewOutput.stop();
await mPreviewOutput.release(); await mPreviewOutput.release();
} }
...@@ -266,18 +255,18 @@ export default function CameraInputTest() { ...@@ -266,18 +255,18 @@ export default function CameraInputTest() {
console.info(TAG + "Enter startCameraSession"); console.info(TAG + "Enter startCameraSession");
await createInput(idx); await createInput(idx);
await createOutput(idx); createOutput(idx);
await sleep(1); await sleep(1);
if (!isEmpty(mCameraInput)) { if (!isEmpty(mCameraInput)) {
console.info(TAG + "Start to addInput"); console.info(TAG + "Start to addInput");
await mCameraSession.addInput(mCameraInput); mCameraSession.addInput(mCameraInput);
} }
if (!isEmpty(mPreviewOutput)) { if (!isEmpty(mPreviewOutput)) {
console.info(TAG + "Start to addOutput mPreviewOutput"); console.info(TAG + "Start to addOutput mPreviewOutput");
await mCameraSession.addOutput(mPreviewOutput); mCameraSession.addOutput(mPreviewOutput);
} }
await sleep(1); await sleep(1);
...@@ -294,12 +283,12 @@ export default function CameraInputTest() { ...@@ -294,12 +283,12 @@ export default function CameraInputTest() {
if (!isEmpty(mCameraInput)) { if (!isEmpty(mCameraInput)) {
console.info(TAG + "Start to removeInput input"); console.info(TAG + "Start to removeInput input");
await mCameraSession.removeInput(mCameraInput); mCameraSession.removeInput(mCameraInput);
} }
if (!isEmpty(mPreviewOutput)) { if (!isEmpty(mPreviewOutput)) {
console.info(TAG + "Start to removeOutput mPreviewOutput"); console.info(TAG + "Start to removeOutput mPreviewOutput");
await mCameraSession.removeOutput(mPreviewOutput); mCameraSession.removeOutput(mPreviewOutput);
} }
await releaseInput(); await releaseInput();
...@@ -316,9 +305,9 @@ export default function CameraInputTest() { ...@@ -316,9 +305,9 @@ export default function CameraInputTest() {
await getPermission(); await getPermission();
sleep(1000); sleep(1000);
await driveFn(); await driveFn();
await getCameraManagerInstance(); getCameraManagerInstance();
await getCameraSupportDevicesArray(); getCameraSupportDevicesArray();
await createCameraSessionInstance(); createCameraSessionInstance();
console.info('beforeAll case'); console.info('beforeAll case');
}); });
beforeEach(function () { beforeEach(function () {
......
...@@ -671,8 +671,7 @@ export default function cameraJSUnitOutput() { ...@@ -671,8 +671,7 @@ export default function cameraJSUnitOutput() {
it('SUB_MULTIMEDIA_CAMERA_METADATA_OUTPUT_CALLBACK_ON_ERROR_0100', 1, async function (done) { it('SUB_MULTIMEDIA_CAMERA_METADATA_OUTPUT_CALLBACK_ON_ERROR_0100', 1, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_METADATA_OUTPUT_CALLBACK_ON_ERROR_0100--------------"); console.info("--------------SUB_MULTIMEDIA_CAMERA_METADATA_OUTPUT_CALLBACK_ON_ERROR_0100--------------");
if (isEmpty(metadataOutput)) { if (isEmpty(metadataOutput)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_METADATA_OUTPUT_CALLBACK_ON_ERROR_0100 metadataOutput == null || undefined") console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_METADATA_OUTPUT_CALLBACK_ON_ERROR_0100 metadata is not support")
expect().assertFail();
} else { } else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_METADATA_OUTPUT_CALLBACK_ON_ERROR_0100 to operate"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_METADATA_OUTPUT_CALLBACK_ON_ERROR_0100 to operate");
metadataOutput.on('error', async (err, data) => { metadataOutput.on('error', async (err, data) => {
......
...@@ -180,10 +180,10 @@ export default function cameraSessionZoomRatioTest() { ...@@ -180,10 +180,10 @@ export default function cameraSessionZoomRatioTest() {
console.log(TAG + 'Exit releaseVideoReceiveSurface') console.log(TAG + 'Exit releaseVideoReceiveSurface')
} }
async function getCameraManagerInstance() { function getCameraManagerInstance() {
console.info('Enter getCameraManagerInstance'); console.info('Enter getCameraManagerInstance');
mCameraManager = await cameraObj.getCameraManager(null); mCameraManager = cameraObj.getCameraManager(null);
if (isEmpty(mCameraManager)) { if (isEmpty(mCameraManager)) {
console.info(TAG + "getCameraManager FAILED"); console.info(TAG + "getCameraManager FAILED");
return false; return false;
...@@ -194,10 +194,10 @@ export default function cameraSessionZoomRatioTest() { ...@@ -194,10 +194,10 @@ export default function cameraSessionZoomRatioTest() {
return true; return true;
} }
async function getCameraSupportDevicesArray() { function getCameraSupportDevicesArray() {
console.info('Enter getCameraSupportDevicesArray'); console.info('Enter getCameraSupportDevicesArray');
mCameraDevicesArray = await mCameraManager.getSupportedCameras(); mCameraDevicesArray = mCameraManager.getSupportedCameras();
/* /*
mCameraManager.getSupportedCameras(async (err, data) => { mCameraManager.getSupportedCameras(async (err, data) => {
console.info(TAG + "Entering getCameraSupportDevicesArray callback"); console.info(TAG + "Entering getCameraSupportDevicesArray callback");
...@@ -233,41 +233,11 @@ export default function cameraSessionZoomRatioTest() { ...@@ -233,41 +233,11 @@ export default function cameraSessionZoomRatioTest() {
return true; return true;
} }
async function beginCameraSessionConfig() { function createCameraSessionInstance() {
console.info('Enter beginCameraSessionConfig');
mCameraSession.beginConfig();
await sleep(30);
console.info('Exit beginCameraSessionConfig');
return true;
}
async function commitCameraSessionConfig() {
console.info('Enter commitCameraSessionConfig');
mCameraSession.commitConfig(async (err) => {
if (!err) {
console.info(TAG + "Entering commitConfig PASSED");
} else {
console.info(TAG + "Entering commitConfig FAILED : " + err.message);
}
})
await sleep(500);
console.info('Exit commitCameraSessionConfig');
return true;
}
async function createCameraSessionInstance() {
console.info('Enter createCameraSessionInstance'); console.info('Enter createCameraSessionInstance');
try { try {
mCameraSession = await mCameraManager.createCaptureSession(); mCameraSession = mCameraManager.createCaptureSession();
} }
catch { catch {
console.info('createCaptureSession FAILED'); console.info('createCaptureSession FAILED');
...@@ -278,7 +248,7 @@ export default function cameraSessionZoomRatioTest() { ...@@ -278,7 +248,7 @@ export default function cameraSessionZoomRatioTest() {
return false; return false;
} }
// await beginCameraSessionConfig(); mCameraSession.beginConfig();
console.info('Exit createCameraSessionInstance'); console.info('Exit createCameraSessionInstance');
...@@ -304,14 +274,7 @@ export default function cameraSessionZoomRatioTest() { ...@@ -304,14 +274,7 @@ export default function cameraSessionZoomRatioTest() {
return false; return false;
} }
mCameraInput.open(async (err) => { await mCameraInput.open();
console.info(TAG + "Entering mCameraInput open callback");
if (!err) {
console.info(TAG + "Entering mCameraInput open PASSED ");
} else {
console.info(TAG + "Entering mCameraInput open FAILED : " + err.message);
}
})
await sleep(100); await sleep(100);
...@@ -405,7 +368,6 @@ export default function cameraSessionZoomRatioTest() { ...@@ -405,7 +368,6 @@ export default function cameraSessionZoomRatioTest() {
console.info('Enter releaseOutput'); console.info('Enter releaseOutput');
if (!isEmpty(mPreviewOutput)) { if (!isEmpty(mPreviewOutput)) {
await mPreviewOutput.stop();
await mPreviewOutput.release(); await mPreviewOutput.release();
} }
...@@ -427,9 +389,7 @@ export default function cameraSessionZoomRatioTest() { ...@@ -427,9 +389,7 @@ export default function cameraSessionZoomRatioTest() {
console.info(TAG + "Enter startCameraSession"); console.info(TAG + "Enter startCameraSession");
await createInput(idx); await createInput(idx);
await createOutput(idx); createOutput(idx);
await beginCameraSessionConfig();
console.info(TAG + "Start to addInput"); console.info(TAG + "Start to addInput");
...@@ -438,17 +398,17 @@ export default function cameraSessionZoomRatioTest() { ...@@ -438,17 +398,17 @@ export default function cameraSessionZoomRatioTest() {
if (!isEmpty(mCameraInput)) { if (!isEmpty(mCameraInput)) {
console.info(TAG + "Start to addInput"); console.info(TAG + "Start to addInput");
await mCameraSession.addInput(mCameraInput); mCameraSession.addInput(mCameraInput);
} }
if (!isEmpty(mPreviewOutput)) { if (!isEmpty(mPreviewOutput)) {
console.info(TAG + "Start to addOutput mPreviewOutput"); console.info(TAG + "Start to addOutput mPreviewOutput");
await mCameraSession.addOutput(mPreviewOutput); mCameraSession.addOutput(mPreviewOutput);
} }
if (!isEmpty(mPhotoOutput)) { if (!isEmpty(mPhotoOutput)) {
console.info(TAG + "Start to addOutput mPhotoOutput"); console.info(TAG + "Start to addOutput mPhotoOutput");
await mCameraSession.addOutput(mPhotoOutput); mCameraSession.addOutput(mPhotoOutput);
} }
/* /*
if (!isEmpty(mVideoOutput)) { if (!isEmpty(mVideoOutput)) {
...@@ -458,13 +418,9 @@ export default function cameraSessionZoomRatioTest() { ...@@ -458,13 +418,9 @@ export default function cameraSessionZoomRatioTest() {
*/ */
await sleep(1); await sleep(1);
await commitCameraSessionConfig(); await mCameraSession.commitConfig();
console.info(TAG + "Entering startCameraSession start session begin"); console.info(TAG + "Entering startCameraSession start session begin");
await mCameraSession.start();
console.info(TAG + "Entering startCameraSession start session end");
/* /*
await mCameraSession.start(async (err) => { await mCameraSession.start(async (err) => {
...@@ -485,6 +441,8 @@ export default function cameraSessionZoomRatioTest() { ...@@ -485,6 +441,8 @@ export default function cameraSessionZoomRatioTest() {
async function stopCameraSession() { async function stopCameraSession() {
console.info(TAG + "Enter stopCameraSession"); console.info(TAG + "Enter stopCameraSession");
mCameraSession.beginConfig();
/* /*
mCameraSession.stop(async (err) => { mCameraSession.stop(async (err) => {
console.info(TAG + "Entering mCameraSession stop callback"); console.info(TAG + "Entering mCameraSession stop callback");
...@@ -498,19 +456,20 @@ export default function cameraSessionZoomRatioTest() { ...@@ -498,19 +456,20 @@ export default function cameraSessionZoomRatioTest() {
await sleep(100); await sleep(100);
*/ */
// await commitCameraSessionConfig();
if (!isEmpty(mCameraInput)) { if (!isEmpty(mCameraInput)) {
console.info(TAG + "Start to removeInput input"); console.info(TAG + "Start to removeInput input");
await mCameraSession.removeInput(mCameraInput); mCameraSession.removeInput(mCameraInput);
} }
if (!isEmpty(mPreviewOutput)) { if (!isEmpty(mPreviewOutput)) {
console.info(TAG + "Start to removeOutput mPreviewOutput"); console.info(TAG + "Start to removeOutput mPreviewOutput");
await mCameraSession.removeOutput(mPreviewOutput); mCameraSession.removeOutput(mPreviewOutput);
} }
if (!isEmpty(mPhotoOutput)) { if (!isEmpty(mPhotoOutput)) {
console.info(TAG + "Start to removeOutput mPhotoOutput"); console.info(TAG + "Start to removeOutput mPhotoOutput");
await mCameraSession.removeOutput(mPhotoOutput); mCameraSession.removeOutput(mPhotoOutput);
} }
/* /*
if (!isEmpty(mVideoOutput)) { if (!isEmpty(mVideoOutput)) {
...@@ -518,6 +477,7 @@ export default function cameraSessionZoomRatioTest() { ...@@ -518,6 +477,7 @@ export default function cameraSessionZoomRatioTest() {
await mCameraSession.removeOutput(mVideoOutput); await mCameraSession.removeOutput(mVideoOutput);
} }
*/ */
await releaseInput(); await releaseInput();
await releaseOutput(); await releaseOutput();
...@@ -533,9 +493,9 @@ export default function cameraSessionZoomRatioTest() { ...@@ -533,9 +493,9 @@ export default function cameraSessionZoomRatioTest() {
sleep(100); sleep(100);
await getPhotoReceiverSurface(); await getPhotoReceiverSurface();
await getVideoReceiveSurface(); await getVideoReceiveSurface();
await getCameraManagerInstance(); getCameraManagerInstance();
await getCameraSupportDevicesArray(); getCameraSupportDevicesArray();
await createCameraSessionInstance(); createCameraSessionInstance();
console.info('Device type = ' + deviceInfo.deviceType); console.info('Device type = ' + deviceInfo.deviceType);
...@@ -582,7 +542,7 @@ export default function cameraSessionZoomRatioTest() { ...@@ -582,7 +542,7 @@ export default function cameraSessionZoomRatioTest() {
await startCameraSession(i); await startCameraSession(i);
try { try {
let zoomRatioRange = await mCameraSession.getZoomRatioRange(); let zoomRatioRange = mCameraSession.getZoomRatioRange();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_PROMISE_0100 finish"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_PROMISE_0100 finish");
if (zoomRatioRange.length > 0) { if (zoomRatioRange.length > 0) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_PROMISE_0100 PASSED with ZoomRatioRange length is: " + zoomRatioRange.length); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_PROMISE_0100 PASSED with ZoomRatioRange length is: " + zoomRatioRange.length);
...@@ -598,8 +558,6 @@ export default function cameraSessionZoomRatioTest() { ...@@ -598,8 +558,6 @@ export default function cameraSessionZoomRatioTest() {
catch { catch {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_CALLBACK_0100 PASSED"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_CALLBACK_0100 PASSED");
} }
await sleep(100);
await stopCameraSession(); await stopCameraSession();
...@@ -635,12 +593,11 @@ export default function cameraSessionZoomRatioTest() { ...@@ -635,12 +593,11 @@ export default function cameraSessionZoomRatioTest() {
if (!isEmpty(mZoomRatioRangeArray[i])) { if (!isEmpty(mZoomRatioRangeArray[i])) {
await startCameraSession(i); await startCameraSession(i);
await mCameraSession.setZoomRatio(mZoomRatioRangeArray[i][0]); mCameraSession.setZoomRatio(mZoomRatioRangeArray[i][0]);
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0100 finish"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0100 finish");
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0100 PASSED with ZoomRatio is: " + mZoomRatioRangeArray[i][0]); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0100 PASSED with ZoomRatio is: " + mZoomRatioRangeArray[i][0]);
await sleep(500);
let zoomRatio = await mCameraSession.getZoomRatio(); let zoomRatio = mCameraSession.getZoomRatio();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0100 finish"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0100 finish");
if (zoomRatio == mZoomRatioRangeArray[i][0]) { if (zoomRatio == mZoomRatioRangeArray[i][0]) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0100 PASSED with ZoomRatio is: " + zoomRatio); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0100 PASSED with ZoomRatio is: " + zoomRatio);
...@@ -648,7 +605,6 @@ export default function cameraSessionZoomRatioTest() { ...@@ -648,7 +605,6 @@ export default function cameraSessionZoomRatioTest() {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0100 FAILED with ZoomRatio is: " + zoomRatio); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0100 FAILED with ZoomRatio is: " + zoomRatio);
expect().assertFail(); expect().assertFail();
} }
await sleep(500);
await stopCameraSession(); await stopCameraSession();
} }
...@@ -684,12 +640,11 @@ export default function cameraSessionZoomRatioTest() { ...@@ -684,12 +640,11 @@ export default function cameraSessionZoomRatioTest() {
if (!isEmpty(mZoomRatioRangeArray[i])) { if (!isEmpty(mZoomRatioRangeArray[i])) {
await startCameraSession(i); await startCameraSession(i);
await mCameraSession.setZoomRatio((mZoomRatioMaxArray[i] + 1)); mCameraSession.setZoomRatio((mZoomRatioMaxArray[i] + 1));
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0101 finish"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0101 finish");
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0101 PASSED with ZoomRatio is: " + (mZoomRatioMaxArray[i] + 1)); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0101 PASSED with ZoomRatio is: " + (mZoomRatioMaxArray[i] + 1));
await sleep(500);
let zoomRatio = await mCameraSession.getZoomRatio(); let zoomRatio = mCameraSession.getZoomRatio();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0101 finish"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0101 finish");
if (zoomRatio != (mZoomRatioMaxArray[i] + 1)) { if (zoomRatio != (mZoomRatioMaxArray[i] + 1)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0101 PASSED with ZoomRatio is: " + zoomRatio); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0101 PASSED with ZoomRatio is: " + zoomRatio);
...@@ -697,7 +652,6 @@ export default function cameraSessionZoomRatioTest() { ...@@ -697,7 +652,6 @@ export default function cameraSessionZoomRatioTest() {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0101 FAILED with ZoomRatio is: " + zoomRatio); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0101 FAILED with ZoomRatio is: " + zoomRatio);
expect().assertFail(); expect().assertFail();
} }
await sleep(500);
await stopCameraSession(); await stopCameraSession();
} }
...@@ -734,12 +688,11 @@ export default function cameraSessionZoomRatioTest() { ...@@ -734,12 +688,11 @@ export default function cameraSessionZoomRatioTest() {
if (!isEmpty(mZoomRatioRangeArray[i])) { if (!isEmpty(mZoomRatioRangeArray[i])) {
await startCameraSession(i); await startCameraSession(i);
await mCameraSession.setZoomRatio((mZoomRatioMaxArray[i] + 0.1)); mCameraSession.setZoomRatio((mZoomRatioMaxArray[i] + 0.1));
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0102 finish"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0102 finish");
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0102 PASSED with ZoomRatio is: " + (mZoomRatioMaxArray[i] + 0.1)); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0102 PASSED with ZoomRatio is: " + (mZoomRatioMaxArray[i] + 0.1));
await sleep(500);
let zoomRatio = await mCameraSession.getZoomRatio(); let zoomRatio = mCameraSession.getZoomRatio();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0102 finish"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0102 finish");
if (zoomRatio != (mZoomRatioMaxArray[i] + 0.1)) { if (zoomRatio != (mZoomRatioMaxArray[i] + 0.1)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0102 PASSED with ZoomRatio is: " + zoomRatio); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0102 PASSED with ZoomRatio is: " + zoomRatio);
...@@ -747,7 +700,6 @@ export default function cameraSessionZoomRatioTest() { ...@@ -747,7 +700,6 @@ export default function cameraSessionZoomRatioTest() {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0102 FAILED with ZoomRatio is: " + zoomRatio); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0102 FAILED with ZoomRatio is: " + zoomRatio);
expect().assertFail(); expect().assertFail();
} }
await sleep(500);
await stopCameraSession(); await stopCameraSession();
} }
...@@ -784,12 +736,11 @@ export default function cameraSessionZoomRatioTest() { ...@@ -784,12 +736,11 @@ export default function cameraSessionZoomRatioTest() {
if (!isEmpty(mZoomRatioRangeArray[i])) { if (!isEmpty(mZoomRatioRangeArray[i])) {
await startCameraSession(i); await startCameraSession(i);
await mCameraSession.setZoomRatio((mZoomRatioMinArray[i] - 1)); mCameraSession.setZoomRatio((mZoomRatioMinArray[i] - 1));
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0103 finish"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0103 finish");
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0103 PASSED with ZoomRatio is: " + (mZoomRatioMaxArray[i] - 1)); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0103 PASSED with ZoomRatio is: " + (mZoomRatioMaxArray[i] - 1));
await sleep(500);
let zoomRatio = await mCameraSession.getZoomRatio(); let zoomRatio = mCameraSession.getZoomRatio();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0103 finish"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0103 finish");
if (zoomRatio != (mZoomRatioMinArray[i] - 1)) { if (zoomRatio != (mZoomRatioMinArray[i] - 1)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0103 PASSED with ZoomRatio is: " + zoomRatio); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0103 PASSED with ZoomRatio is: " + zoomRatio);
...@@ -797,7 +748,6 @@ export default function cameraSessionZoomRatioTest() { ...@@ -797,7 +748,6 @@ export default function cameraSessionZoomRatioTest() {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0103 FAILED with ZoomRatio is: " + zoomRatio); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0103 FAILED with ZoomRatio is: " + zoomRatio);
expect().assertFail(); expect().assertFail();
} }
await sleep(500);
await stopCameraSession(); await stopCameraSession();
} }
...@@ -834,12 +784,11 @@ export default function cameraSessionZoomRatioTest() { ...@@ -834,12 +784,11 @@ export default function cameraSessionZoomRatioTest() {
if (!isEmpty(mZoomRatioRangeArray[i])) { if (!isEmpty(mZoomRatioRangeArray[i])) {
await startCameraSession(i); await startCameraSession(i);
await mCameraSession.setZoomRatio((mZoomRatioMinArray[i] - 0.1)); mCameraSession.setZoomRatio((mZoomRatioMinArray[i] - 0.1));
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0104 finish"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0104 finish");
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0104 PASSED with ZoomRatio is: " + (mZoomRatioMaxArray[i] - 0.1)); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0104 PASSED with ZoomRatio is: " + (mZoomRatioMaxArray[i] - 0.1));
await sleep(500);
let zoomRatio = await mCameraSession.getZoomRatio(); let zoomRatio = mCameraSession.getZoomRatio();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0104 finish"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0104 finish");
if (zoomRatio != (mZoomRatioMinArray[i] - 0.1)) { if (zoomRatio != (mZoomRatioMinArray[i] - 0.1)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0104 PASSED with ZoomRatio is: " + zoomRatio); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0104 PASSED with ZoomRatio is: " + zoomRatio);
...@@ -847,7 +796,6 @@ export default function cameraSessionZoomRatioTest() { ...@@ -847,7 +796,6 @@ export default function cameraSessionZoomRatioTest() {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0104 FAILED with ZoomRatio is: " + zoomRatio); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0104 FAILED with ZoomRatio is: " + zoomRatio);
expect().assertFail(); expect().assertFail();
} }
await sleep(500);
await stopCameraSession(); await stopCameraSession();
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册