提交 6ef59106 编写于 作者: Y yygxr

fix camera session and manager test case error

Signed-off-by: Nyygxr <wuhao30@huawei.com>
上级 9c22a462
...@@ -43,7 +43,7 @@ let videoConfig = { ...@@ -43,7 +43,7 @@ let videoConfig = {
audioSourceType: 1, audioSourceType: 1,
videoSourceType: 0, videoSourceType: 0,
profile: videoProfile, profile: videoProfile,
url: 'file:///data/media/01.mp4', url: 'file:///data/media/CameraOutput.mp4',
orientationHint: 0, orientationHint: 0,
location: { latitude: 30, longitude: 130 }, location: { latitude: 30, longitude: 130 },
maxSize: 100, maxSize: 100,
...@@ -115,7 +115,7 @@ export default function cameraJSUnitOutput(surfaceId: any) { ...@@ -115,7 +115,7 @@ export default function cameraJSUnitOutput(surfaceId: any) {
async function getvideosurface() { async function getvideosurface() {
await getFd('02.mp4'); await getFd('CameraOutput.mp4');
videoConfig.url = fdPath; videoConfig.url = fdPath;
media.createVideoRecorder((err, recorder) => { media.createVideoRecorder((err, recorder) => {
console.info(TAG + 'createVideoRecorder called') console.info(TAG + 'createVideoRecorder called')
......
...@@ -873,104 +873,6 @@ export default function cameraSessionTest(surfaceId: any) { ...@@ -873,104 +873,6 @@ 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 (isEmpty(mCameraInputArray)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 FAILED with NoCamera");
expect().assertFail();
done();
}
else {
for (let i = 0; i < mCameraInputArray.length; 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(i);
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 (isEmpty(mCameraInputArray)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_PROMISE_0100 FAILED with NoCamera");
expect().assertFail();
done();
}
else {
for (let i = 0; i < mCameraInputArray.length; 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(i);
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.number : SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_INPUT_CALLBACK_0100
* @tc.name : Check capture session add/remove input with callback or not * @tc.name : Check capture session add/remove input with callback or not
......
...@@ -594,7 +594,7 @@ export default function cameraSessionExposureTest(surfaceId: any) { ...@@ -594,7 +594,7 @@ export default function cameraSessionExposureTest(surfaceId: any) {
sleep(100); sleep(100);
await applyPermission(); await applyPermission();
await getPhotoReceiverSurface(); await getPhotoReceiverSurface();
//await getVideoReceiveSurface(); await getVideoReceiveSurface();
await getCameraManagerInstance(); await getCameraManagerInstance();
await getCameraSupportDevicesArray(); await getCameraSupportDevicesArray();
await createCameraSessionInstance(); await createCameraSessionInstance();
...@@ -618,7 +618,7 @@ export default function cameraSessionExposureTest(surfaceId: any) { ...@@ -618,7 +618,7 @@ export default function cameraSessionExposureTest(surfaceId: any) {
afterAll(function () { afterAll(function () {
releaseInputs(); releaseInputs();
releaseOutputs(); releaseOutputs();
//releaseVideoReceiveSurface(); releaseVideoReceiveSurface();
releaseCameraSessionInstance(); releaseCameraSessionInstance();
sleep(100); sleep(100);
console.info('afterAll case'); console.info('afterAll case');
......
...@@ -545,7 +545,7 @@ export default function cameraSessionFlashTest(surfaceId: any) { ...@@ -545,7 +545,7 @@ export default function cameraSessionFlashTest(surfaceId: any) {
sleep(100); sleep(100);
await applyPermission(); await applyPermission();
await getPhotoReceiverSurface(); await getPhotoReceiverSurface();
//await getVideoReceiveSurface(); await getVideoReceiveSurface();
await mgetCameraManagerInstance(); await mgetCameraManagerInstance();
await getCameraSupportDevicesArray(); await getCameraSupportDevicesArray();
await createCameraSessionInstance(); await createCameraSessionInstance();
...@@ -569,7 +569,7 @@ export default function cameraSessionFlashTest(surfaceId: any) { ...@@ -569,7 +569,7 @@ export default function cameraSessionFlashTest(surfaceId: any) {
afterAll(function () { afterAll(function () {
releaseInputs(); releaseInputs();
releaseOutputs(); releaseOutputs();
//releaseVideoReceiveSurface(); releaseVideoReceiveSurface();
releaseCameraSessionInstance(); releaseCameraSessionInstance();
sleep(100); sleep(100);
console.info('afterAll case'); console.info('afterAll case');
......
...@@ -590,7 +590,7 @@ export default function cameraSessionFocusTest(surfaceId: any) { ...@@ -590,7 +590,7 @@ export default function cameraSessionFocusTest(surfaceId: any) {
sleep(100); sleep(100);
await applyPermission(); await applyPermission();
await getPhotoReceiverSurface(); await getPhotoReceiverSurface();
//await getVideoReceiveSurface(); await getVideoReceiveSurface();
await getCameraManagerInstance(); await getCameraManagerInstance();
await getCameraSupportDevicesArray(); await getCameraSupportDevicesArray();
await createCameraSessionInstance(); await createCameraSessionInstance();
...@@ -614,7 +614,7 @@ export default function cameraSessionFocusTest(surfaceId: any) { ...@@ -614,7 +614,7 @@ export default function cameraSessionFocusTest(surfaceId: any) {
afterAll(function () { afterAll(function () {
releaseInputs(); releaseInputs();
releaseOutputs(); releaseOutputs();
//releaseVideoReceiveSurface(); releaseVideoReceiveSurface();
releaseCameraSessionInstance(); releaseCameraSessionInstance();
sleep(100); sleep(100);
console.info('afterAll case'); console.info('afterAll case');
......
...@@ -543,7 +543,7 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { ...@@ -543,7 +543,7 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) {
sleep(100); sleep(100);
await applyPermission(); await applyPermission();
await getPhotoReceiverSurface(); await getPhotoReceiverSurface();
//await getVideoReceiveSurface(); await getVideoReceiveSurface();
await getCameraManagerInstance(); await getCameraManagerInstance();
await getCameraSupportDevicesArray(); await getCameraSupportDevicesArray();
await createCameraSessionInstance(); await createCameraSessionInstance();
...@@ -567,7 +567,7 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { ...@@ -567,7 +567,7 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) {
afterAll(function () { afterAll(function () {
releaseInputs(); releaseInputs();
releaseOutputs(); releaseOutputs();
//releaseVideoReceiveSurface(); releaseVideoReceiveSurface();
releaseCameraSessionInstance(); releaseCameraSessionInstance();
sleep(100); sleep(100);
console.info('afterAll case'); console.info('afterAll case');
......
...@@ -548,7 +548,7 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) { ...@@ -548,7 +548,7 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) {
await applyPermission(); await applyPermission();
await getPhotoReceiverSurface(); await getPhotoReceiverSurface();
//await getVideoReceiveSurface(); await getVideoReceiveSurface();
await getCameraManagerInstance(); await getCameraManagerInstance();
await getCameraSupportDevicesArray(); await getCameraSupportDevicesArray();
await createCameraSessionInstance(); await createCameraSessionInstance();
...@@ -572,7 +572,7 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) { ...@@ -572,7 +572,7 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) {
afterAll(function () { afterAll(function () {
releaseInputs(); releaseInputs();
releaseOutputs(); releaseOutputs();
//releaseVideoReceiveSurface(); releaseVideoReceiveSurface();
releaseCameraSessionInstance(); releaseCameraSessionInstance();
sleep(100); sleep(100);
console.info('afterAll case'); console.info('afterAll case');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册