Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
7e073cfc
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看板
未验证
提交
7e073cfc
编写于
1月 10, 2023
作者:
O
openharmony_ci
提交者:
Gitee
1月 10, 2023
浏览文件
操作
浏览文件
下载
差异文件
!7139 相机xts同步接口修改
Merge pull request !7139 from SongChunPeng/master
上级
5e6727d2
14fb4dfb
变更
11
展开全部
隐藏空白更改
内联
并排
Showing
11 changed file
with
540 addition
and
1169 deletion
+540
-1169
multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraEnumTest.test.ets
..._standard/entry/src/main/ets/test/CameraEnumTest.test.ets
+25
-1
multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraInputTest.test.ets
...standard/entry/src/main/ets/test/CameraInputTest.test.ets
+22
-33
multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraJSUnitOutput.test.ets
...ndard/entry/src/main/ets/test/CameraJSUnitOutput.test.ets
+7
-19
multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraManagerTest.test.ets
...andard/entry/src/main/ets/test/CameraManagerTest.test.ets
+27
-45
multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionBaseTest.test.ets
...rd/entry/src/main/ets/test/CameraSessionBaseTest.test.ets
+95
-394
multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionExposureTest.test.ets
...ntry/src/main/ets/test/CameraSessionExposureTest.test.ets
+161
-227
multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionFlashTest.test.ets
...d/entry/src/main/ets/test/CameraSessionFlashTest.test.ets
+49
-100
multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionFocusTest.test.ets
...d/entry/src/main/ets/test/CameraSessionFocusTest.test.ets
+68
-155
multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionVideoStabilizationTest.test.ets
...ain/ets/test/CameraSessionVideoStabilizationTest.test.ets
+48
-105
multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionZoomRatioTest.test.ets
...try/src/main/ets/test/CameraSessionZoomRatioTest.test.ets
+38
-90
multimedia/camera/camera_js_standard/signature/openharmony_sx.p7b
...ia/camera/camera_js_standard/signature/openharmony_sx.p7b
+0
-0
未找到文件。
multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraEnumTest.test.ets
浏览文件 @
7e073cfc
...
...
@@ -96,12 +96,12 @@ export default function cameraEnumTest() {
*/
it('SUB_MULTIMEDIA_CAMERA_ENUM_CAMERATYPE_0100', 2, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_ENUM_CAMERATYPE_0100--------------");
console.info("CameraType: "+ JSON.stringify(camera.CameraType));
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();
expect(camera.CameraType.CAMERA_TYPE_TRUE_DEPTH == 4).assertTrue();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ENUM_CAMERATYPE_0100 ends here");
done();
})
...
...
@@ -291,5 +291,29 @@ export default function cameraEnumTest() {
done();
})
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_ENUM_CAMERAERRORCODE_0100
* @tc.name : Camera CameraErrorCode Eunm
* @tc.desc : Camera CameraErrorCode Eunm
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_MULTIMEDIA_CAMERA_ENUM_CAMERAERRORCODE_0100', 2, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_ENUM_CAMERAERRORCODE_0100--------------");
expect(camera.CameraErrorCode.INVALID_ARGUMENT == 7400101).assertTrue();
expect(camera.CameraErrorCode.OPERATION_NOT_ALLOWED == 7400102).assertTrue();
expect(camera.CameraErrorCode.SESSION_NOT_CONFIG == 7400103).assertTrue();
expect(camera.CameraErrorCode.SESSION_NOT_RUNNING == 7400104).assertTrue();
expect(camera.CameraErrorCode.SESSION_CONFIG_LOCKED == 7400105).assertTrue();
expect(camera.CameraErrorCode.DEVICE_SETTING_LOCKED == 7400106).assertTrue();
expect(camera.CameraErrorCode.CONFILICT_CAMERA == 7400107).assertTrue();
expect(camera.CameraErrorCode.DEVICE_DISABLED == 7400108).assertTrue();
expect(camera.CameraErrorCode.SERVICE_FATAL_ERROR == 7400201).assertTrue();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ENUM_CAMERAERRORCODE_0100 ends here");
done();
})
})
}
\ No newline at end of file
multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraInputTest.test.ets
浏览文件 @
7e073cfc
...
...
@@ -69,10 +69,10 @@ export default function CameraInputTest() {
}
}
async
function
getCameraManagerInstance
()
{
function
getCameraManagerInstance
()
{
console
.
info
(
'Enter getCameraManagerInstance'
);
mCameraManager
=
await
cameraObj
.
getCameraManager
(
null
);
mCameraManager
=
cameraObj
.
getCameraManager
(
null
);
if
(
isEmpty
(
mCameraManager
))
{
console
.
info
(
TAG
+
"getCameraManager FAILED"
);
return
false
;
...
...
@@ -83,10 +83,10 @@ export default function CameraInputTest() {
return
true
;
}
async
function
getCameraSupportDevicesArray
()
{
function
getCameraSupportDevicesArray
()
{
console
.
info
(
'Enter getCameraSupportDevicesArray'
);
mCameraDevicesArray
=
await
mCameraManager
.
getSupportedCameras
();
mCameraDevicesArray
=
mCameraManager
.
getSupportedCameras
();
/*
mCameraManager.getSupportedCameras(async (err, data) => {
console.info(TAG + "Entering getCameraSupportDevicesArray callback");
...
...
@@ -118,15 +118,12 @@ export default function CameraInputTest() {
return
true
;
}
async
function
beginCameraSessionConfig
()
{
function
beginCameraSessionConfig
()
{
console
.
info
(
'Enter beginCameraSessionConfig'
);
console
.
info
(
TAG
+
"Entering beginConfig start"
);
mCameraSession
.
beginConfig
();
console
.
info
(
TAG
+
"Entering beginConfig end"
);
await
sleep
(
30
);
console
.
info
(
'Exit beginCameraSessionConfig'
);
return
true
;
...
...
@@ -150,11 +147,11 @@ export default function CameraInputTest() {
return
true
;
}
async
function
createCameraSessionInstance
()
{
function
createCameraSessionInstance
()
{
console
.
info
(
'Enter createCameraSessionInstance'
);
try
{
mCameraSession
=
await
mCameraManager
.
createCaptureSession
();
mCameraSession
=
mCameraManager
.
createCaptureSession
();
}
catch
{
console
.
info
(
'createCaptureSession FAILED'
);
...
...
@@ -165,7 +162,7 @@ export default function CameraInputTest() {
return
false
;
}
await
beginCameraSessionConfig
();
beginCameraSessionConfig
();
console
.
info
(
'Exit createCameraSessionInstance'
);
...
...
@@ -184,23 +181,16 @@ export default function CameraInputTest() {
return
false
;
}
mCameraInput
=
await
mCameraManager
.
createCameraInput
(
mCameraDevicesArray
[
idx
]);
mCameraInput
=
mCameraManager
.
createCameraInput
(
mCameraDevicesArray
[
idx
]);
if
(
isEmpty
(
mCameraInput
))
{
console
.
info
(
TAG
+
"createCameraInput FAILED"
);
return
false
;
}
mCameraInput
.
open
(
async
(
err
)
=>
{
console
.
info
(
TAG
+
"Entering mCameraInput open callback"
);
if
(
!
err
)
{
console
.
info
(
TAG
+
"Entering mCameraInput open PASSED "
);
}
else
{
console
.
info
(
TAG
+
"Entering mCameraInput open FAILED : "
+
err
.
message
);
}
})
await
mCameraInput
.
open
();
await
sleep
(
100
);
sleep
(
100
);
console
.
info
(
idx
+
'th CameraInput is: '
+
mCameraInput
);
...
...
@@ -221,16 +211,16 @@ export default function CameraInputTest() {
return
true
;
}
async
function
createOutput
(
idx
:
any
)
{
function
createOutput
(
idx
:
any
)
{
console
.
info
(
'Enter createOutput'
);
let
cameraOutputCap
=
mCameraManager
.
getSupportedOutputCapability
();
let
cameraOutputCap
=
mCameraManager
.
getSupportedOutputCapability
(
mCameraDevicesArray
[
idx
]
);
if
(
!
isEmpty
(
cameraOutputCap
))
{
if
(
!
isEmpty
(
cameraOutputCap
.
previewProfiles
))
{
console
.
info
(
TAG
+
"cameraOutputCap.previewProfiles.length: "
+
cameraOutputCap
.
previewProfiles
.
length
);
for
(
let
i
=
0
;
i
<
cameraOutputCap
.
previewProfiles
.
length
;
i
++
)
{
mPreviewOutput
=
await
mCameraManager
.
createPreviewOutput
(
cameraOutputCap
.
previewProfiles
[
i
],
globalThis
.
surfaceId
);
mPreviewOutput
=
mCameraManager
.
createPreviewOutput
(
cameraOutputCap
.
previewProfiles
[
i
],
globalThis
.
surfaceId
);
if
(
!
isEmpty
(
mPreviewOutput
))
{
break
;
}
...
...
@@ -253,7 +243,6 @@ export default function CameraInputTest() {
console
.
info
(
'Enter releaseOutput'
);
if
(
!
isEmpty
(
mPreviewOutput
))
{
await
mPreviewOutput
.
stop
();
await
mPreviewOutput
.
release
();
}
...
...
@@ -266,18 +255,18 @@ export default function CameraInputTest() {
console
.
info
(
TAG
+
"Enter startCameraSession"
);
await
createInput
(
idx
);
await
createOutput
(
idx
);
createOutput
(
idx
);
await
sleep
(
1
);
if
(
!
isEmpty
(
mCameraInput
))
{
console
.
info
(
TAG
+
"Start to addInput"
);
await
mCameraSession
.
addInput
(
mCameraInput
);
mCameraSession
.
addInput
(
mCameraInput
);
}
if
(
!
isEmpty
(
mPreviewOutput
))
{
console
.
info
(
TAG
+
"Start to addOutput mPreviewOutput"
);
await
mCameraSession
.
addOutput
(
mPreviewOutput
);
mCameraSession
.
addOutput
(
mPreviewOutput
);
}
await
sleep
(
1
);
...
...
@@ -294,12 +283,12 @@ export default function CameraInputTest() {
if
(
!
isEmpty
(
mCameraInput
))
{
console
.
info
(
TAG
+
"Start to removeInput input"
);
await
mCameraSession
.
removeInput
(
mCameraInput
);
mCameraSession
.
removeInput
(
mCameraInput
);
}
if
(
!
isEmpty
(
mPreviewOutput
))
{
console
.
info
(
TAG
+
"Start to removeOutput mPreviewOutput"
);
await
mCameraSession
.
removeOutput
(
mPreviewOutput
);
mCameraSession
.
removeOutput
(
mPreviewOutput
);
}
await
releaseInput
();
...
...
@@ -316,9 +305,9 @@ export default function CameraInputTest() {
await
getPermission
();
sleep
(
1000
);
await
driveFn
();
await
getCameraManagerInstance
();
await
getCameraSupportDevicesArray
();
await
createCameraSessionInstance
();
getCameraManagerInstance
();
getCameraSupportDevicesArray
();
createCameraSessionInstance
();
console
.
info
(
'beforeAll case'
);
});
beforeEach
(
function
()
{
...
...
multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraJSUnitOutput.test.ets
浏览文件 @
7e073cfc
...
...
@@ -296,7 +296,7 @@ export default function cameraJSUnitOutput() {
console
.
info
(
TAG
+
"Entering CREATE_CAMERA_INPUT cameraManager == null || undefined"
)
expect
()
.
assertFail
();
}
else
{
cameraInput
=
await
cameraManager
.
createCameraInput
(
cameraDevicesArray
[
0
]);
cameraInput
=
cameraManager
.
createCameraInput
(
cameraDevicesArray
[
0
]);
if
(
isEmpty
(
cameraInput
))
{
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 FAILED"
);
}
...
...
@@ -329,7 +329,7 @@ export default function cameraJSUnitOutput() {
expect
()
.
assertFail
();
}
else
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100"
)
let
cameraOutputCap
=
await
getSupportedOutputCapabilityInPromise
(
cameraDevicesArray
[
0
]);
let
cameraOutputCap
=
getSupportedOutputCapabilityInPromise
(
cameraDevicesArray
[
0
]);
let
previewProfilesArray
=
cameraOutputCap
.
previewProfiles
;
if
(
isEmpty
(
previewProfilesArray
))
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100 previewProfilesArray == null || undefined"
)
...
...
@@ -337,7 +337,6 @@ export default function cameraJSUnitOutput() {
}
previewOutput
=
cameraManager
.
createPreviewOutput
(
previewProfilesArray
[
0
],
globalThis
.
surfaceId
);
}
await
sleep
(
1000
);
done
();
})
...
...
@@ -357,19 +356,18 @@ export default function cameraJSUnitOutput() {
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_PROMISE_0100 cameraManager == null || undefined"
)
expect
()
.
assertFail
();
}
else
{
let
cameraOutputCap
=
await
getSupportedOutputCapabilityInPromise
(
cameraDevicesArray
[
0
]);
let
cameraOutputCap
=
getSupportedOutputCapabilityInPromise
(
cameraDevicesArray
[
0
]);
let
photoProfilesArray
=
cameraOutputCap
.
photoProfiles
;
if
(
isEmpty
(
photoProfilesArray
))
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_PROMISE_0100 previewProfilesArray == null || undefined"
)
expect
()
.
assertFalse
();
}
photoOutput
=
await
cameraManager
.
createPhotoOutput
(
photoProfilesArray
[
0
],
surfaceId1
);
photoOutput
=
cameraManager
.
createPhotoOutput
(
photoProfilesArray
[
0
],
surfaceId1
);
if
(
isEmpty
(
photoOutput
))
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_PROMISE_0100 data is empty"
);
expect
()
.
assertFalse
();
}
}
await
sleep
(
1000
);
done
();
})
...
...
@@ -389,7 +387,7 @@ export default function cameraJSUnitOutput() {
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 cameraManager == null || undefined"
)
expect
()
.
assertFail
();
}
else
{
let
cameraOutputCap
=
await
getSupportedOutputCapabilityInPromise
(
cameraDevicesArray
[
0
]);
let
cameraOutputCap
=
getSupportedOutputCapabilityInPromise
(
cameraDevicesArray
[
0
]);
console
.
info
(
"SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 camera:"
+
cameraDevicesArray
[
0
]
.
cameraId
);
expect
(
isEmpty
(
cameraOutputCap
))
.
assertFalse
();
let
videoProfilesArray
=
cameraOutputCap
.
videoProfiles
;
...
...
@@ -397,7 +395,6 @@ export default function cameraJSUnitOutput() {
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 start createVideoOutput"
)
videoOutput
=
cameraManager
.
createVideoOutput
(
videoProfilesArray
[
0
],
videoSurfaceId
);
}
await
sleep
(
1000
);
done
();
})
...
...
@@ -416,7 +413,7 @@ export default function cameraJSUnitOutput() {
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_METADATA_OUTPUT_CALLBACK_0100 cameraManager == null || undefined"
)
expect
()
.
assertFail
();
}
else
{
let
cameraOutputCap
=
await
getSupportedOutputCapabilityInPromise
(
cameraDevicesArray
[
0
]);
let
cameraOutputCap
=
getSupportedOutputCapabilityInPromise
(
cameraDevicesArray
[
0
]);
console
.
info
(
"SUB_MULTIMEDIA_CAMERA_CREATE_METADATA_OUTPUT_CALLBACK_0100 camera:"
+
cameraDevicesArray
[
0
]
.
cameraId
);
expect
(
isEmpty
(
cameraOutputCap
))
.
assertFalse
();
mMetadataObjectTypeArray
=
cameraOutputCap
.
supportedMetadataObjectTypes
;
...
...
@@ -427,7 +424,6 @@ export default function cameraJSUnitOutput() {
metadataOutput
=
cameraManager
.
createMetadataOutput
(
mMetadataObjectTypeArray
);
}
}
await
sleep
(
1000
);
done
();
})
...
...
@@ -450,7 +446,6 @@ export default function cameraJSUnitOutput() {
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100"
)
captureSession
=
cameraManager
.
createCaptureSession
();
}
await
sleep
(
1000
);
done
();
})
...
...
@@ -471,7 +466,6 @@ export default function cameraJSUnitOutput() {
}
else
{
captureSession
.
beginConfig
();
}
await
sleep
(
1000
);
done
();
})
...
...
@@ -493,7 +487,6 @@ export default function cameraJSUnitOutput() {
}
else
{
captureSession
.
addInput
(
cameraInput
)
}
await
sleep
(
1000
);
done
();
})
...
...
@@ -519,7 +512,6 @@ export default function cameraJSUnitOutput() {
}
captureSession
.
addOutput
(
previewOutput
)
}
await
sleep
(
1000
);
done
();
})
...
...
@@ -545,7 +537,6 @@ export default function cameraJSUnitOutput() {
console
.
info
(
TAG
+
"captureSession start add photoOutput"
)
captureSession
.
addOutput
(
photoOutput
)
}
await
sleep
(
1000
);
done
();
})
...
...
@@ -566,7 +557,6 @@ export default function cameraJSUnitOutput() {
}
else
{
captureSession
.
addOutput
(
videoOutput
)
}
await
sleep
(
1000
);
done
();
})
...
...
@@ -588,7 +578,6 @@ export default function cameraJSUnitOutput() {
if
(
!
isEmpty
(
metadataOutput
))
{
captureSession
.
addOutput
(
metadataOutput
)
}
}
await
sleep
(
1000
);
done
();
...
...
@@ -671,8 +660,7 @@ export default function cameraJSUnitOutput() {
it
(
'SUB_MULTIMEDIA_CAMERA_METADATA_OUTPUT_CALLBACK_ON_ERROR_0100'
,
1
,
async
function
(
done
)
{
console
.
info
(
"--------------SUB_MULTIMEDIA_CAMERA_METADATA_OUTPUT_CALLBACK_ON_ERROR_0100--------------"
);
if
(
isEmpty
(
metadataOutput
))
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_METADATA_OUTPUT_CALLBACK_ON_ERROR_0100 metadataOutput == null || undefined"
)
expect
()
.
assertFail
();
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_METADATA_OUTPUT_CALLBACK_ON_ERROR_0100 metadata is not support"
)
}
else
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_METADATA_OUTPUT_CALLBACK_ON_ERROR_0100 to operate"
);
metadataOutput
.
on
(
'error'
,
async
(
err
,
data
)
=>
{
...
...
multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraManagerTest.test.ets
浏览文件 @
7e073cfc
...
...
@@ -161,10 +161,10 @@ export default function cameraManagerTest() {
return
false
;
}
async
function
getCameraManagerInstance
()
{
function
getCameraManagerInstance
()
{
console
.
info
(
'Enter getCameraManagerInstance'
);
mCameraManager
=
await
cameraObj
.
getCameraManager
(
null
);
mCameraManager
=
cameraObj
.
getCameraManager
(
null
);
if
(
isEmpty
(
mCameraManager
))
{
console
.
info
(
TAG
+
"getCameraManager FAILED"
);
return
false
;
...
...
@@ -175,10 +175,10 @@ export default function cameraManagerTest() {
return
true
;
}
async
function
getCameraSupportDevicesArray
()
{
function
getCameraSupportDevicesArray
()
{
console
.
info
(
'Enter getCameraSupportDevicesArray'
);
mCameraDevicesArray
=
await
mCameraManager
.
getSupportedCameras
();
mCameraDevicesArray
=
mCameraManager
.
getSupportedCameras
();
/*
mCameraManager.getSupportedCameras(async (err, data) => {
console.info(TAG + "Entering getCameraSupportDevicesArray callback");
...
...
@@ -210,7 +210,7 @@ export default function cameraManagerTest() {
return
true
;
}
async
function
getSupportedOutputCapability
(
cameraDevice
)
{
function
getSupportedOutputCapability
(
cameraDevice
)
{
if
(
isEmpty
(
mCameraManager
))
{
console
.
info
(
TAG
+
"Entering getSupportedOutputCapability cameraManager == null || undefined"
)
expect
()
.
assertFail
();
...
...
@@ -232,10 +232,10 @@ describe('CameraManagerTest', function () {
console
.
info
(
TAG
+
'----------CameraManagerTest--------------'
)
beforeAll
(
async
function
()
{
await
getCameraManagerInstance
();
getCameraManagerInstance
();
await
getImageReceiverSurfaceId
();
await
getVideoReceiveSurface
();
await
getCameraSupportDevicesArray
();
getCameraSupportDevicesArray
();
console
.
info
(
'beforeAll case'
);
})
...
...
@@ -266,10 +266,9 @@ describe('CameraManagerTest', function () {
*/
it
(
'SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100'
,
2
,
async
function
(
done
)
{
console
.
info
(
"--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100--------------"
);
let
cameraManagerPromise
=
await
cameraObj
.
getCameraManager
(
null
);
let
cameraManagerPromise
=
cameraObj
.
getCameraManager
(
null
);
expect
(
isEmpty
(
cameraManagerPromise
))
.
assertFalse
();
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 cameraManagerPromise: "
+
JSON
.
stringify
(
cameraManagerPromise
));
await
sleep
(
1000
);
done
();
})
...
...
@@ -287,7 +286,7 @@ describe('CameraManagerTest', function () {
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 cameraManager == null || undefined"
)
expect
()
.
assertFail
();
}
else
{
let
mCameraDevicesArrayPromise
=
await
mCameraManager
.
getSupportedCameras
();
let
mCameraDevicesArrayPromise
=
mCameraManager
.
getSupportedCameras
();
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100: "
+
JSON
.
stringify
(
mCameraDevicesArrayPromise
));
if
(
mCameraDevicesArrayPromise
!=
null
&&
mCameraDevicesArrayPromise
.
length
>
0
)
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 success"
);
...
...
@@ -331,8 +330,7 @@ describe('CameraManagerTest', function () {
console
.
info
(
"--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_CALLBACK_0100--------------"
);
let
camerasArray
=
mCameraDevicesArray
;
for
(
let
i
=
0
;
i
<
camerasArray
.
length
;
i
++
)
{
let
cameraOutputCap
=
await
getSupportedOutputCapability
(
camerasArray
[
i
]);
await
sleep
(
100
);
let
cameraOutputCap
=
getSupportedOutputCapability
(
camerasArray
[
i
]);
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_CALLBACK_0100 camera:"
+
camerasArray
[
i
]
.
cameraId
);
if
(
!
isEmpty
(
cameraOutputCap
))
{
let
previewProfilesArray
=
cameraOutputCap
.
previewProfiles
;
...
...
@@ -362,7 +360,6 @@ describe('CameraManagerTest', function () {
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_CALLBACK_0100 PASSED camera:"
+
camerasArray
[
i
]
.
cameraId
);
}
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_CALLBACK_0100 ends here"
);
await
sleep
(
1000
);
done
();
})
...
...
@@ -377,7 +374,7 @@ describe('CameraManagerTest', function () {
it
(
'SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_PROMISE_0100'
,
2
,
async
function
(
done
)
{
console
.
info
(
"--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_PROMISE_0100--------------"
);
for
(
let
i
=
0
;
i
<
mCameraDevicesArray
.
length
;
i
++
)
{
let
cameraOutputCap
=
await
getSupportedOutputCapability
(
mCameraDevicesArray
[
i
]);
let
cameraOutputCap
=
getSupportedOutputCapability
(
mCameraDevicesArray
[
i
]);
console
.
info
(
"Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_PROMISE_0100 camera:"
+
mCameraDevicesArray
[
i
]
.
cameraId
);
if
(
!
isEmpty
(
cameraOutputCap
))
{
let
previewProfilesArray
=
cameraOutputCap
.
previewProfiles
;
...
...
@@ -409,7 +406,6 @@ describe('CameraManagerTest', function () {
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_PROMISE_0100 PASSED camera:"
+
mCameraDevicesArray
[
i
]
.
cameraId
);
}
console
.
info
(
"CameraUnitTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_PROMISE_0100 ends here"
);
await
sleep
(
1000
);
done
();
})
...
...
@@ -425,7 +421,7 @@ describe('CameraManagerTest', function () {
console
.
info
(
"--------------SUB_MULTIMEDIA_CAMERA_PREVIEW_PROFILES_0100--------------"
);
let
camerasArray
=
mCameraDevicesArray
;
for
(
let
i
=
0
;
i
<
camerasArray
.
length
;
i
++
)
{
let
cameraOutputCap
=
await
getSupportedOutputCapability
(
camerasArray
[
i
]);
let
cameraOutputCap
=
getSupportedOutputCapability
(
camerasArray
[
i
]);
console
.
info
(
"Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_PROFILES_0100 camera:"
+
camerasArray
[
i
]
.
cameraId
);
if
(
!
isEmpty
(
cameraOutputCap
))
{
let
previewProfilesArray
=
cameraOutputCap
.
previewProfiles
;
...
...
@@ -446,7 +442,6 @@ describe('CameraManagerTest', function () {
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_PROFILES_0100 PASSED camera:"
+
camerasArray
[
i
]
.
cameraId
);
}
await
sleep
(
1000
);
done
();
})
...
...
@@ -462,7 +457,7 @@ describe('CameraManagerTest', function () {
console
.
info
(
"--------------SUB_MULTIMEDIA_CAMERA_PHOTO_PROFILES_0100--------------"
);
let
camerasArray
=
mCameraDevicesArray
;
for
(
let
i
=
0
;
i
<
camerasArray
.
length
;
i
++
)
{
let
cameraOutputCap
=
await
getSupportedOutputCapability
(
camerasArray
[
i
]);
let
cameraOutputCap
=
getSupportedOutputCapability
(
camerasArray
[
i
]);
console
.
info
(
"Entering SUB_MULTIMEDIA_CAMERA_PHOTO_PROFILES_0100 camera:"
+
camerasArray
[
i
]
.
cameraId
);
if
(
!
isEmpty
(
cameraOutputCap
))
{
let
photoProfilesArray
=
cameraOutputCap
.
photoProfiles
;
...
...
@@ -483,7 +478,6 @@ describe('CameraManagerTest', function () {
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_PHOTO_PROFILES_0100 PASSED camera:"
+
camerasArray
[
i
]
.
cameraId
);
}
await
sleep
(
1000
);
done
();
})
...
...
@@ -499,7 +493,7 @@ describe('CameraManagerTest', function () {
console
.
info
(
"--------------SUB_MULTIMEDIA_CAMERA_VIDEO_PROFILES_0100--------------"
);
let
camerasArray
=
mCameraDevicesArray
;
for
(
let
i
=
0
;
i
<
camerasArray
.
length
;
i
++
)
{
let
cameraOutputCap
=
await
getSupportedOutputCapability
(
camerasArray
[
i
]);
let
cameraOutputCap
=
getSupportedOutputCapability
(
camerasArray
[
i
]);
console
.
info
(
"Entering SUB_MULTIMEDIA_CAMERA_VIDEO_PROFILES_0100 camera:"
+
camerasArray
[
i
]
.
cameraId
);
if
(
!
isEmpty
(
cameraOutputCap
))
{
let
videoProfilesArray
=
cameraOutputCap
.
videoProfiles
;
...
...
@@ -523,7 +517,6 @@ describe('CameraManagerTest', function () {
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_VIDEO_PROFILES_0100 PASSED camera:"
+
camerasArray
[
i
]
.
cameraId
);
}
await
sleep
(
1000
);
done
();
})
...
...
@@ -543,7 +536,7 @@ describe('CameraManagerTest', function () {
}
else
{
let
camerasArray
=
mCameraDevicesArray
;
for
(
let
i
=
0
;
i
<
camerasArray
.
length
;
i
++
)
{
let
cameraInputPromise
=
await
mCameraManager
.
createCameraInput
(
camerasArray
[
i
]);
let
cameraInputPromise
=
mCameraManager
.
createCameraInput
(
camerasArray
[
i
]);
if
(
isEmpty
(
cameraInputPromise
))
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 cameraInputPromise == null || undefined"
)
expect
()
.
assertFail
();
...
...
@@ -552,7 +545,6 @@ describe('CameraManagerTest', function () {
}
}
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 ends here"
);
await
sleep
(
1000
);
done
();
})
...
...
@@ -572,7 +564,7 @@ describe('CameraManagerTest', function () {
}
else
{
let
camerasArray
=
mCameraDevicesArray
;
for
(
let
i
=
0
;
i
<
camerasArray
.
length
;
i
++
)
{
let
cameraInputPromiseByType
=
await
mCameraManager
.
createCameraInput
(
camerasArray
[
i
]
.
cameraPosition
,
camerasArray
[
i
]
.
cameraType
);
let
cameraInputPromiseByType
=
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
();
...
...
@@ -581,7 +573,6 @@ describe('CameraManagerTest', function () {
}
}
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_BY_POSITION_AND_TYPE_PROMISE_0100 ends here"
);
await
sleep
(
1000
);
done
();
})
...
...
@@ -597,7 +588,7 @@ describe('CameraManagerTest', function () {
console
.
info
(
"--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PREVIEW_OUTPUT_PROMISE_0100--------------"
);
let
camerasArray
=
mCameraDevicesArray
;
for
(
let
i
=
0
;
i
<
camerasArray
.
length
;
i
++
)
{
let
cameraOutputCap
=
await
getSupportedOutputCapability
(
camerasArray
[
i
]);
let
cameraOutputCap
=
getSupportedOutputCapability
(
camerasArray
[
i
]);
console
.
info
(
"SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PREVIEW_OUTPUT_PROMISE_0100 camera:"
+
camerasArray
[
i
]
.
cameraId
);
if
(
!
isEmpty
(
cameraOutputCap
))
{
let
previewProfilesArray
=
cameraOutputCap
.
previewProfiles
;
...
...
@@ -606,12 +597,11 @@ describe('CameraManagerTest', function () {
expect
()
.
assertFail
();
}
else
{
for
(
let
j
=
0
;
j
<
previewProfilesArray
.
length
;
j
++
)
{
let
previewOutputPromise
=
await
mCameraManager
.
createPreviewOutput
(
previewProfilesArray
[
j
],
globalThis
.
surfaceId
);
let
previewOutputPromise
=
mCameraManager
.
createPreviewOutput
(
previewProfilesArray
[
j
],
globalThis
.
surfaceId
);
if
(
isEmpty
(
previewOutputPromise
))
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PREVIEW_OUTPUT_PROMISE_0100 previewOutputPromise == null || undefined"
)
expect
()
.
assertFail
();
}
await
sleep
(
100
);
}
}
}
...
...
@@ -635,7 +625,7 @@ describe('CameraManagerTest', function () {
console
.
info
(
"--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PHOTO_OUTPUT_PROMISE_0100--------------"
);
let
camerasArray
=
mCameraDevicesArray
;
for
(
let
i
=
0
;
i
<
camerasArray
.
length
;
i
++
)
{
let
cameraOutputCap
=
await
getSupportedOutputCapability
(
camerasArray
[
i
]);
let
cameraOutputCap
=
getSupportedOutputCapability
(
camerasArray
[
i
]);
console
.
info
(
"SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PHOTO_OUTPUT_PROMISE_0100 camera:"
+
camerasArray
[
i
]
.
cameraId
);
if
(
!
isEmpty
(
cameraOutputCap
))
{
let
photoProfilesArray
=
cameraOutputCap
.
photoProfiles
;
...
...
@@ -644,19 +634,17 @@ describe('CameraManagerTest', function () {
expect
()
.
assertFail
();
}
else
{
for
(
let
j
=
0
;
j
<
photoProfilesArray
.
length
;
j
++
)
{
let
photoOutputPromise
=
await
mCameraManager
.
createPhotoOutput
(
photoProfilesArray
[
j
],
mPhotoSurface
);
let
photoOutputPromise
=
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
(
100
);
}
}
}
}
}
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PHOTO_OUTPUT_PROMISE_0100 PASS"
);
await
sleep
(
1000
);
done
();
})
...
...
@@ -673,7 +661,7 @@ describe('CameraManagerTest', function () {
console
.
info
(
"--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_PROMISE_0100--------------"
);
let
camerasArray
=
mCameraDevicesArray
;
for
(
let
i
=
0
;
i
<
camerasArray
.
length
;
i
++
)
{
let
cameraOutputCap
=
await
getSupportedOutputCapability
(
camerasArray
[
i
]);
let
cameraOutputCap
=
getSupportedOutputCapability
(
camerasArray
[
i
]);
console
.
info
(
"SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_PROMISE_0100 camera:"
+
camerasArray
[
i
]
.
cameraId
);
if
(
!
isEmpty
(
cameraOutputCap
))
{
let
videoProfilesArray
=
cameraOutputCap
.
videoProfiles
;
...
...
@@ -682,7 +670,7 @@ describe('CameraManagerTest', function () {
expect
()
.
assertFail
();
}
else
{
for
(
let
j
=
0
;
j
<
videoProfilesArray
.
length
;
j
++
)
{
let
videoOutputPromise
=
await
mCameraManager
.
createVideoOutput
(
videoProfilesArray
[
j
],
mVideoSurface
);
let
videoOutputPromise
=
mCameraManager
.
createVideoOutput
(
videoProfilesArray
[
j
],
mVideoSurface
);
if
(
isEmpty
(
videoOutputPromise
))
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_PROMISE_0100 videoOutputPromise == null || undefined"
)
expect
()
.
assertFail
();
...
...
@@ -690,14 +678,12 @@ describe('CameraManagerTest', function () {
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_CALLBACK_0100 videoOutputPromise = "
+
videoOutputPromise
);
break
;
}
await
sleep
(
100
);
}
}
}
}
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_PROMISE_0100 PASS"
);
await
sleep
(
1000
);
done
();
})
...
...
@@ -713,26 +699,24 @@ describe('CameraManagerTest', function () {
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
getSupportedOutputCapability
(
camerasArray
[
i
]);
let
cameraOutputCap
=
getSupportedOutputCapability
(
camerasArray
[
i
]);
console
.
info
(
"SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_PROMISE_0100 camera:"
+
camerasArray
[
i
]
.
cameraId
);
if
(
!
isEmpty
(
cameraOutputCap
))
{
let
metadataObjectTypeArray
=
cameraOutputCap
.
supportedMetadataObjectTypes
;
if
(
!
isEmpty
(
metadataObjectTypeArray
))
{
let
metadataOutputPromise
=
await
mCameraManager
.
createMetadataOutput
(
metadataObjectTypeArray
);
let
metadataOutputPromise
=
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
();
})
...
...
@@ -746,13 +730,12 @@ describe('CameraManagerTest', function () {
*/
it
(
'SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100'
,
2
,
async
function
(
done
)
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 to operate"
);
let
captureSessionPromise
=
await
mCameraManager
.
createCaptureSession
();
let
captureSessionPromise
=
mCameraManager
.
createCaptureSession
();
if
(
isEmpty
(
captureSessionPromise
))
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 captureSessionPromise == null || undefined"
)
expect
()
.
assertFail
();
}
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 PASSED"
);
await
sleep
(
1000
);
await
captureSessionPromise
.
release
();
done
();
})
...
...
@@ -779,7 +762,6 @@ describe('CameraManagerTest', function () {
console
.
log
(
TAG
+
"isCameraMuted has failed for "
+
err
.
message
);
expect
()
.
assertFail
();
}
await
sleep
(
1000
);
done
();
})
...
...
multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionBaseTest.test.ets
浏览文件 @
7e073cfc
此差异已折叠。
点击以展开。
multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionExposureTest.test.ets
浏览文件 @
7e073cfc
此差异已折叠。
点击以展开。
multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionFlashTest.test.ets
浏览文件 @
7e073cfc
此差异已折叠。
点击以展开。
multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionFocusTest.test.ets
浏览文件 @
7e073cfc
此差异已折叠。
点击以展开。
multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionVideoStabilizationTest.test.ets
浏览文件 @
7e073cfc
此差异已折叠。
点击以展开。
multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionZoomRatioTest.test.ets
浏览文件 @
7e073cfc
...
...
@@ -180,10 +180,10 @@ export default function cameraSessionZoomRatioTest() {
console
.
log
(
TAG
+
'Exit releaseVideoReceiveSurface'
)
}
async
function
getCameraManagerInstance
()
{
function
getCameraManagerInstance
()
{
console
.
info
(
'Enter getCameraManagerInstance'
);
mCameraManager
=
await
cameraObj
.
getCameraManager
(
null
);
mCameraManager
=
cameraObj
.
getCameraManager
(
null
);
if
(
isEmpty
(
mCameraManager
))
{
console
.
info
(
TAG
+
"getCameraManager FAILED"
);
return
false
;
...
...
@@ -194,10 +194,10 @@ export default function cameraSessionZoomRatioTest() {
return
true
;
}
async
function
getCameraSupportDevicesArray
()
{
function
getCameraSupportDevicesArray
()
{
console
.
info
(
'Enter getCameraSupportDevicesArray'
);
mCameraDevicesArray
=
await
mCameraManager
.
getSupportedCameras
();
mCameraDevicesArray
=
mCameraManager
.
getSupportedCameras
();
/*
mCameraManager.getSupportedCameras(async (err, data) => {
console.info(TAG + "Entering getCameraSupportDevicesArray callback");
...
...
@@ -233,41 +233,11 @@ export default function cameraSessionZoomRatioTest() {
return
true
;
}
async
function
beginCameraSessionConfig
()
{
console
.
info
(
'Enter beginCameraSessionConfig'
);
mCameraSession
.
beginConfig
();
await
sleep
(
30
);
console
.
info
(
'Exit beginCameraSessionConfig'
);
return
true
;
}
async
function
commitCameraSessionConfig
()
{
console
.
info
(
'Enter commitCameraSessionConfig'
);
mCameraSession
.
commitConfig
(
async
(
err
)
=>
{
if
(
!
err
)
{
console
.
info
(
TAG
+
"Entering commitConfig PASSED"
);
}
else
{
console
.
info
(
TAG
+
"Entering commitConfig FAILED : "
+
err
.
message
);
}
})
await
sleep
(
500
);
console
.
info
(
'Exit commitCameraSessionConfig'
);
return
true
;
}
async
function
createCameraSessionInstance
()
{
function
createCameraSessionInstance
()
{
console
.
info
(
'Enter createCameraSessionInstance'
);
try
{
mCameraSession
=
await
mCameraManager
.
createCaptureSession
();
mCameraSession
=
mCameraManager
.
createCaptureSession
();
}
catch
{
console
.
info
(
'createCaptureSession FAILED'
);
...
...
@@ -278,7 +248,7 @@ export default function cameraSessionZoomRatioTest() {
return
false
;
}
// await beginCameraSessio
nConfig();
mCameraSession
.
begi
nConfig
();
console
.
info
(
'Exit createCameraSessionInstance'
);
...
...
@@ -304,14 +274,7 @@ export default function cameraSessionZoomRatioTest() {
return
false
;
}
mCameraInput
.
open
(
async
(
err
)
=>
{
console
.
info
(
TAG
+
"Entering mCameraInput open callback"
);
if
(
!
err
)
{
console
.
info
(
TAG
+
"Entering mCameraInput open PASSED "
);
}
else
{
console
.
info
(
TAG
+
"Entering mCameraInput open FAILED : "
+
err
.
message
);
}
})
await
mCameraInput
.
open
();
await
sleep
(
100
);
...
...
@@ -405,7 +368,6 @@ export default function cameraSessionZoomRatioTest() {
console
.
info
(
'Enter releaseOutput'
);
if
(
!
isEmpty
(
mPreviewOutput
))
{
await
mPreviewOutput
.
stop
();
await
mPreviewOutput
.
release
();
}
...
...
@@ -427,9 +389,7 @@ export default function cameraSessionZoomRatioTest() {
console
.
info
(
TAG
+
"Enter startCameraSession"
);
await
createInput
(
idx
);
await
createOutput
(
idx
);
await
beginCameraSessionConfig
();
createOutput
(
idx
);
console
.
info
(
TAG
+
"Start to addInput"
);
...
...
@@ -438,17 +398,17 @@ export default function cameraSessionZoomRatioTest() {
if
(
!
isEmpty
(
mCameraInput
))
{
console
.
info
(
TAG
+
"Start to addInput"
);
await
mCameraSession
.
addInput
(
mCameraInput
);
mCameraSession
.
addInput
(
mCameraInput
);
}
if
(
!
isEmpty
(
mPreviewOutput
))
{
console
.
info
(
TAG
+
"Start to addOutput mPreviewOutput"
);
await
mCameraSession
.
addOutput
(
mPreviewOutput
);
mCameraSession
.
addOutput
(
mPreviewOutput
);
}
if
(
!
isEmpty
(
mPhotoOutput
))
{
console
.
info
(
TAG
+
"Start to addOutput mPhotoOutput"
);
await
mCameraSession
.
addOutput
(
mPhotoOutput
);
mCameraSession
.
addOutput
(
mPhotoOutput
);
}
/*
if (!isEmpty(mVideoOutput)) {
...
...
@@ -458,13 +418,9 @@ export default function cameraSessionZoomRatioTest() {
*/
await
sleep
(
1
);
await
commitCameraSession
Config
();
await
mCameraSession
.
commit
Config
();
console
.
info
(
TAG
+
"Entering startCameraSession start session begin"
);
await
mCameraSession
.
start
();
console
.
info
(
TAG
+
"Entering startCameraSession start session end"
);
/*
await mCameraSession.start(async (err) => {
...
...
@@ -485,6 +441,8 @@ export default function cameraSessionZoomRatioTest() {
async
function
stopCameraSession
()
{
console
.
info
(
TAG
+
"Enter stopCameraSession"
);
mCameraSession
.
beginConfig
();
/*
mCameraSession.stop(async (err) => {
console.info(TAG + "Entering mCameraSession stop callback");
...
...
@@ -498,19 +456,20 @@ export default function cameraSessionZoomRatioTest() {
await sleep(100);
*/
// await commitCameraSessionConfig();
if
(
!
isEmpty
(
mCameraInput
))
{
console
.
info
(
TAG
+
"Start to removeInput input"
);
await
mCameraSession
.
removeInput
(
mCameraInput
);
mCameraSession
.
removeInput
(
mCameraInput
);
}
if
(
!
isEmpty
(
mPreviewOutput
))
{
console
.
info
(
TAG
+
"Start to removeOutput mPreviewOutput"
);
await
mCameraSession
.
removeOutput
(
mPreviewOutput
);
mCameraSession
.
removeOutput
(
mPreviewOutput
);
}
if
(
!
isEmpty
(
mPhotoOutput
))
{
console
.
info
(
TAG
+
"Start to removeOutput mPhotoOutput"
);
await
mCameraSession
.
removeOutput
(
mPhotoOutput
);
mCameraSession
.
removeOutput
(
mPhotoOutput
);
}
/*
if (!isEmpty(mVideoOutput)) {
...
...
@@ -518,6 +477,7 @@ export default function cameraSessionZoomRatioTest() {
await mCameraSession.removeOutput(mVideoOutput);
}
*/
await
releaseInput
();
await
releaseOutput
();
...
...
@@ -533,9 +493,9 @@ export default function cameraSessionZoomRatioTest() {
sleep
(
100
);
await
getPhotoReceiverSurface
();
await
getVideoReceiveSurface
();
await
getCameraManagerInstance
();
await
getCameraSupportDevicesArray
();
await
createCameraSessionInstance
();
getCameraManagerInstance
();
getCameraSupportDevicesArray
();
createCameraSessionInstance
();
console
.
info
(
'Device type = '
+
deviceInfo
.
deviceType
);
...
...
@@ -582,7 +542,7 @@ export default function cameraSessionZoomRatioTest() {
await
startCameraSession
(
i
);
try
{
let
zoomRatioRange
=
await
mCameraSession
.
getZoomRatioRange
();
let
zoomRatioRange
=
mCameraSession
.
getZoomRatioRange
();
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_PROMISE_0100 finish"
);
if
(
zoomRatioRange
.
length
>
0
)
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_PROMISE_0100 PASSED with ZoomRatioRange length is: "
+
zoomRatioRange
.
length
);
...
...
@@ -598,8 +558,6 @@ export default function cameraSessionZoomRatioTest() {
catch
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_CALLBACK_0100 PASSED"
);
}
await
sleep
(
100
);
await
stopCameraSession
();
...
...
@@ -635,12 +593,11 @@ export default function cameraSessionZoomRatioTest() {
if
(
!
isEmpty
(
mZoomRatioRangeArray
[
i
]))
{
await
startCameraSession
(
i
);
await
mCameraSession
.
setZoomRatio
(
mZoomRatioRangeArray
[
i
][
0
]);
mCameraSession
.
setZoomRatio
(
mZoomRatioRangeArray
[
i
][
0
]);
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0100 finish"
);
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0100 PASSED with ZoomRatio is: "
+
mZoomRatioRangeArray
[
i
][
0
]);
await
sleep
(
500
);
let
zoomRatio
=
await
mCameraSession
.
getZoomRatio
();
let
zoomRatio
=
mCameraSession
.
getZoomRatio
();
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0100 finish"
);
if
(
zoomRatio
==
mZoomRatioRangeArray
[
i
][
0
])
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0100 PASSED with ZoomRatio is: "
+
zoomRatio
);
...
...
@@ -648,7 +605,6 @@ export default function cameraSessionZoomRatioTest() {
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0100 FAILED with ZoomRatio is: "
+
zoomRatio
);
expect
()
.
assertFail
();
}
await
sleep
(
500
);
await
stopCameraSession
();
}
...
...
@@ -684,12 +640,11 @@ export default function cameraSessionZoomRatioTest() {
if
(
!
isEmpty
(
mZoomRatioRangeArray
[
i
]))
{
await
startCameraSession
(
i
);
await
mCameraSession
.
setZoomRatio
((
mZoomRatioMaxArray
[
i
]
+
1
));
mCameraSession
.
setZoomRatio
((
mZoomRatioMaxArray
[
i
]
+
1
));
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0101 finish"
);
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0101 PASSED with ZoomRatio is: "
+
(
mZoomRatioMaxArray
[
i
]
+
1
));
await
sleep
(
500
);
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0101 PASSED with ZoomRatio is: "
+
(
mZoomRatioMaxArray
[
i
]
+
1
));
let
zoomRatio
=
await
mCameraSession
.
getZoomRatio
();
let
zoomRatio
=
mCameraSession
.
getZoomRatio
();
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0101 finish"
);
if
(
zoomRatio
!=
(
mZoomRatioMaxArray
[
i
]
+
1
))
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0101 PASSED with ZoomRatio is: "
+
zoomRatio
);
...
...
@@ -697,7 +652,6 @@ export default function cameraSessionZoomRatioTest() {
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0101 FAILED with ZoomRatio is: "
+
zoomRatio
);
expect
()
.
assertFail
();
}
await
sleep
(
500
);
await
stopCameraSession
();
}
...
...
@@ -734,12 +688,11 @@ export default function cameraSessionZoomRatioTest() {
if
(
!
isEmpty
(
mZoomRatioRangeArray
[
i
]))
{
await
startCameraSession
(
i
);
await
mCameraSession
.
setZoomRatio
((
mZoomRatioMaxArray
[
i
]
+
0.1
));
mCameraSession
.
setZoomRatio
((
mZoomRatioMaxArray
[
i
]
+
0.1
));
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0102 finish"
);
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0102 PASSED with ZoomRatio is: "
+
(
mZoomRatioMaxArray
[
i
]
+
0.1
));
await
sleep
(
500
);
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0102 PASSED with ZoomRatio is: "
+
(
mZoomRatioMaxArray
[
i
]
+
0.1
));
let
zoomRatio
=
await
mCameraSession
.
getZoomRatio
();
let
zoomRatio
=
mCameraSession
.
getZoomRatio
();
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0102 finish"
);
if
(
zoomRatio
!=
(
mZoomRatioMaxArray
[
i
]
+
0.1
))
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0102 PASSED with ZoomRatio is: "
+
zoomRatio
);
...
...
@@ -747,7 +700,6 @@ export default function cameraSessionZoomRatioTest() {
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0102 FAILED with ZoomRatio is: "
+
zoomRatio
);
expect
()
.
assertFail
();
}
await
sleep
(
500
);
await
stopCameraSession
();
}
...
...
@@ -784,12 +736,11 @@ export default function cameraSessionZoomRatioTest() {
if
(
!
isEmpty
(
mZoomRatioRangeArray
[
i
]))
{
await
startCameraSession
(
i
);
await
mCameraSession
.
setZoomRatio
((
mZoomRatioMinArray
[
i
]
-
1
));
mCameraSession
.
setZoomRatio
((
mZoomRatioMinArray
[
i
]
-
1
));
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0103 finish"
);
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0103 PASSED with ZoomRatio is: "
+
(
mZoomRatioMaxArray
[
i
]
-
1
));
await
sleep
(
500
);
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0103 PASSED with ZoomRatio is: "
+
(
mZoomRatioMaxArray
[
i
]
-
1
));
let
zoomRatio
=
await
mCameraSession
.
getZoomRatio
();
let
zoomRatio
=
mCameraSession
.
getZoomRatio
();
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0103 finish"
);
if
(
zoomRatio
!=
(
mZoomRatioMinArray
[
i
]
-
1
))
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0103 PASSED with ZoomRatio is: "
+
zoomRatio
);
...
...
@@ -797,7 +748,6 @@ export default function cameraSessionZoomRatioTest() {
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0103 FAILED with ZoomRatio is: "
+
zoomRatio
);
expect
()
.
assertFail
();
}
await
sleep
(
500
);
await
stopCameraSession
();
}
...
...
@@ -834,12 +784,11 @@ export default function cameraSessionZoomRatioTest() {
if
(
!
isEmpty
(
mZoomRatioRangeArray
[
i
]))
{
await
startCameraSession
(
i
);
await
mCameraSession
.
setZoomRatio
((
mZoomRatioMinArray
[
i
]
-
0.1
));
mCameraSession
.
setZoomRatio
((
mZoomRatioMinArray
[
i
]
-
0.1
));
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0104 finish"
);
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0104 PASSED with ZoomRatio is: "
+
(
mZoomRatioMaxArray
[
i
]
-
0.1
));
await
sleep
(
500
);
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0104 PASSED with ZoomRatio is: "
+
(
mZoomRatioMaxArray
[
i
]
-
0.1
));
let
zoomRatio
=
await
mCameraSession
.
getZoomRatio
();
let
zoomRatio
=
mCameraSession
.
getZoomRatio
();
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0104 finish"
);
if
(
zoomRatio
!=
(
mZoomRatioMinArray
[
i
]
-
0.1
))
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0104 PASSED with ZoomRatio is: "
+
zoomRatio
);
...
...
@@ -847,7 +796,6 @@ export default function cameraSessionZoomRatioTest() {
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0104 FAILED with ZoomRatio is: "
+
zoomRatio
);
expect
()
.
assertFail
();
}
await
sleep
(
500
);
await
stopCameraSession
();
}
...
...
multimedia/camera/camera_js_standard/signature/openharmony_sx.p7b
浏览文件 @
7e073cfc
无法预览此类型文件
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录