Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
9ff621c1
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看板
未验证
提交
9ff621c1
编写于
6月 16, 2023
作者:
O
openharmony_ci
提交者:
Gitee
6月 16, 2023
浏览文件
操作
浏览文件
下载
差异文件
!8971 媒体CameraXTS监听整改
Merge pull request !8971 from 张永宽/master
上级
a0ed04a3
4cbde173
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
151 addition
and
140 deletion
+151
-140
multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraEnumTest.test.ets
..._standard/entry/src/main/ets/test/CameraEnumTest.test.ets
+1
-1
multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraErrorCodeUsecaseTest.test.ets
...try/src/main/ets/test/CameraErrorCodeUsecaseTest.test.ets
+107
-107
multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraJSUnitOutput.test.ets
...ndard/entry/src/main/ets/test/CameraJSUnitOutput.test.ets
+43
-32
未找到文件。
multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraEnumTest.test.ets
浏览文件 @
9ff621c1
...
...
@@ -315,7 +315,7 @@ export default function cameraEnumTest() {
expect(camera.CameraErrorCode.DEVICE_SETTING_LOCKED == 7400106).assertTrue();
console.info(TAG + "--------------DEVICE_SETTING_LOCKED--------------");
expect(camera.CameraErrorCode.CONFLICT_CAMERA == 7400107).assertTrue();
//
console.info(TAG + "--------------CONFLICT_CAMERA--------------");
console.info(TAG + "--------------CONFLICT_CAMERA--------------");
expect(camera.CameraErrorCode.DEVICE_DISABLED == 7400108).assertTrue();
console.info(TAG + "--------------DEVICE_DISABLED--------------");
expect(camera.CameraErrorCode.DEVICE_PREEMPTED == 7400109).assertTrue();
...
...
multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraErrorCodeUsecaseTest.test.ets
浏览文件 @
9ff621c1
...
...
@@ -17,7 +17,7 @@ import cameraObj from '@ohos.multimedia.camera';
import
image
from
'@ohos.multimedia.image'
;
import
media
from
'@ohos.multimedia.media'
;
import
mediaLibrary
from
'@ohos.multimedia.mediaLibrary'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'@ohos/hypium'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'@ohos/hypium'
;
// 创建视频录制的参数
let
videoProfile
=
{
...
...
@@ -31,7 +31,7 @@ let videoProfile = {
videoFrameWidth
:
640
,
videoFrameHeight
:
480
,
videoFrameRate
:
30
}
}
let
videoConfig
=
{
audioSourceType
:
1
,
...
...
@@ -42,20 +42,20 @@ let videoConfig = {
location
:
{
latitude
:
30
,
longitude
:
130
},
maxSize
:
100
,
maxDuration
:
500
}
}
let
captureLocation
=
{
let
captureLocation
=
{
latitude
:
0
,
longitude
:
0
,
altitude
:
0
,
}
}
let
captureSetting
=
{
let
captureSetting
=
{
quality
:
cameraObj
.
QualityLevel
.
QUALITY_LEVEL_LOW
,
rotation
:
cameraObj
.
ImageRotation
.
ROTATION_0
,
location
:
captureLocation
,
mirror
:
false
}
}
const
TAG
=
"CameraErrorCodeUsecaseTest: "
;
let
mCameraManager
;
...
...
@@ -113,7 +113,7 @@ export default function CameraErrorCodeUsecaseTest() {
return
true
;
}
async
function
createInput
(
idx
:
any
)
{
async
function
createInput
(
idx
:
any
)
{
console
.
info
(
TAG
+
'Enter createInput'
);
if
(
isEmpty
(
mCameraDevicesArray
))
{
console
.
info
(
TAG
+
"Entering createInputs FAILED with NoCamera"
);
...
...
@@ -268,7 +268,7 @@ export default function CameraErrorCodeUsecaseTest() {
console
.
log
(
TAG
+
'Exit releaseVideoReceiveSurface'
)
}
function
createOutput
(
idx
:
any
)
{
function
createOutput
(
idx
:
any
)
{
console
.
info
(
TAG
+
'Enter createOutput'
);
cameraOutputCap
=
mCameraManager
.
getSupportedOutputCapability
(
mCameraDevicesArray
[
idx
]);
if
(
!
isEmpty
(
cameraOutputCap
))
{
...
...
@@ -414,7 +414,7 @@ export default function CameraErrorCodeUsecaseTest() {
done
();
}
else
{
try
{
let
camerainput
=
mCameraManager
.
createCameraInput
(
null
,
"cameraInput"
);
let
camerainput
=
mCameraManager
.
createCameraInput
(
null
,
"cameraInput"
);
}
catch
(
error
)
{
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_ERROR_CODE_USECASE_CREATE_CAMERA_INPUT_0300 FAILED"
);
console
.
info
(
TAG
+
"ERRORCODE: "
+
error
.
code
);
...
...
@@ -495,7 +495,7 @@ export default function CameraErrorCodeUsecaseTest() {
done
();
}
else
{
try
{
let
previewoutput
=
mCameraManager
.
createPreviewOutput
(
null
,
"createoutput"
);
let
previewoutput
=
mCameraManager
.
createPreviewOutput
(
null
,
"createoutput"
);
}
catch
(
error
)
{
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_ERROR_CODE_USECASE_CREATE_PREVIEW_OUTPUT_0200 FAILED"
);
console
.
info
(
TAG
+
"ERRORCODE: "
+
error
.
code
);
...
...
@@ -522,7 +522,7 @@ export default function CameraErrorCodeUsecaseTest() {
done
();
}
else
{
try
{
let
photooutput
=
mCameraManager
.
createPhotoOutput
(
null
,
"createoutput"
);
let
photooutput
=
mCameraManager
.
createPhotoOutput
(
null
,
"createoutput"
);
}
catch
(
error
)
{
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_ERROR_CODE_USECASE_CREATE_PHOTO_OUTPUT_0100 FAILED"
);
console
.
info
(
TAG
+
"ERRORCODE: "
+
error
.
code
);
...
...
@@ -603,7 +603,7 @@ export default function CameraErrorCodeUsecaseTest() {
done
();
}
else
{
try
{
let
videooutput
=
mCameraManager
.
createVideoOutput
(
null
,
"createoutput"
);
let
videooutput
=
mCameraManager
.
createVideoOutput
(
null
,
"createoutput"
);
}
catch
(
error
)
{
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_ERROR_CODE_USECASE_CREATE_VIDEO_OUTPUT_0200 FAILED"
);
console
.
info
(
TAG
+
"ERRORCODE: "
+
error
.
code
);
...
...
@@ -862,7 +862,7 @@ export default function CameraErrorCodeUsecaseTest() {
mCameraSession
.
addOutput
(
mPhotoOutput
);
await
commitCameraSessionConfig
();
await
mCameraSession
.
start
();
mPhotoOutput
.
capture
({},
async
(
err
)
=>
{
mPhotoOutput
.
capture
({},
async
(
err
)
=>
{
if
(
!
err
)
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_ERROR_CODE_USECASE_PHOTOOUTPUT_CAPTURE_0200 success"
);
}
else
{
...
...
@@ -1118,7 +1118,7 @@ export default function CameraErrorCodeUsecaseTest() {
createOutput
(
0
);
mCameraSession
.
addOutput
(
mPreviewOutput
);
mCameraSession
.
addOutput
(
mPhotoOutput
);
try
{
try
{
let
isFlash
=
mCameraSession
.
hasFlash
();
}
catch
(
error
)
{
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_ERROR_CODE_USECASE_CAPTURESESSION_HASFLASH_0100 FAILED"
);
...
...
@@ -1145,7 +1145,7 @@ export default function CameraErrorCodeUsecaseTest() {
createOutput
(
0
);
mCameraSession
.
addOutput
(
mPreviewOutput
);
mCameraSession
.
addOutput
(
mPhotoOutput
);
try
{
try
{
let
isFlashmodesupported
=
mCameraSession
.
isFlashModeSupported
(
cameraObj
.
FlashMode
.
FLASH_MODE_AUTO
);
}
catch
(
error
)
{
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_ERROR_CODE_USECASE_CAPTURESESSION_ISFLASHMODESUPPORTED_0100 FAILED"
);
...
...
@@ -1172,7 +1172,7 @@ export default function CameraErrorCodeUsecaseTest() {
createOutput
(
0
);
mCameraSession
.
addOutput
(
mPreviewOutput
);
mCameraSession
.
addOutput
(
mPhotoOutput
);
try
{
try
{
let
flashmode
=
mCameraSession
.
getFlashMode
();
}
catch
(
error
)
{
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_ERROR_CODE_USECASE_CAPTURESESSION_GETFLASHMODE_0100 FAILED"
);
...
...
@@ -1199,7 +1199,7 @@ export default function CameraErrorCodeUsecaseTest() {
createOutput
(
0
);
mCameraSession
.
addOutput
(
mPreviewOutput
);
mCameraSession
.
addOutput
(
mPhotoOutput
);
try
{
try
{
mCameraSession
.
setFlashMode
(
cameraObj
.
FlashMode
.
FLASH_MODE_AUTO
);
}
catch
(
error
)
{
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_ERROR_CODE_USECASE_CAPTURESESSION_SETFLASHMODE_0100 FAILED"
);
...
...
@@ -1228,7 +1228,7 @@ export default function CameraErrorCodeUsecaseTest() {
mCameraSession
.
addOutput
(
mPhotoOutput
);
await
commitCameraSessionConfig
();
await
mCameraSession
.
start
();
try
{
try
{
mCameraSession
.
setFlashMode
(
5
);
}
catch
(
error
)
{
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_ERROR_CODE_USECASE_CAPTURESESSION_SETFLASHMODE_0101 FAILED"
);
...
...
@@ -1254,7 +1254,7 @@ export default function CameraErrorCodeUsecaseTest() {
createOutput
(
0
);
mCameraSession
.
addOutput
(
mPreviewOutput
);
mCameraSession
.
addOutput
(
mPhotoOutput
);
try
{
try
{
let
issupported
=
mCameraSession
.
isExposureModeSupported
(
cameraObj
.
ExposureMode
.
EXPOSURE_MODE_AUTO
);
}
catch
(
error
)
{
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_ERROR_CODE_USECASE_CAPTURESESSION_ISEXPOSUREMODESUPPORTED_0100 FAILED"
);
...
...
@@ -1281,7 +1281,7 @@ export default function CameraErrorCodeUsecaseTest() {
createOutput
(
0
);
mCameraSession
.
addOutput
(
mPreviewOutput
);
mCameraSession
.
addOutput
(
mPhotoOutput
);
try
{
try
{
let
exposure
=
mCameraSession
.
getExposureMode
();
}
catch
(
error
)
{
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_ERROR_CODE_USECASE_CAPTURESESSION_GETEXPOSUREMODE_0100 FAILED"
);
...
...
@@ -1308,7 +1308,7 @@ export default function CameraErrorCodeUsecaseTest() {
createOutput
(
0
);
mCameraSession
.
addOutput
(
mPreviewOutput
);
mCameraSession
.
addOutput
(
mPhotoOutput
);
try
{
try
{
mCameraSession
.
setExposureMode
(
cameraObj
.
ExposureMode
.
EXPOSURE_MODE_AUTO
);
}
catch
(
error
)
{
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_ERROR_CODE_USECASE_CAPTURESESSION_SETEXPOSUREMODE_0100 FAILED"
);
...
...
@@ -1336,7 +1336,7 @@ export default function CameraErrorCodeUsecaseTest() {
mCameraSession
.
addOutput
(
mPhotoOutput
);
await
commitCameraSessionConfig
();
await
mCameraSession
.
start
();
try
{
try
{
mCameraSession
.
setExposureMode
(
5
);
}
catch
(
error
)
{
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_ERROR_CODE_USECASE_CAPTURESESSION_SETEXPOSUREMODE_0101 FAILED"
);
...
...
@@ -1362,7 +1362,7 @@ export default function CameraErrorCodeUsecaseTest() {
createOutput
(
0
);
mCameraSession
.
addOutput
(
mPreviewOutput
);
mCameraSession
.
addOutput
(
mPhotoOutput
);
try
{
try
{
let
point
=
mCameraSession
.
getMeteringPoint
();
}
catch
(
error
)
{
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_ERROR_CODE_USECASE_CAPTURESESSION_GETMETERINGPOINT_0100 FAILED"
);
...
...
@@ -1389,8 +1389,8 @@ export default function CameraErrorCodeUsecaseTest() {
createOutput
(
0
);
mCameraSession
.
addOutput
(
mPreviewOutput
);
mCameraSession
.
addOutput
(
mPhotoOutput
);
try
{
mCameraSession
.
setMeteringPoint
({
x
:
1
,
y
:
1
});
try
{
mCameraSession
.
setMeteringPoint
({
x
:
1
,
y
:
1
});
}
catch
(
error
)
{
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_ERROR_CODE_USECASE_CAPTURESESSION_SETMETERINGPOINT_0100 FAILED"
);
console
.
info
(
TAG
+
"ERRORCODE: "
+
error
.
code
);
...
...
@@ -1418,8 +1418,8 @@ export default function CameraErrorCodeUsecaseTest() {
mCameraSession
.
addOutput
(
mPhotoOutput
);
await
commitCameraSessionConfig
();
await
mCameraSession
.
start
();
try
{
mCameraSession
.
setMeteringPoint
({
x
:-
1
,
y
:-
1
});
try
{
mCameraSession
.
setMeteringPoint
({
x
:
-
1
,
y
:
-
1
});
}
catch
(
error
)
{
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_ERROR_CODE_USECASE_CAPTURESESSION_SETMETERINGPOINT_0101 FAILED"
);
console
.
info
(
TAG
+
"ERRORCODE: "
+
error
.
code
);
...
...
@@ -1444,7 +1444,7 @@ export default function CameraErrorCodeUsecaseTest() {
createOutput
(
0
);
mCameraSession
.
addOutput
(
mPreviewOutput
);
mCameraSession
.
addOutput
(
mPhotoOutput
);
try
{
try
{
let
range
=
mCameraSession
.
getExposureBiasRange
();
}
catch
(
error
)
{
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_ERROR_CODE_USECASE_CAPTURESESSION_GETEXPOSUREBIASRANGE_0100 FAILED"
);
...
...
@@ -1471,7 +1471,7 @@ export default function CameraErrorCodeUsecaseTest() {
createOutput
(
0
);
mCameraSession
.
addOutput
(
mPreviewOutput
);
mCameraSession
.
addOutput
(
mPhotoOutput
);
try
{
try
{
let
range
=
mCameraSession
.
getExposureBiasRange
();
mCameraSession
.
setExposureBias
(
range
[
0
]);
}
catch
(
error
)
{
...
...
@@ -1501,7 +1501,7 @@ export default function CameraErrorCodeUsecaseTest() {
mCameraSession
.
addOutput
(
mPhotoOutput
);
await
commitCameraSessionConfig
();
await
mCameraSession
.
start
();
try
{
try
{
let
range
=
mCameraSession
.
getExposureBiasRange
();
mCameraSession
.
setExposureBias
(
-
101
);
}
catch
(
error
)
{
...
...
@@ -1528,7 +1528,7 @@ export default function CameraErrorCodeUsecaseTest() {
createOutput
(
0
);
mCameraSession
.
addOutput
(
mPreviewOutput
);
mCameraSession
.
addOutput
(
mPhotoOutput
);
try
{
try
{
let
value
=
mCameraSession
.
getExposureValue
();
}
catch
(
error
)
{
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_ERROR_CODE_USECASE_CAPTURESESSION_GETEXPOSUREVALUE_0100 FAILED"
);
...
...
@@ -1555,7 +1555,7 @@ export default function CameraErrorCodeUsecaseTest() {
createOutput
(
0
);
mCameraSession
.
addOutput
(
mPreviewOutput
);
mCameraSession
.
addOutput
(
mPhotoOutput
);
try
{
try
{
let
issupported
=
mCameraSession
.
isFocusModeSupported
(
cameraObj
.
FocusMode
.
FOCUS_MODE_AUTO
);
}
catch
(
error
)
{
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_ERROR_CODE_USECASE_CAPTURESESSION_ISFOCUSMODESUPPORTED_0100 FAILED"
);
...
...
@@ -1582,7 +1582,7 @@ export default function CameraErrorCodeUsecaseTest() {
createOutput
(
0
);
mCameraSession
.
addOutput
(
mPreviewOutput
);
mCameraSession
.
addOutput
(
mPhotoOutput
);
try
{
try
{
let
focusmode
=
mCameraSession
.
getFocusMode
();
}
catch
(
error
)
{
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_ERROR_CODE_USECASE_CAPTURESESSION_GETFOCUSMODE_0100 FAILED"
);
...
...
@@ -1609,7 +1609,7 @@ export default function CameraErrorCodeUsecaseTest() {
createOutput
(
0
);
mCameraSession
.
addOutput
(
mPreviewOutput
);
mCameraSession
.
addOutput
(
mPhotoOutput
);
try
{
try
{
mCameraSession
.
setFocusMode
(
cameraObj
.
FocusMode
.
FOCUS_MODE_MANUAL
);
}
catch
(
error
)
{
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_ERROR_CODE_USECASE_CAPTURESESSION_SETFOCUSMODE_0100 FAILED"
);
...
...
@@ -1637,7 +1637,7 @@ export default function CameraErrorCodeUsecaseTest() {
mCameraSession
.
addOutput
(
mPhotoOutput
);
await
commitCameraSessionConfig
();
await
mCameraSession
.
start
();
try
{
try
{
mCameraSession
.
setFocusMode
(
5
);
}
catch
(
error
)
{
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_ERROR_CODE_USECASE_CAPTURESESSION_SETFOCUSMODE_0101 FAILED"
);
...
...
@@ -1663,8 +1663,8 @@ export default function CameraErrorCodeUsecaseTest() {
createOutput
(
0
);
mCameraSession
.
addOutput
(
mPreviewOutput
);
mCameraSession
.
addOutput
(
mPhotoOutput
);
try
{
mCameraSession
.
setFocusPoint
({
x
:
1
,
y
:
1
});
try
{
mCameraSession
.
setFocusPoint
({
x
:
1
,
y
:
1
});
}
catch
(
error
)
{
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_ERROR_CODE_USECASE_CAPTURESESSION_SETFOCUSPOINT_0100 FAILED"
);
console
.
info
(
TAG
+
"ERRORCODE: "
+
error
.
code
);
...
...
@@ -1692,8 +1692,8 @@ export default function CameraErrorCodeUsecaseTest() {
mCameraSession
.
addOutput
(
mPhotoOutput
);
await
commitCameraSessionConfig
();
await
mCameraSession
.
start
();
try
{
mCameraSession
.
setFocusPoint
({
x
:-
1
,
y
:-
1
});
try
{
mCameraSession
.
setFocusPoint
({
x
:
-
1
,
y
:
-
1
});
}
catch
(
error
)
{
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_ERROR_CODE_USECASE_CAPTURESESSION_SETFOCUSPOINT_0101 FAILED"
);
console
.
info
(
TAG
+
"ERRORCODE: "
+
error
.
code
);
...
...
@@ -1712,7 +1712,7 @@ export default function CameraErrorCodeUsecaseTest() {
*/
it
(
'SUB_MULTIMEDIA_CAMERA_ERROR_CODE_USECASE_CAPTURESESSION_GETFOCUSPOINT_0100'
,
0
,
async
function
(
done
)
{
console
.
info
(
"--------------SUB_MULTIMEDIA_CAMERA_ERROR_CODE_USECASE_CAPTURESESSION_GETFOCUSPOINT_0100--------------"
);
if
(
mCameraSession
)
{
if
(
mCameraSession
)
{
mCameraSession
.
release
();
mCameraSession
=
null
;
}
...
...
@@ -1722,7 +1722,7 @@ export default function CameraErrorCodeUsecaseTest() {
createOutput
(
0
);
mCameraSession
.
addOutput
(
mPreviewOutput
);
mCameraSession
.
addOutput
(
mPhotoOutput
);
try
{
try
{
let
point
=
mCameraSession
.
getFocusPoint
();
}
catch
(
error
)
{
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_ERROR_CODE_USECASE_CAPTURESESSION_GETFOCUSPOINT_0100 FAILED"
);
...
...
@@ -1749,7 +1749,7 @@ export default function CameraErrorCodeUsecaseTest() {
createOutput
(
0
);
mCameraSession
.
addOutput
(
mPreviewOutput
);
mCameraSession
.
addOutput
(
mPhotoOutput
);
try
{
try
{
let
length
=
mCameraSession
.
getFocalLength
();
}
catch
(
error
)
{
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_ERROR_CODE_USECASE_CAPTURESESSION_GETFOCUSLENGTH_0100 FAILED"
);
...
...
@@ -1776,7 +1776,7 @@ export default function CameraErrorCodeUsecaseTest() {
createOutput
(
0
);
mCameraSession
.
addOutput
(
mPreviewOutput
);
mCameraSession
.
addOutput
(
mPhotoOutput
);
try
{
try
{
let
zoomratiorange
=
mCameraSession
.
getZoomRatioRange
();
}
catch
(
error
)
{
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_ERROR_CODE_USECASE_CAPTURESESSION_GETZOOMRATIORANG_0100 FAILED"
);
...
...
@@ -1803,7 +1803,7 @@ export default function CameraErrorCodeUsecaseTest() {
createOutput
(
0
);
mCameraSession
.
addOutput
(
mPreviewOutput
);
mCameraSession
.
addOutput
(
mPhotoOutput
);
try
{
try
{
let
zoomratio
=
mCameraSession
.
getZoomRatio
();
}
catch
(
error
)
{
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_ERROR_CODE_USECASE_CAPTURESESSION_GETZOOMRATIO_0100 FAILED"
);
...
...
@@ -1830,7 +1830,7 @@ export default function CameraErrorCodeUsecaseTest() {
createOutput
(
0
);
mCameraSession
.
addOutput
(
mPreviewOutput
);
mCameraSession
.
addOutput
(
mPhotoOutput
);
try
{
try
{
let
zoomratiorange
=
mCameraSession
.
getZoomRatioRange
();
mCameraSession
.
setZoomRatio
(
zoomratiorange
[
0
]);
}
catch
(
error
)
{
...
...
@@ -1860,7 +1860,7 @@ export default function CameraErrorCodeUsecaseTest() {
mCameraSession
.
addOutput
(
mPhotoOutput
);
await
commitCameraSessionConfig
();
await
mCameraSession
.
start
();
try
{
try
{
let
zoomratiorange
=
mCameraSession
.
getZoomRatioRange
();
mCameraSession
.
setZoomRatio
(
-
101
);
}
catch
(
error
)
{
...
...
@@ -1887,7 +1887,7 @@ export default function CameraErrorCodeUsecaseTest() {
createOutput
(
0
);
mCameraSession
.
addOutput
(
mPreviewOutput
);
mCameraSession
.
addOutput
(
mPhotoOutput
);
try
{
try
{
let
isVSMS
=
mCameraSession
.
isVideoStabilizationModeSupported
(
cameraObj
.
VideoStabilizationMode
.
LOW
);
}
catch
(
error
)
{
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_ERROR_CODE_USECASE_CAPTURESESSION_ISVSMS_0100 FAILED"
);
...
...
@@ -1914,7 +1914,7 @@ export default function CameraErrorCodeUsecaseTest() {
createOutput
(
0
);
mCameraSession
.
addOutput
(
mPreviewOutput
);
mCameraSession
.
addOutput
(
mPhotoOutput
);
try
{
try
{
let
avstmode
=
mCameraSession
.
getActiveVideoStabilizationMode
();
}
catch
(
error
)
{
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_ERROR_CODE_USECASE_CAPTURESESSION_AVSTMODE_0100 FAILED"
);
...
...
@@ -1941,7 +1941,7 @@ export default function CameraErrorCodeUsecaseTest() {
createOutput
(
0
);
mCameraSession
.
addOutput
(
mPreviewOutput
);
mCameraSession
.
addOutput
(
mPhotoOutput
);
try
{
try
{
mCameraSession
.
setVideoStabilizationMode
(
cameraObj
.
VideoStabilizationMode
.
LOW
);
}
catch
(
error
)
{
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_ERROR_CODE_USECASE_CAPTURESESSION_SETVSTMODE_0100 FAILED"
);
...
...
@@ -1970,7 +1970,7 @@ export default function CameraErrorCodeUsecaseTest() {
mCameraSession
.
addOutput
(
mPhotoOutput
);
await
commitCameraSessionConfig
();
await
mCameraSession
.
start
();
try
{
try
{
mCameraSession
.
setVideoStabilizationMode
(
5
);
}
catch
(
error
)
{
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_ERROR_CODE_USECASE_CAPTURESESSION_SETVSTMODE_0101 FAILED"
);
...
...
@@ -2240,7 +2240,7 @@ export default function CameraErrorCodeUsecaseTest() {
mCameraSession
.
addOutput
(
mPreviewOutput
);
mCameraSession
.
addOutput
(
mPhotoOutput
);
await
commitCameraSessionConfig
();
mPhotoOutput
.
capture
(
captureSetting
,
async
(
err
)
=>
{
mPhotoOutput
.
capture
(
captureSetting
,
async
(
err
)
=>
{
if
(
!
err
)
{
expect
(
true
)
.
assertTrue
();
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_ERROR_CODE_USECASE_PHOTOOUTPUT_CAPTURE_0700 success"
);
...
...
multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraJSUnitOutput.test.ets
浏览文件 @
9ff621c1
...
...
@@ -1226,12 +1226,20 @@ export default function cameraJSUnitOutput() {
}
else
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_CAPTURE_START_0100 to operate"
);
let
count
=
0
;
photoOutput
.
on
(
'captureStart'
,
async
(
data
)
=>
{
count
++
;
photoOutput
.
on
(
'captureStart'
,
async
(
err
,
data
)
=>
{
if
(
!
err
)
{
expect
(
true
)
.
assertTrue
();
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_CAPTURE_START_0100 success"
);
await
sleep
(
1000
);
done
();
// count++;
// console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_CAPTURE_START_0100 success");
// await sleep(1000);
// done();
}
else
{
expect
()
.
assertFail
();
console
.
info
(
TAG
+
"Error in SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_CAPTURE_START_0100 FAILED: "
+
err
.
message
);
}
})
await
sleep
(
1000
);
photoOutput
.
capture
();
// expect(count == 1).assertTrue();
}
...
...
@@ -1297,13 +1305,16 @@ export default function cameraJSUnitOutput() {
}
else
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_CAPTURE_END_0100 to operate"
);
let
count
=
0
;
photoOutput
.
on
(
'captureEnd'
,
async
(
data
)
=>
{
photoOutput
.
on
(
'captureEnd'
,
async
(
err
,
data
)
=>
{
if
(
!
err
)
{
count
++
;
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_CAPTURE_END_0100 success"
);
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_CAPTURE_END_0100, captureId = "
+
data
.
captureId
);
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_CAPTURE_END_0100, frameCount = "
+
data
.
frameCount
);
await
sleep
(
1000
);
done
();
}
else
{
expect
()
.
assertFail
();
console
.
info
(
TAG
+
"Error in SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_CAPTURE_END_0100 FAILED: "
+
err
.
message
);
}
})
await
sleep
(
1000
);
done
();
...
...
@@ -1332,11 +1343,11 @@ export default function cameraJSUnitOutput() {
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_ERROR_0100 to operate"
);
photoOutput
.
on
(
'error'
,
async
(
err
,
data
)
=>
{
if
(
!
err
)
{
expect
(
true
)
.
assertTrue
();
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_ERROR_0100 success"
);
expect
(
true
)
.
assertTrue
();
}
else
{
expect
()
.
assertFail
();
console
.
info
(
TAG
+
"Error in SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_ERROR_0100 FAILED: "
+
err
.
message
);
expect
()
.
assertFail
();
}
await
sleep
(
1000
);
done
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录