未验证 提交 9cf16999 编写于 作者: O openharmony_ci 提交者: Gitee

!7039 xts 修改

Merge pull request !7039 from SongChunPeng/sync
......@@ -96,7 +96,7 @@ export default function cameraEnumTest() {
*/
it('SUB_MULTIMEDIA_CAMERA_ENUM_CAMERATYPE_0100', 2, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_ENUM_CAMERATYPE_0100--------------");
expect(camera.CameraType.CAMERA_TYPE_UNSPECIFIED == 0).assertTrue();
expect(camera.CameraType.CAMERA_TYPE_DEFAULT == 0).assertTrue();
expect(camera.CameraType.CAMERA_TYPE_WIDE_ANGLE == 1).assertTrue();
expect(camera.CameraType.CAMERA_TYPE_ULTRA_WIDE == 2).assertTrue();
expect(camera.CameraType.CAMERA_TYPE_TELEPHOTO == 3).assertTrue();
......@@ -125,28 +125,6 @@ export default function cameraEnumTest() {
})
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_ENUM_CAMERAINPUTERRORCODE_0100
* @tc.name : Camera CameraInputErrorCode Eunm
* @tc.desc : Camera CameraInputErrorCode Eunm
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_MULTIMEDIA_CAMERA_ENUM_CAMERAINPUTERRORCODE_0100', 2, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_ENUM_CAMERAINPUTERRORCODE_0100--------------");
expect(camera.CameraInputErrorCode.ERROR_UNKNOWN == -1).assertTrue();
expect(camera.CameraInputErrorCode.ERROR_NO_PERMISSION == 0).assertTrue();
expect(camera.CameraInputErrorCode.ERROR_DEVICE_PREEMPTED == 1).assertTrue();
expect(camera.CameraInputErrorCode.ERROR_DEVICE_DISCONNECTED == 2).assertTrue();
expect(camera.CameraInputErrorCode.ERROR_DEVICE_IN_USE == 3).assertTrue();
expect(camera.CameraInputErrorCode.ERROR_DRIVER_ERROR == 4).assertTrue();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ENUM_CAMERAINPUTERRORCODE_0100 ends here");
done();
})
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_ENUM_CAMERAFORMAT_0100
* @tc.name : Camera CameraFormat Eunm
......@@ -260,45 +238,6 @@ export default function cameraEnumTest() {
})
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_ENUM_CAPTURESESSIONERRORCODE_0100
* @tc.name : Camera CaptureSessionErrorCode Eunm
* @tc.desc : Camera CaptureSessionErrorCode Eunm
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_MULTIMEDIA_CAMERA_ENUM_CAPTURESESSIONERRORCODE_0100', 2, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_ENUM_CAPTURESESSIONERRORCODE_0100--------------");
expect(camera.CaptureSessionErrorCode.ERROR_UNKNOWN == -1).assertTrue();
expect(camera.CaptureSessionErrorCode.ERROR_INSUFFICIENT_RESOURCES == 0).assertTrue();
expect(camera.CaptureSessionErrorCode.ERROR_TIMEOUT == 1).assertTrue();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ENUM_CAPTURESESSIONERRORCODE_0100 ends here");
done();
})
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_ENUM_PREVIEWOUTPUTERRORCODE_0100
* @tc.name : Camera PreviewOutputErrorCode Eunm
* @tc.desc : Camera PreviewOutputErrorCode Eunm
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_MULTIMEDIA_CAMERA_ENUM_PREVIEWOUTPUTERRORCODE_0100', 2, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_ENUM_PREVIEWOUTPUTERRORCODE_0100--------------");
expect(camera.PreviewOutputErrorCode.ERROR_UNKNOWN == -1).assertTrue();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ENUM_PREVIEWOUTPUTERRORCODE_0100 ends here");
done();
})
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_ENUM_IMAGEROTATION_0100
* @tc.name : Camera ImageRotation Eunm
......@@ -337,48 +276,6 @@ export default function cameraEnumTest() {
})
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_ENUM_PHOTOOUTPUTERRORCODE_0100
* @tc.name : Camera PhotoOutputErrorCode Eunm
* @tc.desc : Camera PhotoOutputErrorCode Eunm
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_MULTIMEDIA_CAMERA_ENUM_PHOTOOUTPUTERRORCODE_0100', 2, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_ENUM_PHOTOOUTPUTERRORCODE_0100--------------");
expect(camera.PhotoOutputErrorCode.ERROR_UNKNOWN == -1).assertTrue();
expect(camera.PhotoOutputErrorCode.ERROR_DRIVER_ERROR == 0).assertTrue();
expect(camera.PhotoOutputErrorCode.ERROR_INSUFFICIENT_RESOURCES == 1).assertTrue();
expect(camera.PhotoOutputErrorCode.ERROR_TIMEOUT == 2).assertTrue();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ENUM_PHOTOOUTPUTERRORCODE_0100 ends here");
done();
})
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_ENUM_VIDEOOUTPUTERRORCODE_0100
* @tc.name : Camera VideoOutputErrorCode Eunm
* @tc.desc : Camera VideoOutputErrorCode Eunm
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_MULTIMEDIA_CAMERA_ENUM_VIDEOOUTPUTERRORCODE_0100', 2, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_ENUM_VIDEOOUTPUTERRORCODE_0100--------------");
expect(camera.VideoOutputErrorCode.ERROR_UNKNOWN == -1).assertTrue();
expect(camera.VideoOutputErrorCode.ERROR_DRIVER_ERROR == 0).assertTrue();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ENUM_VIDEOOUTPUTERRORCODE_0100 ends here");
done();
})
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_ENUM_METADATAOBJECTTYPE_0100
* @tc.name : Camera MetadataObjectType Eunm
......@@ -394,23 +291,5 @@ export default function cameraEnumTest() {
done();
})
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_ENUM_METADATAOUTPUTERRORCODE_0100
* @tc.name : Camera MetadataOutputErrorCode Eunm
* @tc.desc : Camera MetadataOutputErrorCode Eunm
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_MULTIMEDIA_CAMERA_ENUM_METADATAOUTPUTERRORCODE_0100', 2, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_ENUM_METADATAOUTPUTERRORCODE_0100--------------");
expect(camera.MetadataOutputErrorCode.ERROR_UNKNOWN == -1).assertTrue();
expect(camera.MetadataOutputErrorCode.ERROR_INSUFFICIENT_RESOURCES == 0).assertTrue();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ENUM_METADATAOUTPUTERRORCODE_0100 ends here");
done();
})
})
}
\ No newline at end of file
......@@ -121,13 +121,9 @@ export default function CameraInputTest() {
async function beginCameraSessionConfig() {
console.info('Enter beginCameraSessionConfig');
mCameraSession.beginConfig(async (err) => {
if (!err) {
console.info(TAG + "Entering beginConfig PASSED");
} else {
console.info(TAG + "Entering beginConfig FAILED : " + err.message);
}
})
console.info(TAG + "Entering beginConfig start");
mCameraSession.beginConfig();
console.info(TAG + "Entering beginConfig end");
await sleep(30);
......@@ -188,13 +184,7 @@ export default function CameraInputTest() {
return false;
}
mCameraInput = null;
await mCameraManager.createCameraInput(mCameraDevicesArray[idx]).then((result) => {
console.info('createCameraInput success');
mCameraInput = result;
}).catch((err) => {
console.info('createCameraInput failed, err = ' + err.message);
});
mCameraInput = await mCameraManager.createCameraInput(mCameraDevicesArray[idx]);
if (isEmpty(mCameraInput)) {
console.info(TAG + "createCameraInput FAILED");
......@@ -224,7 +214,6 @@ export default function CameraInputTest() {
if (!isEmpty(mCameraInput)) {
await mCameraInput.close();
await mCameraInput.release();
}
console.info('Exit releaseInput');
......@@ -235,14 +224,7 @@ export default function CameraInputTest() {
async function createOutput(idx:any) {
console.info('Enter createOutput');
let cameraOutputCap = null;
await mCameraManager.getSupportedOutputCapability(mCameraDevicesArray[idx]).then((result) => {
console.info('getSupportedOutputCapability success');
cameraOutputCap = result;
}).catch((err) => {
console.info('getSupportedOutputCapability failed, err = ' + err.message);
mPreviewOutput = null;
});
let cameraOutputCap = mCameraManager.getSupportedOutputCapability();
if (!isEmpty(cameraOutputCap)) {
if (!isEmpty(cameraOutputCap.previewProfiles)) {
......@@ -410,130 +392,100 @@ export default function CameraInputTest() {
});
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_CALLBACK_0100
* @tc.name : open/close/release Camera with cameraInput callback api
* @tc.desc : open/close/release Camera with cameraInput callback api
* @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_CALLBACK_0100
* @tc.name : open/close Camera with cameraInput callback api
* @tc.desc : open/close Camera with cameraInput callback api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_CALLBACK_0100', 0, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_CALLBACK_0100--------------");
it('SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_CALLBACK_0100', 0, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_CALLBACK_0100--------------");
if (isEmpty(mCameraManager)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_CALLBACK_0100 cameraManager == null || undefined");
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_CALLBACK_0100 cameraManager == null || undefined");
expect().assertFail();
} else {
let camerasArray = mCameraDevicesArray;
for (let i = 0; i < camerasArray.length; i++) {
let successFlag = false;
console.info(TAG + "Entering createCameraInput with camera: " + camerasArray[i].cameraId);
await mCameraManager.createCameraInput(camerasArray[i]).then(async (cameraInput) => {
expect(isEmpty(cameraInput)).assertFalse();
await cameraInput.open(async (err) => {
if (!err) {
successFlag = true;
console.info(TAG + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_CALLBACK_0100 PASSED open with CameraID :" + camerasArray[i].cameraId);
} else {
successFlag = false;
console.info(TAG + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_CALLBACK_0100 open FAILED: " + err.message);
}
});
await sleep(400);
successFlag = false;
await cameraInput.close(async (err) => {
if (!err) {
successFlag = true;
console.info(TAG + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_CALLBACK_0100 PASSED close with CameraID :" + camerasArray[i].cameraId);
} else {
successFlag = false;
console.info(TAG + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_CALLBACK_0100 close FAILED: " + err.message);
}
});
await sleep(100);
successFlag = false;
await cameraInput.release(async (err) => {
if (!err) {
successFlag = true;
console.info(TAG + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_CALLBACK_0100 PASSED release with CameraID :" + camerasArray[i].cameraId);
} else {
successFlag = false;
console.info(TAG + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_CALLBACK_0100 release FAILED: " + err.message);
}
});
await sleep(100);
expect(successFlag).assertEqual(true);
}).catch((err) => {
expect().assertFail();
console.info(TAG + " Failed To create cameraInput cameraId: " + camerasArray[i].cameraId + +JSON.stringify(err));
let cameraInput = mCameraManager.createCameraInput(camerasArray[i]);
expect(isEmpty(cameraInput)).assertFalse();
await cameraInput.open(async (err) => {
if (!err) {
successFlag = true;
console.info(TAG + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_CALLBACK_0100 PASSED open with CameraID :" + camerasArray[i].cameraId);
} else {
successFlag = false;
console.info(TAG + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_CALLBACK_0100 open FAILED: " + err.message);
}
});
}
await sleep(400);
successFlag = false;
await cameraInput.close(async (err) => {
if (!err) {
successFlag = true;
console.info(TAG + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_CALLBACK_0100 PASSED close with CameraID :" + camerasArray[i].cameraId);
} else {
successFlag = false;
console.info(TAG + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_CALLBACK_0100 close FAILED: " + err.message);
}
});
await sleep(100);
expect(successFlag).assertEqual(true);
}
}
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_CALLBACK_0100 ends here");
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_CALLBACK_0100 ends here");
await sleep(1000);
done();
});
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_PROMISE_0100
* @tc.name : open/close/release Camera with cameraInput promise api
* @tc.desc : open/close/release Camera with cameraInput promise api
* @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_PROMISE_0100
* @tc.name : open/close Camera with cameraInput promise api
* @tc.desc : open/close Camera with cameraInput promise api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_PROMISE_0100', 0, async function (done) {
let functionTag = "SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_PROMISE_0100";
it('SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_PROMISE_0100', 0, async function (done) {
let functionTag = "SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_PROMISE_0100";
console.info(functionTag);
if (isEmpty(mCameraManager)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_PROMISE_0100 cameraManager == null || undefined");
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_PROMISE_0100 cameraManager == null || undefined");
expect().assertFail();
} else {
let camerasArray = mCameraDevicesArray;
for (let i = 0; i < camerasArray.length; i++) {
let successFlag = false;
console.info(TAG + functionTag + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_PROMISE_0100 createCameraInput with camera: " + camerasArray[i].cameraId);
mCameraManager.createCameraInput(camerasArray[i], async (err, cameraInput) => {
if (!err) {
expect(isEmpty(cameraInput)).assertFalse();
console.info(TAG + functionTag + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_PROMISE_0100 cameraInput open with camera: " + camerasArray[i].cameraId);
await cameraInput.open().then(async () => {
successFlag = true;
console.info(TAG + functionTag + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_PROMISE_0100 PASSED open with CameraID :" + camerasArray[i].cameraId);
}).catch((err) => {
successFlag = false;
console.info(TAG + functionTag + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_PROMISE_0100 open FAILED: " + err.message);
});
await sleep(400);
successFlag = false;
await cameraInput.close().then(async () => {
successFlag = true;
console.info(TAG + functionTag + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_PROMISE_0100 PASSED close with CameraID :" + camerasArray[i].cameraId);
}).catch((err) => {
successFlag = false;
console.info(TAG + functionTag + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_PROMISE_0100 close FAILED: " + err.message);
});
await sleep(100);
successFlag = false;
await cameraInput.release().then(async () => {
successFlag = true;
console.info(TAG + functionTag + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_PROMISE_0100 PASSED release with CameraID :" + camerasArray[i].cameraId);
}).catch((err) => {
successFlag = false;
console.info(TAG + functionTag + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_PROMISE_0100 release FAILED: " + err.message);
});
await sleep(100);
expect(successFlag).assertEqual(true);
} else {
expect().assertFail();
console.info(TAG + functionTag + " FAILED: " + err.message);
}
console.info(TAG + functionTag + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_PROMISE_0100 createCameraInput with camera: " + camerasArray[i].cameraId);
let cameraInput = mCameraManager.createCameraInput(camerasArray[i]);
expect(isEmpty(cameraInput)).assertFalse();
console.info(TAG + functionTag + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_PROMISE_0100 cameraInput open with camera: " + camerasArray[i].cameraId);
await cameraInput.open().then(async () => {
successFlag = true;
console.info(TAG + functionTag + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_PROMISE_0100 PASSED open with CameraID :" + camerasArray[i].cameraId);
}).catch((err) => {
successFlag = false;
console.info(TAG + functionTag + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_PROMISE_0100 open FAILED: " + err.message);
});
await sleep(400);
successFlag = false;
await cameraInput.close().then(async () => {
successFlag = true;
console.info(TAG + functionTag + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_PROMISE_0100 PASSED close with CameraID :" + camerasArray[i].cameraId);
}).catch((err) => {
successFlag = false;
console.info(TAG + functionTag + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_PROMISE_0100 close FAILED: " + err.message);
});
await sleep(100);
expect(successFlag).assertEqual(true);
await sleep(600);
}
//await sleep(400 * camerasArray.length);
}
console.info(TAG + functionTag + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_PROMISE_0100 ends here");
console.info(TAG + functionTag + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_PROMISE_0100 ends here");
done();
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册