Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
5f072cb8
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
5f072cb8
编写于
10月 31, 2022
作者:
O
openharmony_ci
提交者:
Gitee
10月 31, 2022
浏览文件
操作
浏览文件
下载
差异文件
!6251 【媒体子系统】camera新增属性覆盖
Merge pull request !6251 from liuxueqi/monthly_20221018
上级
07c8862f
a8ed1434
变更
11
展开全部
隐藏空白更改
内联
并排
Showing
11 changed file
with
1898 addition
and
304 deletion
+1898
-304
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/Camera.test.ets
...js_standard/src/main/ets/MainAbility/test/Camera.test.ets
+2
-0
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraEnumTest.test.ets
...ard/src/main/ets/MainAbility/test/CameraEnumTest.test.ets
+416
-0
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraInputTest.test.ets
...rd/src/main/ets/MainAbility/test/CameraInputTest.test.ets
+555
-177
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitOutput.test.ets
...src/main/ets/MainAbility/test/CameraJSUnitOutput.test.ets
+537
-11
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraManagerTest.test.ets
.../src/main/ets/MainAbility/test/CameraManagerTest.test.ets
+225
-26
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionBaseTest.test.ets
.../main/ets/MainAbility/test/CameraSessionBaseTest.test.ets
+143
-70
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionExposureTest.test.ets
...n/ets/MainAbility/test/CameraSessionExposureTest.test.ets
+4
-4
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionFlashTest.test.ets
...main/ets/MainAbility/test/CameraSessionFlashTest.test.ets
+4
-4
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionFocusTest.test.ets
...main/ets/MainAbility/test/CameraSessionFocusTest.test.ets
+4
-4
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionVideoStabilizationTest.test.ets
...Ability/test/CameraSessionVideoStabilizationTest.test.ets
+4
-4
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionZoomRatioTest.test.ets
.../ets/MainAbility/test/CameraSessionZoomRatioTest.test.ets
+4
-4
未找到文件。
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/Camera.test.ets
浏览文件 @
5f072cb8
...
...
@@ -23,6 +23,7 @@ import cameraSessionVideoStabilizationTest from './CameraSessionVideoStabilizati
import cameraSessionBaseTest from './CameraSessionBaseTest.test.ets'
import cameraInputTest from './CameraInputTest.test.ets'
import cameraManagerTest from './CameraManagerTest.test.ets'
import cameraEnumTest from './CameraEnumTest.test.ets'
let TAG = 'CameraModuleTest: '
...
...
@@ -39,4 +40,5 @@ export default function cameraKit(surfaceId: any) {
cameraSessionVideoStabilizationTest(surfaceId)
cameraSessionBaseTest(surfaceId)
cameraManagerTest(surfaceId)
cameraEnumTest(surfaceId)
}
\ No newline at end of file
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraEnumTest.test.ets
0 → 100644
浏览文件 @
5f072cb8
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import camera from '@ohos.multimedia.camera';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index';
const TAG = "CameraEnumTest: ";
export default function cameraEnumTest(surfaceId: any) {
function isEmpty(data) {
if (data == null || data == undefined) {
return true;
}
return false;
}
describe('CameraEnumTest', function () {
console.info(TAG + '----------CameraEnumTest--------------');
beforeAll(async function () {
console.info('beforeAll case');
})
beforeEach(function () {
console.info('beforeEach case');
})
afterEach(async function () {
console.info('afterEach case');
})
afterAll(function () {
console.info('afterAll case');
})
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_ENUM_CAMERASTATUS_0100
* @tc.name : Camera CameraStatus Eunm
* @tc.desc : Camera CameraStatus Eunm
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_MULTIMEDIA_CAMERA_ENUM_CAMERASTATUS_0100', 2, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_ENUM_CAMERASTATUS_0100--------------");
expect(camera.CameraStatus.CAMERA_STATUS_APPEAR == 0).assertTrue();
expect(camera.CameraStatus.CAMERA_STATUS_DISAPPEAR == 1).assertTrue();
expect(camera.CameraStatus.CAMERA_STATUS_AVAILABLE == 2).assertTrue();
expect(camera.CameraStatus.CAMERA_STATUS_UNAVAILABLE == 3).assertTrue();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ENUM_CAMERASTATUS_0100 ends here");
done();
})
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_ENUM_CAMERAPOSITION_0100
* @tc.name : Camera CameraPosition Eunm
* @tc.desc : Camera CameraPosition Eunm
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_MULTIMEDIA_CAMERA_ENUM_CAMERAPOSITION_0100', 2, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_ENUM_CAMERAPOSITION_0100--------------");
expect(camera.CameraPosition.CAMERA_POSITION_UNSPECIFIED == 0).assertTrue();
expect(camera.CameraPosition.CAMERA_POSITION_BACK == 1).assertTrue();
expect(camera.CameraPosition.CAMERA_POSITION_FRONT == 2).assertTrue();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ENUM_CAMERAPOSITION_0100 ends here");
done();
})
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_ENUM_CAMERATYPE_0100
* @tc.name : Camera CameraType Eunm
* @tc.desc : Camera CameraType Eunm
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
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_WIDE_ANGLE == 1).assertTrue();
expect(camera.CameraType.CAMERA_TYPE_ULTRA_WIDE == 2).assertTrue();
expect(camera.CameraType.CAMERA_TYPE_TELEPHOTO == 3).assertTrue();
expect(camera.CameraType.CAMERA_TYPE_TRUE_DEPTH == 4).assertTrue();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ENUM_CAMERATYPE_0100 ends here");
done();
})
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_ENUM_CONNECTIONTYPE_0100
* @tc.name : Camera ConnectionType Eunm
* @tc.desc : Camera ConnectionType Eunm
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_MULTIMEDIA_CAMERA_ENUM_CONNECTIONTYPE_0100', 2, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_ENUM_CONNECTIONTYPE_0100--------------");
expect(camera.ConnectionType.CAMERA_CONNECTION_BUILT_IN == 0).assertTrue();
expect(camera.ConnectionType.CAMERA_CONNECTION_USB_PLUGIN == 1).assertTrue();
expect(camera.ConnectionType.CAMERA_CONNECTION_REMOTE == 2).assertTrue();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ENUM_CONNECTIONTYPE_0100 ends here");
done();
})
/**
* @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
* @tc.desc : Camera CameraFormat Eunm
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_MULTIMEDIA_CAMERA_ENUM_CAMERAFORMAT_0100', 2, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_ENUM_CAMERAFORMAT_0100--------------");
expect(camera.CameraFormat.CAMERA_FORMAT_RGBA_8888 == 3).assertTrue();
expect(camera.CameraFormat.CAMERA_FORMAT_YUV_420_SP == 1003).assertTrue();
expect(camera.CameraFormat.CAMERA_FORMAT_JPEG == 2000).assertTrue();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ENUM_CAMERAFORMAT_0100 ends here");
done();
})
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_ENUM_FLASHMODE_0100
* @tc.name : Camera FlashMode Eunm
* @tc.desc : Camera FlashMode Eunm
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_MULTIMEDIA_CAMERA_ENUM_FLASHMODE_0100', 2, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_ENUM_FLASHMODE_0100--------------");
expect(camera.FlashMode.FLASH_MODE_CLOSE == 0).assertTrue();
expect(camera.FlashMode.FLASH_MODE_OPEN == 1).assertTrue();
expect(camera.FlashMode.FLASH_MODE_AUTO == 2).assertTrue();
expect(camera.FlashMode.FLASH_MODE_ALWAYS_OPEN == 3).assertTrue();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ENUM_FLASHMODE_0100 ends here");
done();
})
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_ENUM_EXPOSUREMODE_0100
* @tc.name : Camera ExposureMode Eunm
* @tc.desc : CameraExposureMode Eunm
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_MULTIMEDIA_CAMERA_ENUM_EXPOSUREMODE_0100', 2, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_ENUM_EXPOSUREMODE_0100--------------");
expect(camera.ExposureMode.EXPOSURE_MODE_LOCKED == 0).assertTrue();
expect(camera.ExposureMode.EXPOSURE_MODE_AUTO == 1).assertTrue();
expect(camera.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO == 2).assertTrue();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ENUM_EXPOSUREMODE_0100 ends here");
done();
})
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_ENUM_FOCUSMODE_0100
* @tc.name : Camera FocusMode Eunm
* @tc.desc : Camera FocusMode Eunm
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_MULTIMEDIA_CAMERA_ENUM_FOCUSMODE_0100', 2, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_ENUM_FOCUSMODE_0100--------------");
expect(camera.FocusMode.FOCUS_MODE_MANUAL == 0).assertTrue();
expect(camera.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO == 1).assertTrue();
expect(camera.FocusMode.FOCUS_MODE_AUTO == 2).assertTrue();
expect(camera.FocusMode.FOCUS_MODE_LOCKED == 3).assertTrue();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ENUM_FOCUSMODE_0100 ends here");
done();
})
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_ENUM_FOCUSSTATE_0100
* @tc.name : Camera FocusState Eunm
* @tc.desc : Camera FocusState Eunm
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_MULTIMEDIA_CAMERA_ENUM_FOCUSSTATE_0100', 2, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_ENUM_FOCUSSTATE_0100--------------");
expect(camera.FocusState.FOCUS_STATE_SCAN == 0).assertTrue();
expect(camera.FocusState.FOCUS_STATE_FOCUSED == 1).assertTrue();
expect(camera.FocusState.FOCUS_STATE_UNFOCUSED == 2).assertTrue();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ENUM_FOCUSSTATE_0100 ends here");
done();
})
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_ENUM_VIDEOSTABILIZATIONMODE_0100
* @tc.name : Camera VideoStabilizationMode Eunm
* @tc.desc : Camera VideoStabilizationMode Eunm
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_MULTIMEDIA_CAMERA_ENUM_VIDEOSTABILIZATIONMODE_0100', 2, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_ENUM_VIDEOSTABILIZATIONMODE_0100--------------");
expect(camera.VideoStabilizationMode.OFF == 0).assertTrue();
expect(camera.VideoStabilizationMode.LOW == 1).assertTrue();
expect(camera.VideoStabilizationMode.MIDDLE == 2).assertTrue();
expect(camera.VideoStabilizationMode.HIGH == 3).assertTrue();
expect(camera.VideoStabilizationMode.AUTO == 4).assertTrue();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ENUM_VIDEOSTABILIZATIONMODE_0100 ends here");
done();
})
/**
* @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
* @tc.desc : Camera ImageRotation Eunm
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_MULTIMEDIA_CAMERA_ENUM_IMAGEROTATION_0100', 2, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_ENUM_IMAGEROTATION_0100--------------");
expect(camera.ImageRotation.ROTATION_0 == 0).assertTrue();
expect(camera.ImageRotation.ROTATION_90 == 90).assertTrue();
expect(camera.ImageRotation.ROTATION_180 == 180).assertTrue();
expect(camera.ImageRotation.ROTATION_270 == 270).assertTrue();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ENUM_IMAGEROTATION_0100 ends here");
done();
})
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_ENUM_QUALITYLEVEL_0100
* @tc.name : Camera QualityLevel Eunm
* @tc.desc : Camera QualityLevel Eunm
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_MULTIMEDIA_CAMERA_ENUM_QUALITYLEVEL_0100', 2, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_ENUM_QUALITYLEVEL_0100--------------");
expect(camera.QualityLevel.QUALITY_LEVEL_HIGH == 0).assertTrue();
expect(camera.QualityLevel.QUALITY_LEVEL_MEDIUM == 1).assertTrue();
expect(camera.QualityLevel.QUALITY_LEVEL_LOW == 2).assertTrue();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ENUM_QUALITYLEVEL_0100 ends here");
done();
})
/**
* @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
* @tc.desc : Camera MetadataObjectType Eunm
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_MULTIMEDIA_CAMERA_ENUM_METADATAOBJECTTYPE_0100', 2, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_ENUM_METADATAOBJECTTYPE_0100--------------");
expect(camera.MetadataObjectType.FACE_DETECTION == 0).assertTrue();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ENUM_METADATAOBJECTTYPE_0100 ends here");
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
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraInputTest.test.ets
浏览文件 @
5f072cb8
此差异已折叠。
点击以展开。
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitOutput.test.ets
浏览文件 @
5f072cb8
此差异已折叠。
点击以展开。
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraManagerTest.test.ets
浏览文件 @
5f072cb8
...
...
@@ -26,14 +26,18 @@ const TAG = "CameraUnitTest: ";
// Define global variables
let
mCameraManager
;
let
mPhotoSurfaceId
;
let
mCameraDevicesArray
;
let
mVideoSurface
;
let
mPhotoSurface
;
let
mVideoRecorder
;
let
m
FdPath
;
let
m
VideoSurface
;
let
mFileAsset
;
let
mFdPath
;
let
mFdNumber
;
// CAMERA-0 letiables
let
mCameraNum
;
let
mVideoProfileCfg
=
{
audioBitrate
:
48000
,
audioChannels
:
2
,
...
...
@@ -67,8 +71,8 @@ export default function cameraManagerTest(surfaceId: any) {
console
.
log
(
TAG
+
'before receiver check'
)
if
(
receiver
!==
undefined
)
{
console
.
log
(
TAG
+
'Receiver is ok'
)
mPhotoSurface
Id
=
await
receiver
.
getReceivingSurfaceId
()
console
.
log
(
TAG
+
'Received id: '
+
JSON
.
stringify
(
mPhotoSurface
Id
))
mPhotoSurface
=
await
receiver
.
getReceivingSurfaceId
()
console
.
log
(
TAG
+
'Received id: '
+
JSON
.
stringify
(
mPhotoSurface
))
}
else
{
console
.
log
(
TAG
+
'Receiver is not ok'
)
}
...
...
@@ -168,9 +172,44 @@ export default function cameraManagerTest(surfaceId: any) {
console
.
info
(
TAG
+
"getCameraManager FAILED"
);
return
false
;
}
await
sleep
(
500
);
console
.
info
(
'Exit getCameraManagerInstance'
);
return
true
;
}
async
function
getCameraSupportDevicesArray
()
{
console
.
info
(
'Enter getCameraSupportDevicesArray'
);
mCameraDevicesArray
=
await
mCameraManager
.
getSupportedCameras
();
/*
mCameraManager.getSupportedCameras(async (err, data) => {
console.info(TAG + "Entering getCameraSupportDevicesArray callback");
if (!err) {
if (data != null || data != undefined) {
mCameraDevicesArray = data;
console.info(TAG + "Entering getCameraSupportDevicesArray PASSED with CameraDevicesArray is: " + data);
} else {
console.info(TAG + "Entering getCameraSupportDevicesArray FAILED with CameraDevicesArray is: " + data);
}
} else {
console.info(TAG + "Entering getCameraSupportDevicesArray FAILED : " + err.message);
}
})
await sleep(3000);
*/
if
(
isEmpty
(
mCameraDevicesArray
))
{
console
.
info
(
TAG
+
"getSupportedCameras FAILED"
);
return
false
;
}
//mCameraNum = 1;
mCameraNum
=
mCameraDevicesArray
.
length
;
console
.
info
(
TAG
+
"getCameraSupportDevicesArray is: "
+
mCameraNum
);
console
.
info
(
'Exit getCameraSupportDevicesArray'
);
return
true
;
}
...
...
@@ -286,6 +325,7 @@ describe('CameraManagerTest', function () {
await
getCameraManagerInstance
();
await
getImageReceiverSurfaceId
();
await
getVideoReceiveSurface
();
await
getCameraSupportDevicesArray
();
console
.
info
(
'beforeAll case'
);
})
...
...
@@ -324,7 +364,6 @@ describe('CameraManagerTest', function () {
}
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAMANAGER_CALLBACK_0100 ends here"
);
await
sleep
(
1000
);
done
();
})
await
sleep
(
1000
);
done
();
...
...
@@ -733,6 +772,70 @@ describe('CameraManagerTest', function () {
done
();
})
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_BY_POSITION_AND_TYPE_CALLBACK_0100
* @tc.name : Create camerainput from camera-0 cameraposition back & cameratype unspecified async api
* @tc.desc : Create camerainput from camera-0 cameraposition back & cameratype unspecified async api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_BY_POSITION_AND_TYPE_CALLBACK_0100'
,
2
,
async
function
(
done
)
{
console
.
info
(
"--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_BY_POSITION_AND_TYPE_CALLBACK_0100--------------"
);
if
(
isEmpty
(
mCameraManager
))
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_BY_POSITION_AND_TYPE_CALLBACK_0100 cameraManager == null || undefined"
)
expect
()
.
assertFail
();
}
else
{
let
camerasArray
=
mCameraDevicesArray
;
for
(
let
i
=
0
;
i
<
camerasArray
.
length
;
i
++
)
{
mCameraManager
.
createCameraInput
(
camerasArray
[
i
]
.
cameraPosition
,
camerasArray
[
i
]
.
cameraType
,
async
(
err
,
data
)
=>
{
if
(
!
err
)
{
if
(
isEmpty
(
data
))
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_BY_POSITION_AND_TYPE_CALLBACK_0100 data == null || undefined"
)
expect
()
.
assertFail
();
}
else
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_BY_POSITION_AND_TYPE_CALLBACK_0100 success"
);
}
}
else
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_BY_POSITION_AND_TYPE_CALLBACK_0100 FAILED: "
+
err
.
message
);
expect
()
.
assertFail
();
}
})
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 camera: "
+
camerasArray
[
i
]
.
cameraId
);
}
}
await
sleep
(
1000
);
done
();
})
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_BY_POSITION_AND_TYPE_PROMISE_0100
* @tc.name : Create camerainput from camera-0 cameraposition back & cameratype unspecified promise api
* @tc.desc : Create camerainput from camera-0 cameraposition back & cameratype unspecified promise api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_BY_POSITION_AND_TYPE_PROMISE_0100'
,
2
,
async
function
(
done
)
{
console
.
info
(
"--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_BY_POSITION_AND_TYPE_PROMISE_0100--------------"
);
if
(
isEmpty
(
mCameraManager
))
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_BY_POSITION_AND_TYPE_PROMISE_0100 cameraManager == null || undefined"
)
expect
()
.
assertFail
();
}
else
{
let
camerasArray
=
mCameraDevicesArray
;
for
(
let
i
=
0
;
i
<
camerasArray
.
length
;
i
++
)
{
let
cameraInputPromiseByType
=
await
mCameraManager
.
createCameraInput
(
camerasArray
[
i
]
.
cameraPosition
,
camerasArray
[
i
]
.
cameraType
);
if
(
isEmpty
(
cameraInputPromiseByType
))
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_BY_POSITION_AND_TYPE_PROMISE_0100 cameraInputPromiseByType == null || undefined"
)
expect
()
.
assertFail
();
}
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_BY_POSITION_AND_TYPE_PROMISE_0100 camera: "
+
camerasArray
[
i
]
.
cameraId
);
}
}
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_BY_POSITION_AND_TYPE_PROMISE_0100 ends here"
);
await
sleep
(
1000
);
done
();
})
/*CREATE CAMERAOUTPUT*/
/**
...
...
@@ -763,8 +866,7 @@ describe('CameraManagerTest', function () {
expect
()
.
assertFail
();
}
})
await
sleep
(
10
);
done
();
await
sleep
(
100
);
}
}
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PREVIEW_OUTPUT_CALLBACK_0100 PASS"
);
...
...
@@ -802,8 +904,7 @@ describe('CameraManagerTest', function () {
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PREVIEW_OUTPUT_PROMISE_0100 previewOutputPromise == null || undefined"
)
expect
()
.
assertFail
();
}
await
sleep
(
10
);
done
();
await
sleep
(
100
);
}
}
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PREVIEW_OUTPUT_PROMISE_0100 PASS"
);
...
...
@@ -836,14 +937,13 @@ describe('CameraManagerTest', function () {
expect
()
.
assertFail
();
}
for
(
let
j
=
0
;
j
<
photoProfilesArray
.
length
;
j
++
)
{
mCameraManager
.
createPhotoOutput
(
photoProfilesArray
[
j
],
mPhotoSurface
Id
,
async
(
err
,
data
)
=>
{
mCameraManager
.
createPhotoOutput
(
photoProfilesArray
[
j
],
mPhotoSurface
,
async
(
err
,
data
)
=>
{
if
(
isEmpty
(
data
))
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PHOTO_OUTPUT_CALLBACK_0100 data == null || undefined"
)
expect
()
.
assertFail
();
}
})
await
sleep
(
10
);
done
();
await
sleep
(
100
);
}
}
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PHOTO_OUTPUT_CALLBACK_0100 PASS"
);
...
...
@@ -876,13 +976,12 @@ describe('CameraManagerTest', function () {
expect
()
.
assertFail
();
}
for
(
let
j
=
0
;
j
<
photoProfilesArray
.
length
;
j
++
)
{
let
photoOutputPromise
=
await
mCameraManager
.
createPhotoOutput
(
photoProfilesArray
[
j
],
mPhotoSurface
Id
);
let
photoOutputPromise
=
await
mCameraManager
.
createPhotoOutput
(
photoProfilesArray
[
j
],
mPhotoSurface
);
if
(
isEmpty
(
photoOutputPromise
))
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PHOTO_OUTPUT_PROMISE_0100 photoOutputPromise == null || undefined"
)
expect
()
.
assertFail
();
}
await
sleep
(
10
);
done
();
await
sleep
(
100
);
}
}
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PHOTO_OUTPUT_PROMISE_0100 PASS"
);
...
...
@@ -901,6 +1000,7 @@ describe('CameraManagerTest', function () {
it
(
'SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_CALLBACK_0100'
,
2
,
async
function
(
done
)
{
console
.
info
(
"--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_CALLBACK_0100--------------"
);
let
camerasArray
=
mCameraDevicesArray
;
let
createVideoOutputFlag
;
for
(
let
i
=
0
;
i
<
camerasArray
.
length
;
i
++
)
{
let
cameraOutputCap
=
await
getSupportedOutputCapabilityInPromise
(
camerasArray
[
i
]);
console
.
info
(
"SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_CALLBACK_0100 camera:"
+
camerasArray
[
i
]
.
cameraId
);
...
...
@@ -914,15 +1014,29 @@ describe('CameraManagerTest', function () {
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_CALLBACK_0100 videoProfilesArray == null || undefined"
)
expect
()
.
assertFail
();
}
createVideoOutputFlag
=
false
;
for
(
let
j
=
0
;
j
<
videoProfilesArray
.
length
;
j
++
)
{
mCameraManager
.
createVideoOutput
(
videoProfilesArray
[
j
],
mVideoSurface
,
async
(
err
,
data
)
=>
{
if
(
isEmpty
(
data
))
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_CALLBACK_0100 data == null || undefined"
)
if
(
!
err
)
{
if
(
isEmpty
(
data
))
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_CALLBACK_0100 data == null || undefined"
);
expect
()
.
assertFail
();
}
else
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_CALLBACK_0100 data = "
+
data
);
createVideoOutputFlag
=
true
;
}
}
else
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_CALLBACK_0100 failed, err = "
+
err
.
message
);
expect
()
.
assertFail
();
}
})
await
sleep
(
10
);
done
();
await
sleep
(
100
);
if
(
createVideoOutputFlag
==
true
)
{
break
;
}
}
}
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_CALLBACK_0100 PASS"
);
...
...
@@ -959,9 +1073,11 @@ describe('CameraManagerTest', function () {
if
(
isEmpty
(
videoOutputPromise
))
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_PROMISE_0100 videoOutputPromise == null || undefined"
)
expect
()
.
assertFail
();
}
else
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_CALLBACK_0100 videoOutputPromise = "
+
videoOutputPromise
);
break
;
}
await
sleep
(
10
);
done
();
await
sleep
(
100
);
}
}
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_PROMISE_0100 PASS"
);
...
...
@@ -970,7 +1086,92 @@ describe('CameraManagerTest', function () {
})
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_MANAGER_CREATE_CAPTURE_SESSION_CALLBACK_0100
* @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_CALLBACK_0100
* @tc.name : Create camerainput from camera-0 cameraposition front & cameratype unspecified async api
* @tc.desc : Create camerainput from camera-0 cameraposition front & cameratype unspecified async api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_CALLBACK_0100'
,
2
,
async
function
(
done
)
{
console
.
info
(
"--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_CALLBACK_0100--------------"
);
let
camerasArray
=
mCameraDevicesArray
;
for
(
let
i
=
0
;
i
<
camerasArray
.
length
;
i
++
)
{
let
cameraOutputCap
=
await
getSupportedOutputCapabilityInPromise
(
camerasArray
[
i
]);
console
.
info
(
"SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_CALLBACK_0100 camera:"
+
camerasArray
[
i
]
.
cameraId
);
if
(
isEmpty
(
cameraOutputCap
))
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_CALLBACK_0100 cameraOutputCap == null || undefined"
)
expect
()
.
assertFail
();
}
let
metadataObjectTypeArray
=
cameraOutputCap
.
supportedMetadataObjectTypes
;
if
(
!
isEmpty
(
metadataObjectTypeArray
))
{
mCameraManager
.
createMetadataOutput
(
metadataObjectTypeArray
,
async
(
err
,
data
)
=>
{
if
(
!
err
)
{
if
(
isEmpty
(
data
))
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_CALLBACK_0100 data == null || undefined"
)
expect
()
.
assertFail
();
}
else
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_CALLBACK_0100 data = "
+
data
)
}
}
else
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_CALLBACK_0100 err = "
+
err
.
message
)
expect
()
.
assertFail
();
}
})
await
sleep
(
100
);
}
else
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_CALLBACK_0100 metadataObjectTypeArray == null || undefined"
)
}
await
sleep
(
1000
);
}
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_CALLBACK_0100 PASS"
);
await
sleep
(
1000
);
done
();
})
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_PROMISE_0100
* @tc.name : Create camerainput from camera-0 cameraposition front & cameratype unspecified async api
* @tc.desc : Create camerainput from camera-0 cameraposition front & cameratype unspecified async api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_PROMISE_0100'
,
2
,
async
function
(
done
)
{
console
.
info
(
"--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_PROMISE_0100--------------"
);
let
camerasArray
=
mCameraDevicesArray
;
for
(
let
i
=
0
;
i
<
camerasArray
.
length
;
i
++
)
{
let
cameraOutputCap
=
await
getSupportedOutputCapabilityInPromise
(
camerasArray
[
i
]);
console
.
info
(
"SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_PROMISE_0100 camera:"
+
camerasArray
[
i
]
.
cameraId
);
if
(
isEmpty
(
cameraOutputCap
))
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_PROMISE_0100 cameraOutputCap == null || undefined"
)
expect
()
.
assertFail
();
}
let
metadataObjectTypeArray
=
cameraOutputCap
.
supportedMetadataObjectTypes
;
if
(
!
isEmpty
(
metadataObjectTypeArray
))
{
let
metadataOutputPromise
=
await
mCameraManager
.
createMetadataOutput
(
metadataObjectTypeArray
);
if
(
isEmpty
(
metadataOutputPromise
))
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_PROMISE_0100 metadataOutputPromise == null || undefined"
)
expect
()
.
assertFail
();
}
else
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_PROMISE_0100 metadataOutputPromise = "
+
metadataOutputPromise
)
}
await
sleep
(
100
);
}
else
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_PROMISE_0100 metadataObjectTypeArray == null || undefined"
)
}
}
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_PROMISE_0100 PASS"
);
await
sleep
(
1000
);
done
();
})
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100
* @tc.name : Create CaptureSession instance api
* @tc.desc : Create CaptureSession instance api
* @tc.size : MEDIUM
...
...
@@ -996,7 +1197,6 @@ describe('CameraManagerTest', function () {
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_MANAGER_CREATE_CAPTURE_SESSION_CALLBACK_0100 ends here"
);
}
await
sleep
(
1000
);
done
();
})
await
sleep
(
1000
);
await
cameraSession
.
release
();
...
...
@@ -1052,7 +1252,6 @@ describe('CameraManagerTest', function () {
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 FAILED: "
+
err
.
message
);
}
await
sleep
(
1000
);
done
();
})
}
await
sleep
(
1000
);
...
...
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionBaseTest.test.ets
浏览文件 @
5f072cb8
...
...
@@ -32,7 +32,7 @@ let mCameraManager;
let
mCameraDevicesArray
;
let
mCameraSession
;
let
mPhot
e
Surface
;
let
mPhot
o
Surface
;
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'
)
mPhot
e
Surface
=
await
receiver
.
getReceivingSurfaceId
()
console
.
log
(
TAG
+
'Photo received id: '
+
JSON
.
stringify
(
mPhot
e
Surface
))
mPhot
o
Surface
=
await
receiver
.
getReceivingSurfaceId
()
console
.
log
(
TAG
+
'Photo received id: '
+
JSON
.
stringify
(
mPhot
o
Surface
))
}
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
],
mPhot
e
Surface
);
mPhotoOutput
=
await
mCameraManager
.
createPhotoOutput
(
cameraOutputCap
.
photoProfiles
[
i
],
mPhot
o
Surface
);
if
(
!
isEmpty
(
mPhotoOutput
))
{
break
;
}
...
...
@@ -503,9 +502,11 @@ export default function cameraSessionTest(surfaceId: any) {
await mCameraSession.addOutput(mVideoOutput);
}
*/
await
sleep
(
1
);
await
sleep
(
1
00
);
await
commitCameraSessionConfig
();
await
sleep
(
100
);
/*
await mCameraSession.start(async (err) => {
...
...
@@ -902,6 +903,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
...
...
@@ -1415,6 +1514,22 @@ export default function cameraSessionTest(surfaceId: any) {
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0100 start for camera["
+
i
+
"]"
);
await
startCameraSession
(
i
);
let
focusModeSupportedFlag
=
await
mCameraSession
.
isFocusModeSupported
(
cameraObj
.
FocusMode
.
FOCUS_MODE_AUTO
);
if
(
focusModeSupportedFlag
==
false
)
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0100 skip camera["
+
i
+
"], for FOCUS_MODE_AUTO"
);
await
beginCameraSessionConfig
();
await
stopCameraSession
();
continue
;
}
focusModeSupportedFlag
=
await
mCameraSession
.
isFocusModeSupported
(
cameraObj
.
FocusMode
.
FOCUS_MODE_CONTINUOUS_AUTO
);
if
(
focusModeSupportedFlag
==
false
)
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0100 skip camera["
+
i
+
"], for FOCUS_MODE_CONTINUOUS_AUTO"
);
await
beginCameraSessionConfig
();
await
stopCameraSession
();
continue
;
}
mCameraSession
.
on
(
'focusStateChange'
,
async
(
err
,
data
)
=>
{
if
(
!
err
)
{
...
...
@@ -1429,16 +1544,31 @@ export default function cameraSessionTest(surfaceId: any) {
}
await
sleep
(
1
);
})
await
mCameraSession
.
start
();
await
beginCameraSessionConfig
();
mCameraSession
.
setFocusMode
(
cameraObj
.
FocusMode
.
FOCUS_MODE_AUTO
);
await
commitCameraSessionConfig
();
await
sleep
(
1000
);
await
beginCameraSessionConfig
();
await
sleep
(
3000
);
mCameraSession
.
setFocusMode
(
cameraObj
.
FocusMode
.
FOCUS_MODE_CONTINUOUS_AUTO
);
await
commitCameraSessionConfig
();
await
sleep
(
1000
);
if
(
nfyFlag
==
false
)
{
//expect().assertFail();
//console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0100 FAILED without any nofity!");
}
await
mCameraSession
.
stop
();
await
beginCameraSessionConfig
();
await
stopCameraSession
();
...
...
@@ -1452,8 +1582,8 @@ export default function cameraSessionTest(surfaceId: any) {
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0101
* @tc.name : camera status callback on CaptureSession async api for e
xposureStateChange
* @tc.desc : camera status callback on CaptureSession async api for e
xposureStateChange
* @tc.name : camera status callback on CaptureSession async api for e
rror
* @tc.desc : camera status callback on CaptureSession async api for e
rror
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
...
...
@@ -1469,11 +1599,11 @@ export default function cameraSessionTest(surfaceId: any) {
for
(
let
i
=
0
;
i
<
mCameraNum
;
i
++
)
{
let
nfyFlag
=
false
;
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0101 start for camera["
+
i
+
"]"
);
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0101 start for camera["
+
i
+
"]"
);
await
startCameraSession
(
i
);
mCameraSession
.
on
(
'e
xposureStateChange
'
,
async
(
err
,
data
)
=>
{
mCameraSession
.
on
(
'e
rror
'
,
async
(
err
,
data
)
=>
{
if
(
!
err
)
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0101 callback"
);
if
(
data
!=
null
||
data
!=
undefined
)
{
...
...
@@ -1487,15 +1617,13 @@ export default function cameraSessionTest(surfaceId: any) {
await
sleep
(
1
);
})
mCameraSession
.
setExposureMode
(
cameraObj
.
ExposureMode
.
EXPOSURE_MODE_AUTO
);
await
sleep
(
3000
);
if
(
nfyFlag
==
false
)
{
//expect().assertFail();
//console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0101 FAILED without any nofity!");
}
await
beginCameraSessionConfig
();
await
stopCameraSession
();
...
...
@@ -1507,61 +1635,6 @@ export default function cameraSessionTest(surfaceId: any) {
}
})
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0102
* @tc.name : camera status callback on CaptureSession async api for error
* @tc.desc : camera status callback on CaptureSession async api for error
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0102'
,
2
,
async
function
(
done
)
{
console
.
info
(
"--------------SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0102--------------"
);
if
(
mCameraNum
==
0
)
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0102 FAILED with NoCamera"
);
expect
()
.
assertFail
();
done
();
}
else
{
for
(
let
i
=
0
;
i
<
mCameraNum
;
i
++
)
{
let
nfyFlag
=
false
;
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0102 start for camera["
+
i
+
"]"
);
await
startCameraSession
(
i
);
mCameraSession
.
on
(
'error'
,
async
(
err
,
data
)
=>
{
if
(
!
err
)
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0102 callback"
);
if
(
data
!=
null
||
data
!=
undefined
)
{
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0102 PASSED: "
+
data
);
nfyFlag
=
true
;
}
}
else
{
expect
()
.
assertFail
();
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0102 FAILED: "
+
err
.
message
);
}
await
sleep
(
1
);
})
await
sleep
(
3000
);
if
(
nfyFlag
==
false
)
{
//expect().assertFail();
//console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0102 FAILED without any nofity!");
}
await
beginCameraSessionConfig
();
await
stopCameraSession
();
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0102 end for camera["
+
i
+
"]"
);
}
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0102 ends here"
);
done
();
}
})
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_RELEASE_CALLBACK_0100
* @tc.name : Check capture session release with callback or not for preview
...
...
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionExposureTest.test.ets
浏览文件 @
5f072cb8
...
...
@@ -32,7 +32,7 @@ let mCameraManager;
let
mCameraDevicesArray
;
let
mCameraSession
;
let
mPhot
e
Surface
;
let
mPhot
o
Surface
;
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'
)
mPhot
e
Surface
=
await
receiver
.
getReceivingSurfaceId
()
console
.
log
(
TAG
+
'Photo received id: '
+
JSON
.
stringify
(
mPhot
e
Surface
))
mPhot
o
Surface
=
await
receiver
.
getReceivingSurfaceId
()
console
.
log
(
TAG
+
'Photo received id: '
+
JSON
.
stringify
(
mPhot
o
Surface
))
}
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
],
mPhot
e
Surface
);
mPhotoOutput
=
await
mCameraManager
.
createPhotoOutput
(
cameraOutputCap
.
photoProfiles
[
i
],
mPhot
o
Surface
);
if
(
!
isEmpty
(
mPhotoOutput
))
{
break
;
}
...
...
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionFlashTest.test.ets
浏览文件 @
5f072cb8
...
...
@@ -32,7 +32,7 @@ let mCameraManager;
let
mCameraDevicesArray
;
let
mCameraSession
;
let
mPhot
e
Surface
;
let
mPhot
o
Surface
;
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'
)
mPhot
e
Surface
=
await
receiver
.
getReceivingSurfaceId
()
console
.
log
(
TAG
+
'Photo received id: '
+
JSON
.
stringify
(
mPhot
e
Surface
))
mPhot
o
Surface
=
await
receiver
.
getReceivingSurfaceId
()
console
.
log
(
TAG
+
'Photo received id: '
+
JSON
.
stringify
(
mPhot
o
Surface
))
}
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
],
mPhot
e
Surface
);
mPhotoOutput
=
await
mCameraManager
.
createPhotoOutput
(
cameraOutputCap
.
photoProfiles
[
i
],
mPhot
o
Surface
);
if
(
!
isEmpty
(
mPhotoOutput
))
{
break
;
}
...
...
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionFocusTest.test.ets
浏览文件 @
5f072cb8
...
...
@@ -32,7 +32,7 @@ let mCameraManager;
let
mCameraDevicesArray
;
let
mCameraSession
;
let
mPhot
e
Surface
;
let
mPhot
o
Surface
;
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'
)
mPhot
e
Surface
=
await
receiver
.
getReceivingSurfaceId
()
console
.
log
(
TAG
+
'Photo received id: '
+
JSON
.
stringify
(
mPhot
e
Surface
))
mPhot
o
Surface
=
await
receiver
.
getReceivingSurfaceId
()
console
.
log
(
TAG
+
'Photo received id: '
+
JSON
.
stringify
(
mPhot
o
Surface
))
}
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
],
mPhot
e
Surface
);
mPhotoOutput
=
await
mCameraManager
.
createPhotoOutput
(
cameraOutputCap
.
photoProfiles
[
i
],
mPhot
o
Surface
);
if
(
!
isEmpty
(
mPhotoOutput
))
{
break
;
}
...
...
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionVideoStabilizationTest.test.ets
浏览文件 @
5f072cb8
...
...
@@ -32,7 +32,7 @@ let mCameraManager;
let
mCameraDevicesArray
;
let
mCameraSession
;
let
mPhot
e
Surface
;
let
mPhot
o
Surface
;
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'
)
mPhot
e
Surface
=
await
receiver
.
getReceivingSurfaceId
()
console
.
log
(
TAG
+
'Photo received id: '
+
JSON
.
stringify
(
mPhot
e
Surface
))
mPhot
o
Surface
=
await
receiver
.
getReceivingSurfaceId
()
console
.
log
(
TAG
+
'Photo received id: '
+
JSON
.
stringify
(
mPhot
o
Surface
))
}
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
],
mPhot
e
Surface
);
mPhotoOutput
=
await
mCameraManager
.
createPhotoOutput
(
cameraOutputCap
.
photoProfiles
[
i
],
mPhot
o
Surface
);
if
(
!
isEmpty
(
mPhotoOutput
))
{
break
;
}
...
...
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionZoomRatioTest.test.ets
浏览文件 @
5f072cb8
...
...
@@ -32,7 +32,7 @@ let mCameraManager;
let
mCameraDevicesArray
;
let
mCameraSession
;
let
mPhot
e
Surface
;
let
mPhot
o
Surface
;
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'
)
mPhot
e
Surface
=
await
receiver
.
getReceivingSurfaceId
()
console
.
log
(
TAG
+
'Photo received id: '
+
JSON
.
stringify
(
mPhot
e
Surface
))
mPhot
o
Surface
=
await
receiver
.
getReceivingSurfaceId
()
console
.
log
(
TAG
+
'Photo received id: '
+
JSON
.
stringify
(
mPhot
o
Surface
))
}
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
],
mPhot
e
Surface
);
mPhotoOutput
=
await
mCameraManager
.
createPhotoOutput
(
cameraOutputCap
.
photoProfiles
[
i
],
mPhot
o
Surface
);
if
(
!
isEmpty
(
mPhotoOutput
))
{
break
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录