Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
42134748
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看板
未验证
提交
42134748
编写于
8月 31, 2023
作者:
O
openharmony_ci
提交者:
Gitee
8月 31, 2023
浏览文件
操作
浏览文件
下载
差异文件
!9950 修改部分接口的断言方式
Merge pull request !9950 from zvanxu/master
上级
c09d1cab
7d6a4745
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
22 addition
and
18 deletion
+22
-18
multimedia/audio/audio_js_standard/AudioRendererEnhance/src/main/ets/test/GetCurrentOutputDevices.test.ets
...nhance/src/main/ets/test/GetCurrentOutputDevices.test.ets
+20
-16
multimedia/audio/audio_js_standard/AudioRendererEnhance/src/main/ets/test/GetUnderflowCount.test.ets
...dererEnhance/src/main/ets/test/GetUnderflowCount.test.ets
+2
-2
未找到文件。
multimedia/audio/audio_js_standard/AudioRendererEnhance/src/main/ets/test/GetCurrentOutputDevices.test.ets
浏览文件 @
42134748
...
...
@@ -137,10 +137,11 @@ export default function audioRendererTest() {
it
(
'SUB_MULTIMEDIA_AUDIO_RENDERER_GETCURRENTOUTPUTDEVICES_PROMISE_0100'
,
0
,
async
function
(
done
)
{
try
{
await
audioRen
.
getCurrentOutputDevices
()
.
then
((
data
)
=>
{
console
.
info
(
`${TagFrmwkRender}: deviceRole:${data.deviceRole}, deviceType:${data.deviceType}, id:${data.id}, name:${data.name}, address:${data.address}, sampleRates:${data.sampleRates}, channelCounts:${data.channelCounts}, channelMasks:${data.channelMasks}`
);
expect
(
data
.
deviceRole
)
.
assertEqual
(
audio
.
DeviceRole
.
OUTPUT_DEVICE
);
expect
(
data
.
deviceType
)
.
assertEqual
(
audio
.
DeviceType
.
SPEAKER
);
expect
(
data
.
id
)
.
assertEqual
(
env
.
OUTPUT_NUMBER_1
);
console
.
info
(
`${TagFrmwkRender}: deviceRole:${data[0].deviceRole}, deviceType:${data[0].deviceType}, id:${data[0].id}, name:${data[0].name},
address:${data[0].address}, sampleRates:${data[0].sampleRates}, channelCounts:${data[0].channelCounts}, channelMasks:${data[0].channelMasks}`
);
expect
(
data
[
0
]
.
deviceRole
)
.
assertEqual
(
audio
.
DeviceRole
.
OUTPUT_DEVICE
);
expect
(
data
[
0
]
.
deviceType
)
.
assertEqual
(
audio
.
DeviceType
.
SPEAKER
);
expect
(
data
[
0
]
.
id
)
.
assertEqual
(
env
.
OUTPUT_NUMBER_1
);
done
();
})
.
catch
((
error
)
=>
{
console
.
log
(
"${TagFrmwkRender}: getCurrentOutputDevices error = "
+
error
);
...
...
@@ -166,10 +167,11 @@ export default function audioRendererTest() {
try
{
await
renderPlay
();
await
audioRen
.
getCurrentOutputDevices
()
.
then
((
data
)
=>
{
console
.
info
(
`${TagFrmwkRender}: deviceRole:${data.deviceRole}, deviceType:${data.deviceType}, id:${data.id}, address:${data.address}, sampleRates:${data.sampleRates}, channelCounts:${data.channelCounts}, channelMasks:${data.channelMasks}`
);
expect
(
data
.
deviceRole
)
.
assertEqual
(
audio
.
DeviceRole
.
OUTPUT_DEVICE
);
expect
(
data
.
deviceType
)
.
assertEqual
(
audio
.
DeviceType
.
SPEAKER
);
expect
(
data
.
id
)
.
assertEqual
(
env
.
OUTPUT_NUMBER_1
);
console
.
info
(
`${TagFrmwkRender}: deviceRole:${data[0].deviceRole}, deviceType:${data[0].deviceType}, id:${data[0].id},
address:${data[0].address}, sampleRates:${data[0].sampleRates}, channelCounts:${data[0].channelCounts}, channelMasks:${data[0].channelMasks}`
);
expect
(
data
[
0
]
.
deviceRole
)
.
assertEqual
(
audio
.
DeviceRole
.
OUTPUT_DEVICE
);
expect
(
data
[
0
]
.
deviceType
)
.
assertEqual
(
audio
.
DeviceType
.
SPEAKER
);
expect
(
data
[
0
]
.
id
)
.
assertEqual
(
env
.
OUTPUT_NUMBER_1
);
console
.
info
(
`${TagFrmwkRender}: Renderer get current output device SUCCESS, now stop audiorender`
);
audioRen
.
drain
()
.
then
(()
=>
{
console
.
info
(
`${TagFrmwkRender}: Renderer drain : SUCCESS, stop audiorender`
);
...
...
@@ -207,10 +209,11 @@ export default function audioRendererTest() {
console
.
info
(
`${TagFrmwkRender}: getCurrentOutputDevices ERROR ! code: ${err.code}, mesage: ${err.message}`
);
expect
(
false
)
.
assertTrue
();
}
else
{
console
.
info
(
`${TagFrmwkRender}: deviceRole:${data.deviceRole}, deviceType:${data.deviceType}, id:${data.id}, address:${data.address}, sampleRates:${data.sampleRates}, channelCounts:${data.channelCounts}, channelMasks:${data.channelMasks}`
);
expect
(
data
.
deviceRole
)
.
assertEqual
(
audio
.
DeviceRole
.
OUTPUT_DEVICE
);
expect
(
data
.
deviceType
)
.
assertEqual
(
audio
.
DeviceType
.
SPEAKER
);
expect
(
data
.
id
)
.
assertEqual
(
env
.
OUTPUT_NUMBER_1
);
console
.
info
(
`${TagFrmwkRender}: deviceRole:${data[0].deviceRole}, deviceType:${data[0].deviceType}, id:${data[0].id},
address:${data[0].address}, sampleRates:${data[0].sampleRates}, channelCounts:${data[0].channelCounts}, channelMasks:${data[0].channelMasks}`
);
expect
(
data
[
0
]
.
deviceRole
)
.
assertEqual
(
audio
.
DeviceRole
.
OUTPUT_DEVICE
);
expect
(
data
[
0
]
.
deviceType
)
.
assertEqual
(
audio
.
DeviceType
.
SPEAKER
);
expect
(
data
[
0
]
.
id
)
.
assertEqual
(
env
.
OUTPUT_NUMBER_1
);
done
();
}
});
...
...
@@ -232,10 +235,11 @@ export default function audioRendererTest() {
expect
(
false
)
.
assertTrue
();
done
();
}
else
{
console
.
info
(
`${TagFrmwkRender}: getCurrentOutputDevices :deviceRole:${data.deviceRole}, deviceType:${data.deviceType}, id:${data.id}, address:${data.address}, sampleRates:${data.sampleRates}, channelCounts:${data.channelCounts}, channelMasks:${data.channelMasks}`
);
expect
(
data
.
deviceRole
)
.
assertEqual
(
audio
.
DeviceRole
.
OUTPUT_DEVICE
);
expect
(
data
.
deviceType
)
.
assertEqual
(
audio
.
DeviceType
.
SPEAKER
);
expect
(
data
.
id
)
.
assertEqual
(
env
.
OUTPUT_NUMBER_1
);
console
.
info
(
`${TagFrmwkRender}: getCurrentOutputDevices :deviceRole:${data[0].deviceRole}, deviceType:${data[0].deviceType}, id:${data[0].id},
address:${data[0].address}, sampleRates:${data[0].sampleRates}, channelCounts:${data[0].channelCounts}, channelMasks:${data[0].channelMasks}`
);
expect
(
data
[
0
]
.
deviceRole
)
.
assertEqual
(
audio
.
DeviceRole
.
OUTPUT_DEVICE
);
expect
(
data
[
0
]
.
deviceType
)
.
assertEqual
(
audio
.
DeviceType
.
SPEAKER
);
expect
(
data
[
0
]
.
id
)
.
assertEqual
(
env
.
OUTPUT_NUMBER_1
);
console
.
info
(
`${TagFrmwkRender}: Renderer getCurrentOutputDevices SUCCESS! now stop the audiorenderer`
);
audioRen
.
drain
()
.
then
(()
=>
{
console
.
info
(
`${TagFrmwkRender}: Renderer drain, stop the audiorenderer`
);
...
...
multimedia/audio/audio_js_standard/AudioRendererEnhance/src/main/ets/test/GetUnderflowCount.test.ets
浏览文件 @
42134748
...
...
@@ -173,7 +173,7 @@ export default function audioRendererTest() {
await
renderPlay
();
await
audioRen
.
getUnderflowCount
()
.
then
((
data
)
=>
{
console
.
log
(
`getUnderflowCount :SUCCESS ${data}`
);
expect
(
data
)
.
assert
Equal
(
env
.
OUTPUT_NUMBER_2
);
expect
(
data
)
.
assert
LargerOrEqual
(
env
.
OUTPUT_NUMBER_1
);
audioRen
.
drain
()
.
then
(()
=>
{
audioRen
.
stop
()
.
then
(()
=>
{
done
();
...
...
@@ -294,7 +294,7 @@ export default function audioRendererTest() {
done
();
}
else
{
console
.
log
(
`getUnderflowCount :SUCCESS ${data}`
);
expect
(
data
)
.
assert
Equal
(
env
.
OUTPUT_NUMBER_2
);
expect
(
data
)
.
assert
LargerOrEqual
(
env
.
OUTPUT_NUMBER_1
);
audioRen
.
drain
()
.
then
(()
=>
{
audioRen
.
stop
()
.
then
(()
=>
{
done
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录