提交 69e2f725 编写于 作者: 1 18742514821

<camera>

Signed-off-by: N18742514821 <xumengshu@huawei.com>
上级 0830ffc9
...@@ -342,28 +342,28 @@ export default function cameraJSUnitOutput(surfaceId: any) { ...@@ -342,28 +342,28 @@ export default function cameraJSUnitOutput(surfaceId: any) {
/** /**
* @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_OUTPUT_PROMISE_0100
* @tc.name : Create previewOutput instance async api * @tc.name : Create previewOutput instance async api
* @tc.desc : Create previewOutput instance async api * @tc.desc : Create previewOutput instance async api
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 2 * @tc.level : Level 2
*/ */
it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100', 2, async function (done) { it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_OUTPUT_PROMISE_0100', 2, async function (done) {
console.info(TAG + " --------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100--------------"); console.info(TAG + " --------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_OUTPUT_PROMISE_0100--------------");
if (isEmpty(cameraManager)) { if (isEmpty(cameraManager)) {
console.info(TAG + "Entering CREATE_CAMERA_INPUT cameraManager == null || undefined") console.info(TAG + "Entering CREATE_CAMERA_INPUT cameraManager == null || undefined")
expect().assertFail(); expect().assertFail();
} else { } else {
cameraInput = await cameraManager.createCameraInput(cameraDevicesArray[0]); cameraInput = await cameraManager.createCameraInput(cameraDevicesArray[0]);
if (isEmpty(cameraInput)) { if (isEmpty(cameraInput)) {
console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 FAILED"); console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_OUTPUT_PROMISE_0100 FAILED");
} }
cameraInput.open(async (err) => { cameraInput.open(async (err) => {
if (!err) { if (!err) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 open callback"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_OUTPUT_PROMISE_0100 open callback");
} else { } else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 FAILED: " + err.message); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_OUTPUT_PROMISE_0100 FAILED: " + err.message);
} }
await sleep(1000); await sleep(1000);
done(); done();
......
...@@ -293,24 +293,24 @@ describe('CameraManagerTest', function () { ...@@ -293,24 +293,24 @@ describe('CameraManagerTest', function () {
}) })
/** /**
* @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_0100 * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERAMANAGER_CALLBACK_0100
* @tc.name : Create camera manager instance async api * @tc.name : Create camera manager instance async api
* @tc.desc : Create camera manager instance async api * @tc.desc : Create camera manager instance async api
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 2 * @tc.level : Level 2
*/ */
it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100', 2, async function (done) { it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAMANAGER_CALLBACK_0100', 2, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_0100--------------"); console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAMANAGER_CALLBACK_0100--------------");
cameraObj.getCameraManager(null, async (err, data) => { cameraObj.getCameraManager(null, async (err, data) => {
if (!err) { if (!err) {
expect(isEmpty(data)).assertFalse(); expect(isEmpty(data)).assertFalse();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_0100 success"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAMANAGER_CALLBACK_0100 success");
} else { } else {
expect().assertFail(); expect().assertFail();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_0100 FAILED: " + err.message); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAMANAGER_CALLBACK_0100 FAILED: " + err.message);
} }
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_0100 ends here"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAMANAGER_CALLBACK_0100 ends here");
await sleep(1000); await sleep(1000);
done(); done();
}) })
...@@ -336,57 +336,57 @@ describe('CameraManagerTest', function () { ...@@ -336,57 +336,57 @@ describe('CameraManagerTest', function () {
}) })
/** /**
* @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100
* @tc.name : Get camera from cameramanager to get array of camera async api * @tc.name : Get camera from cameramanager to get array of camera async api
* @tc.desc : Get camera from cameramanager to get array of camera async api * @tc.desc : Get camera from cameramanager to get array of camera async api
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 2 * @tc.level : Level 2
*/ */
it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100', 2, async function (done) { it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100', 2, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100--------------"); console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100--------------");
if (isEmpty(mCameraManager)) { if (isEmpty(mCameraManager)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 cameraManager == null || undefined") console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100 cameraManager == null || undefined")
expect().assertFail(); expect().assertFail();
} }
mCameraManager.getSupportedCameras(async (err, data) => { mCameraManager.getSupportedCameras(async (err, data) => {
if (!err) { if (!err) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 success"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100 success");
if (!isEmpty(data)) { if (!isEmpty(data)) {
mCameraDevicesArray = data; mCameraDevicesArray = data;
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 data is " + mCameraDevicesArray.length); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100 data is " + mCameraDevicesArray.length);
if (mCameraDevicesArray.length > 0) { if (mCameraDevicesArray.length > 0) {
for (let i = 0; i < mCameraDevicesArray.length; i++) { for (let i = 0; i < mCameraDevicesArray.length; i++) {
// Get the variables from camera object // Get the variables from camera object
let cameraId = mCameraDevicesArray[i].cameraId; let cameraId = mCameraDevicesArray[i].cameraId;
expect(isEmpty(cameraId)).assertFalse(); expect(isEmpty(cameraId)).assertFalse();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera" + i + "Id: " + cameraId); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100 camera" + i + "Id: " + cameraId);
let cameraPosition = mCameraDevicesArray[i].cameraPosition; let cameraPosition = mCameraDevicesArray[i].cameraPosition;
expect(isEmpty(cameraPosition)).assertFalse(); expect(isEmpty(cameraPosition)).assertFalse();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera" + i + "Position: " + cameraPosition); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100 camera" + i + "Position: " + cameraPosition);
let cameraType = mCameraDevicesArray[i].cameraType; let cameraType = mCameraDevicesArray[i].cameraType;
expect(isEmpty(cameraType)).assertFalse(); expect(isEmpty(cameraType)).assertFalse();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera" + i + "Type: " + cameraType); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100 camera" + i + "Type: " + cameraType);
let connectionType = mCameraDevicesArray[i].connectionType let connectionType = mCameraDevicesArray[i].connectionType
expect(isEmpty(connectionType)).assertFalse(); expect(isEmpty(connectionType)).assertFalse();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 connection" + i + "Type: " + connectionType); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100 connection" + i + "Type: " + connectionType);
} }
expect(true).assertTrue(); expect(true).assertTrue();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 PASSED"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100 PASSED");
} else { } else {
expect().assertFail(); expect().assertFail();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED cameraArray is null || undefined"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100 FAILED cameraArray is null || undefined");
} }
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 ends here"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100 ends here");
await sleep(1000); await sleep(1000);
done(); done();
} else { } else {
expect().assertFail(); expect().assertFail();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED cameraArray is null || undefined"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100 FAILED cameraArray is null || undefined");
} }
} else { } else {
expect().assertFail(); expect().assertFail();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED , err = " + err.message); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100 FAILED , err = " + err.message);
} }
}) })
await sleep(1000); await sleep(1000);
...@@ -958,30 +958,30 @@ describe('CameraManagerTest', function () { ...@@ -958,30 +958,30 @@ describe('CameraManagerTest', function () {
}) })
/** /**
* @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_MANAGER_CALLBACK_0100
* @tc.name : Create CaptureSession instance api * @tc.name : Create CaptureSession instance api
* @tc.desc : Create CaptureSession instance api * @tc.desc : Create CaptureSession instance api
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 2 * @tc.level : Level 2
*/ */
it('SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100', 2, async function (done) { it('SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_MANAGER_CALLBACK_0100', 2, async function (done) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 to operate"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_MANAGER_CALLBACK_0100 to operate");
let cameraSession; let cameraSession;
mCameraManager.createCaptureSession(async (err, data) => { mCameraManager.createCaptureSession(async (err, data) => {
if (!err) { if (!err) {
console.info(TAG + "Entering createCaptureSession success"); console.info(TAG + "Entering createCaptureSession success");
if (isEmpty(data)) { if (isEmpty(data)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 data == null || undefined") console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_MANAGER_CALLBACK_0100 data == null || undefined")
expect().assertFail(); expect().assertFail();
} else { } else {
cameraSession = data; cameraSession = data;
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 PASSED"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_MANAGER_CALLBACK_0100 PASSED");
} }
} else { } else {
expect().assertFail(); expect().assertFail();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 FAILED : " + err.message); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_MANAGER_CALLBACK_0100 FAILED : " + err.message);
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 ends here"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_MANAGER_CALLBACK_0100 ends here");
} }
await sleep(1000); await sleep(1000);
done(); done();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册