提交 ffd8c9b8 编写于 作者: Y yygxr

add xts case for camera_framework

Signed-off-by: Nyygxr <wuhao30@huawei.com>
上级 09130093
......@@ -32,7 +32,7 @@ let mCameraManager;
let mCameraDevicesArray;
let mCameraSession;
let mPhoteSurface;
let mPhotoSurface;
let mVideoRecorder;
let mVideoSurface;
let mFileAsset;
......@@ -183,8 +183,8 @@ export default function cameraSessionTest(surfaceId: any) {
console.log(TAG + 'before receiver check')
if (receiver !== undefined) {
console.log(TAG + 'Photo receiver is created successfully')
mPhoteSurface = await receiver.getReceivingSurfaceId()
console.log(TAG + 'Photo received id: ' + JSON.stringify(mPhoteSurface))
mPhotoSurface = await receiver.getReceivingSurfaceId()
console.log(TAG + 'Photo received id: ' + JSON.stringify(mPhotoSurface))
} else {
console.log(TAG + 'Photo receiver is created failed')
}
......@@ -409,12 +409,11 @@ export default function cameraSessionTest(surfaceId: any) {
console.info(TAG + "createPreviewOutput: " + mPreviewOutput);
}
if (!isEmpty(cameraOutputCap.photoProfiles)) {
if (!isEmpty(cameraOutputCap.photoProfiles)) {
console.info(TAG + "cameraOutputCap.photoProfiles.length: " + cameraOutputCap.photoProfiles.length);
for (let i = 0; i < cameraOutputCap.photoProfiles.length; i++) {
mPhotoOutput = await mCameraManager.createPhotoOutput(cameraOutputCap.photoProfiles[i], mPhoteSurface);
mPhotoOutput = await mCameraManager.createPhotoOutput(cameraOutputCap.photoProfiles[i], mPhotoSurface);
if (!isEmpty(mPhotoOutput)) {
break;
}
......@@ -902,6 +901,104 @@ export default function cameraSessionTest(surfaceId: any) {
}
})
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100
* @tc.name : Check capture session start/stop with callback or not
* @tc.desc : Check capture session start/stop with callback or not
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100', 0, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100--------------");
if (mCameraNum == 0) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 FAILED with NoCamera");
expect().assertFail();
done();
}
else {
for (let i = 0; i < mCameraNum; i++) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 start for camera[" + i + "]");
await startCameraSession(i);
mCameraSession.start(async (err) => {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 start callback");
if (!err) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 start PASSED");
} else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 start FAILED : " + err.message);
expect().assertFail();
}
})
await sleep(2000);
mCameraSession.stop(async (err) => {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 stop callback");
if (!err) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 stop PASSED");
} else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 stop FAILED : " + err.message);
expect().assertFail();
}
})
await sleep(500);
await beginCameraSessionConfig();
await stopCameraSession();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 end for camera[" + i + "]");
}
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 ends here");
done();
}
})
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_PROMISE_0100
* @tc.name : Check capture session start/stop output with promise or not
* @tc.desc : Check capture session start/stop output with promise or not
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_PROMISE_0100', 0, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_PROMISE_0100--------------");
if (mCameraNum == 0) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_PROMISE_0100 FAILED with NoCamera");
expect().assertFail();
done();
}
else {
for (let i = 0; i < mCameraNum; i++) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_PROMISE_0100 start for camera[" + i + "]");
await startCameraSession(i);
await mCameraSession.start();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_PROMISE_0100 start PASSED");
await sleep(2000);
await mCameraSession.stop();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_PROMISE_0100 stop PASSED");
await sleep(500);
await beginCameraSessionConfig();
await stopCameraSession();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_PROMISE_0100 end for camera[" + i + "]");
}
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_PROMISE_0100 ends here");
done();
}
})
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_INPUT_CALLBACK_0100
* @tc.name : Check capture session add/remove input with callback or not
......
......@@ -32,7 +32,7 @@ let mCameraManager;
let mCameraDevicesArray;
let mCameraSession;
let mPhoteSurface;
let mPhotoSurface;
let mVideoRecorder;
let mVideoSurface;
let mFileAsset;
......@@ -238,8 +238,8 @@ export default function cameraSessionExposureTest(surfaceId: any) {
console.log(TAG + 'before receiver check')
if (receiver !== undefined) {
console.log(TAG + 'Photo receiver is created successfully')
mPhoteSurface = await receiver.getReceivingSurfaceId()
console.log(TAG + 'Photo received id: ' + JSON.stringify(mPhoteSurface))
mPhotoSurface = await receiver.getReceivingSurfaceId()
console.log(TAG + 'Photo received id: ' + JSON.stringify(mPhotoSurface))
} else {
console.log(TAG + 'Photo receiver is created failed')
}
......@@ -473,7 +473,7 @@ export default function cameraSessionExposureTest(surfaceId: any) {
console.info(TAG + "cameraOutputCap.photoProfiles.length: " + cameraOutputCap.photoProfiles.length);
for (let i = 0; i < cameraOutputCap.photoProfiles.length; i++) {
mPhotoOutput = await mCameraManager.createPhotoOutput(cameraOutputCap.photoProfiles[i], mPhoteSurface);
mPhotoOutput = await mCameraManager.createPhotoOutput(cameraOutputCap.photoProfiles[i], mPhotoSurface);
if (!isEmpty(mPhotoOutput)) {
break;
}
......@@ -1126,11 +1126,11 @@ export default function cameraSessionExposureTest(surfaceId: any) {
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_0102', 2, async function (done) {
it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_0101', 2, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_0102--------------");
if (mCameraNum == 0) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_0102 FAILED with NoCamera");
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_0101 FAILED with NoCamera");
expect().assertFail();
done();
} else {
......
......@@ -32,7 +32,7 @@ let mCameraManager;
let mCameraDevicesArray;
let mCameraSession;
let mPhoteSurface;
let mPhotoSurface;
let mVideoRecorder;
let mVideoSurface;
let mFileAsset;
......@@ -189,8 +189,8 @@ export default function cameraSessionFlashTest(surfaceId: any) {
console.log(TAG + 'before receiver check')
if (receiver !== undefined) {
console.log(TAG + 'Photo receiver is created successfully')
mPhoteSurface = await receiver.getReceivingSurfaceId()
console.log(TAG + 'Photo received id: ' + JSON.stringify(mPhoteSurface))
mPhotoSurface = await receiver.getReceivingSurfaceId()
console.log(TAG + 'Photo received id: ' + JSON.stringify(mPhotoSurface))
} else {
console.log(TAG + 'Photo receiver is created failed')
}
......@@ -424,7 +424,7 @@ export default function cameraSessionFlashTest(surfaceId: any) {
console.info(TAG + "cameraOutputCap.photoProfiles.length: " + cameraOutputCap.photoProfiles.length);
for (let i = 0; i < cameraOutputCap.photoProfiles.length; i++) {
mPhotoOutput = await mCameraManager.createPhotoOutput(cameraOutputCap.photoProfiles[i], mPhoteSurface);
mPhotoOutput = await mCameraManager.createPhotoOutput(cameraOutputCap.photoProfiles[i], mPhotoSurface);
if (!isEmpty(mPhotoOutput)) {
break;
}
......
......@@ -32,7 +32,7 @@ let mCameraManager;
let mCameraDevicesArray;
let mCameraSession;
let mPhoteSurface;
let mPhotoSurface;
let mVideoRecorder;
let mVideoSurface;
let mFileAsset;
......@@ -235,8 +235,8 @@ export default function cameraSessionFocusTest(surfaceId: any) {
console.log(TAG + 'before receiver check')
if (receiver !== undefined) {
console.log(TAG + 'Photo receiver is created successfully')
mPhoteSurface = await receiver.getReceivingSurfaceId()
console.log(TAG + 'Photo received id: ' + JSON.stringify(mPhoteSurface))
mPhotoSurface = await receiver.getReceivingSurfaceId()
console.log(TAG + 'Photo received id: ' + JSON.stringify(mPhotoSurface))
} else {
console.log(TAG + 'Photo receiver is created failed')
}
......@@ -469,7 +469,7 @@ export default function cameraSessionFocusTest(surfaceId: any) {
console.info(TAG + "cameraOutputCap.photoProfiles.length: " + cameraOutputCap.photoProfiles.length);
for (let i = 0; i < cameraOutputCap.photoProfiles.length; i++) {
mPhotoOutput = await mCameraManager.createPhotoOutput(cameraOutputCap.photoProfiles[i], mPhoteSurface);
mPhotoOutput = await mCameraManager.createPhotoOutput(cameraOutputCap.photoProfiles[i], mPhotoSurface);
if (!isEmpty(mPhotoOutput)) {
break;
}
......
......@@ -32,7 +32,7 @@ let mCameraManager;
let mCameraDevicesArray;
let mCameraSession;
let mPhoteSurface;
let mPhotoSurface;
let mVideoRecorder;
let mVideoSurface;
let mFileAsset;
......@@ -188,8 +188,8 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) {
console.log(TAG + 'before receiver check')
if (receiver !== undefined) {
console.log(TAG + 'Photo receiver is created successfully')
mPhoteSurface = await receiver.getReceivingSurfaceId()
console.log(TAG + 'Photo received id: ' + JSON.stringify(mPhoteSurface))
mPhotoSurface = await receiver.getReceivingSurfaceId()
console.log(TAG + 'Photo received id: ' + JSON.stringify(mPhotoSurface))
} else {
console.log(TAG + 'Photo receiver is created failed')
}
......@@ -422,7 +422,7 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) {
console.info(TAG + "cameraOutputCap.photoProfiles.length: " + cameraOutputCap.photoProfiles.length);
for (let i = 0; i < cameraOutputCap.photoProfiles.length; i++) {
mPhotoOutput = await mCameraManager.createPhotoOutput(cameraOutputCap.photoProfiles[i], mPhoteSurface);
mPhotoOutput = await mCameraManager.createPhotoOutput(cameraOutputCap.photoProfiles[i], mPhotoSurface);
if (!isEmpty(mPhotoOutput)) {
break;
}
......
......@@ -32,7 +32,7 @@ let mCameraManager;
let mCameraDevicesArray;
let mCameraSession;
let mPhoteSurface;
let mPhotoSurface;
let mVideoRecorder;
let mVideoSurface;
let mFileAsset;
......@@ -190,8 +190,8 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) {
console.log(TAG + 'before receiver check')
if (receiver !== undefined) {
console.log(TAG + 'Photo receiver is created successfully')
mPhoteSurface = await receiver.getReceivingSurfaceId()
console.log(TAG + 'Photo received id: ' + JSON.stringify(mPhoteSurface))
mPhotoSurface = await receiver.getReceivingSurfaceId()
console.log(TAG + 'Photo received id: ' + JSON.stringify(mPhotoSurface))
} else {
console.log(TAG + 'Photo receiver is created failed')
}
......@@ -426,7 +426,7 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) {
console.info(TAG + "cameraOutputCap.photoProfiles.length: " + cameraOutputCap.photoProfiles.length);
for (let i = 0; i < cameraOutputCap.photoProfiles.length; i++) {
mPhotoOutput = await mCameraManager.createPhotoOutput(cameraOutputCap.photoProfiles[i], mPhoteSurface);
mPhotoOutput = await mCameraManager.createPhotoOutput(cameraOutputCap.photoProfiles[i], mPhotoSurface);
if (!isEmpty(mPhotoOutput)) {
break;
}
......@@ -710,7 +710,7 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) {
}
}
catch {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_PROMISE_0100 PASSED");
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_CALLBACK_0100 PASSED");
}
await sleep(1000);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册