Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
500e234a
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看板
提交
500e234a
编写于
10月 29, 2022
作者:
L
lwx1121892
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
<audio新增接口>
Signed-off-by:
N
lwx1121892
<
liuxueqi3@huawei.com
>
上级
828d5131
变更
4
展开全部
隐藏空白更改
内联
并排
Showing
4 changed file
with
599 addition
and
39 deletion
+599
-39
multimedia/audio/audio_js_standard/AudioCapturer/src/main/js/test/AudioCapturer.test.js
...dard/AudioCapturer/src/main/js/test/AudioCapturer.test.js
+102
-0
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioFramework.test.js
...dard/audioManager/src/main/js/test/AudioFramework.test.js
+399
-39
multimedia/audio/audio_js_standard/audioRenderer/src/main/js/test/AudioRenderer.test.js
...dard/audioRenderer/src/main/js/test/AudioRenderer.test.js
+72
-0
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraManagerTest.test.ets
.../src/main/ets/MainAbility/test/CameraManagerTest.test.ets
+26
-0
未找到文件。
multimedia/audio/audio_js_standard/AudioCapturer/src/main/js/test/AudioCapturer.test.js
浏览文件 @
500e234a
...
...
@@ -2415,6 +2415,108 @@ describe('audioCapturer', function () {
done
();
})
/**
*@tc.number : SUB_MULTIMEDIA_AUDIO_REC_PR_VOICE_CHAT_GET_CAPTURER_StreamId_ENUM_0100
*@tc.name : AudioRec-Set1
*@tc.desc : record audio with parameter set 1
*@tc.size : MEDIUM
*@tc.type : Function
*@tc.level : Level 2
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_REC_PR_VOICE_CHAT_GET_CAPTURER_StreamId_ENUM_0100
'
,
2
,
async
function
(
done
)
{
let
audioStreamInfo44100
=
{
samplingRate
:
44100
,
channels
:
1
,
sampleFormat
:
1
,
encodingType
:
0
,
};
let
audioCapturerInfo44100
=
{
source
:
0
,
capturerFlags
:
0
}
let
AudioCapturerOptions
=
{
streamInfo
:
audioStreamInfo44100
,
capturerInfo
:
audioCapturerInfo44100
,
}
let
audioCap
;
try
{
audioCap
=
await
audio
.
createAudioCapturer
(
AudioCapturerOptions
);
}
catch
(
err
)
{
console
.
log
(
`
${
Tag
}
createAudioCapturer err:
${
JSON
.
stringify
(
err
)}
`
);
expect
(
false
).
assertTrue
();
return
done
();
}
try
{
let
audioParamsGet
=
await
audioCap
.
getAudioStreamId
();
console
.
info
(
`
${
Tag
}
SUB_MULTIMEDIA_AUDIO_REC_PR_VOICE_CHAT_GET_CAPTURER_StreamId_ENUM_0100: Capturer CapturerInfo:
${
JSON
.
stringify
(
audioParamsGet
)}
`
);
}
catch
(
err
)
{
console
.
log
(
`
${
Tag
}
SUB_MULTIMEDIA_AUDIO_REC_PR_VOICE_CHAT_GET_CAPTURER_StreamId_ENUM_0100 err:
${
JSON
.
stringify
(
err
)}
`
);
expect
(
false
).
assertTrue
();
}
try
{
await
audioCap
.
release
();
}
catch
(
err
)
{
console
.
log
(
`
${
Tag
}
SUB_MULTIMEDIA_AUDIO_REC_PR_VOICE_CHAT_GET_CAPTURER_StreamId_ENUM_0100 err:
${
JSON
.
stringify
(
err
)}
`
);
expect
(
false
).
assertTrue
();
}
done
();
})
/**
*@tc.number : SUB_MULTIMEDIA_AUDIO_REC_PR_VOICE_CHAT_GET_CAPTURER_StreamId_ENUM_0200
*@tc.name : AudioRec-Set1
*@tc.desc : record audio with parameter set 1
*@tc.size : MEDIUM
*@tc.type : Function
*@tc.level : Level 2
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_REC_PR_VOICE_CHAT_GET_CAPTURER_StreamId_ENUM_0200
'
,
2
,
async
function
(
done
)
{
let
audioStreamInfo44100
=
{
samplingRate
:
44100
,
channels
:
1
,
sampleFormat
:
1
,
encodingType
:
0
,
};
let
audioCapturerInfo44100
=
{
source
:
0
,
capturerFlags
:
0
}
let
AudioCapturerOptions
=
{
streamInfo
:
audioStreamInfo44100
,
capturerInfo
:
audioCapturerInfo44100
,
}
let
audioCap
;
try
{
audioCap
=
await
audio
.
createAudioCapturer
(
AudioCapturerOptions
);
}
catch
(
err
)
{
console
.
log
(
`
${
Tag
}
createAudioCapturer err:
${
JSON
.
stringify
(
err
)}
`
);
expect
(
false
).
assertTrue
();
return
done
();
}
await
audioCap
.
getAudioStreamId
((
err
,
data
)
=>
{
if
(
err
)
{
console
.
info
(
`
${
TagFrmwkRender
}
: SUB_MULTIMEDIA_AUDIO_REC_PR_VOICE_CHAT_GET_CAPTURER_StreamId_ENUM_0200 CALLBACK: error:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
done
();
return
;
}
console
.
info
(
`
${
TagFrmwkRender
}
:SUB_MULTIMEDIA_AUDIO_REC_PR_VOICE_CHAT_GET_CAPTURER_StreamId_ENUM_0200 CALLBACK: SUCCESS
${
data
}
`
);
expect
(
true
).
assertTrue
();
done
();
})
try
{
await
audioCap
.
release
();
}
catch
(
err
)
{
console
.
log
(
`
${
Tag
}
SUB_MULTIMEDIA_AUDIO_REC_PR_VOICE_CHAT_GET_CAPTURER_StreamId_ENUM_0200 err:
${
JSON
.
stringify
(
err
)}
`
);
expect
(
false
).
assertTrue
();
}
done
();
})
/**
*@tc.number : SUB_MULTIMEDIA_AUDIO_REC_VOICE_CHAT_PR_ENUM_AUDIO_STREAM_INFO_INVALID_0100
*@tc.name : AudioRec-Set1
...
...
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioFramework.test.js
浏览文件 @
500e234a
此差异已折叠。
点击以展开。
multimedia/audio/audio_js_standard/audioRenderer/src/main/js/test/AudioRenderer.test.js
浏览文件 @
500e234a
...
...
@@ -8137,4 +8137,76 @@ describe('audioRenderer', function () {
done
();
}
})
/*
* @tc.name:SUB_MULTIMEDIA_AUDIO_getAudioStreamId_0600
* @tc.desc:getAudioStreamId mode 2,set it to default SHARE_MODE
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it
(
"
SUB_MULTIMEDIA_AUDIO_getAudioStreamId_0100
"
,
2
,
async
function
(
done
)
{
let
audioStreamInfo
=
{
samplingRate
:
audio
.
AudioSamplingRate
.
SAMPLE_RATE_48000
,
channels
:
audio
.
AudioChannel
.
CHANNEL_1
,
sampleFormat
:
audio
.
AudioSampleFormat
.
SAMPLE_FORMAT_S16LE
,
encodingType
:
audio
.
AudioEncodingType
.
ENCODING_TYPE_RAW
}
let
audioRendererInfo
=
{
content
:
audio
.
ContentType
.
CONTENT_TYPE_MUSIC
,
usage
:
audio
.
StreamUsage
.
STREAM_USAGE_MEDIA
,
rendererFlags
:
0
}
let
audioRendererOptions
=
{
streamInfo
:
audioStreamInfo
,
rendererInfo
:
audioRendererInfo
}
let
audioRenderer
=
await
audio
.
createAudioRenderer
(
audioRendererOptions
);
try
{
let
data
=
await
audioRenderer
.
getAudioStreamId
();
console
.
info
(
`
${
TagFrmwkRender
}
: SUB_MULTIMEDIA_AUDIO_getAudioStreamId_0100 OUT OF BORDER PROMISE: SUCCESS
${
data
}
`
);
expect
(
true
).
assertTrue
();
done
();
}
catch
(
err
)
{
console
.
info
(
`
${
TagFrmwkRender
}
: SUB_MULTIMEDIA_AUDIO_getAudioStreamId_0100 OUT OF BORDER PROMISE: ERROR:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
done
();
}
})
/*
* @tc.name:SUB_MULTIMEDIA_AUDIO_getAudioStreamId_0200
* @tc.desc:getAudioStreamId callback,is independent mode
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it
(
"
SUB_MULTIMEDIA_AUDIO_getAudioStreamId_0200
"
,
2
,
async
function
(
done
)
{
let
audioStreamInfo
=
{
samplingRate
:
audio
.
AudioSamplingRate
.
SAMPLE_RATE_48000
,
channels
:
audio
.
AudioChannel
.
CHANNEL_1
,
sampleFormat
:
audio
.
AudioSampleFormat
.
SAMPLE_FORMAT_S16LE
,
encodingType
:
audio
.
AudioEncodingType
.
ENCODING_TYPE_RAW
}
let
audioRendererInfo
=
{
content
:
audio
.
ContentType
.
CONTENT_TYPE_MUSIC
,
usage
:
audio
.
StreamUsage
.
STREAM_USAGE_MEDIA
,
rendererFlags
:
0
}
let
audioRendererOptions
=
{
streamInfo
:
audioStreamInfo
,
rendererInfo
:
audioRendererInfo
}
let
audioRenderer
=
await
audio
.
createAudioRenderer
(
audioRendererOptions
);
await
audioRenderer
.
getAudioStreamId
((
err
,
data
)
=>
{
if
(
err
)
{
console
.
info
(
`
${
TagFrmwkRender
}
: SetInterruptMode INDEPENDENT_MODE CALLBACK: error:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
done
();
return
;
}
console
.
info
(
`
${
TagFrmwkRender
}
: SetInterruptMode INDEPENDENT_MODE CALLBACK: SUCCESS
${
data
}
`
);
expect
(
true
).
assertTrue
();
done
();
})
})
})
\ No newline at end of file
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraManagerTest.test.ets
浏览文件 @
500e234a
...
...
@@ -1058,5 +1058,31 @@ describe('CameraManagerTest', function () {
await
sleep
(
1000
);
done
();
})
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_IS_CAMERA_MUTED_0100
* @tc.name : Get camera mute
* @tc.desc : Get camera mute
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'SUB_MULTIMEDIA_CAMERA_IS_CAMERA_MUTED_0100'
,
2
,
async
function
(
done
)
{
console
.
info
(
TAG
+
"--------------SUB_MULTIMEDIA_CAMERA_IS_CAMERA_MUTED_0100--------------"
);
if
(
isEmpty
(
mCameraManager
))
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_IS_CAMERA_MUTED_0100 cameraManager == null || undefined"
)
expect
()
.
assertFail
();
}
try
{
let
isCameraMuted
=
mCameraManager
.
isCameraMuted
();
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_IS_CAMERA_MUTED_0100 isCameraMuted : "
+
isCameraMuted
);
expect
(
isEmpty
(
isCameraMuted
))
.
assertFalse
();
}
catch
(
err
)
{
console
.
log
(
TAG
+
"isCameraMuted has failed for "
+
err
.
message
);
expect
()
.
assertFail
();
}
await
sleep
(
1000
);
done
();
})
})
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录