Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
e2e5373e
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看板
未验证
提交
e2e5373e
编写于
8月 22, 2023
作者:
O
openharmony_ci
提交者:
Gitee
8月 22, 2023
浏览文件
操作
浏览文件
下载
差异文件
!9777 测试代码失败项修复,以及部分测试逻辑优化
Merge pull request !9777 from zvanxu/master
上级
feef02bf
3986307e
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
98 addition
and
124 deletion
+98
-124
multimedia/audio/audio_js_standard/AudioManagerEnhance/src/main/ets/test/Const.ets
..._standard/AudioManagerEnhance/src/main/ets/test/Const.ets
+4
-1
multimedia/audio/audio_js_standard/AudioManagerEnhance/src/main/ets/test/GetMax_Minvolume.test.ets
...anagerEnhance/src/main/ets/test/GetMax_Minvolume.test.ets
+10
-14
multimedia/audio/audio_js_standard/AudioManagerEnhance/src/main/ets/test/GetSystemVolumeInDb.test.ets
...gerEnhance/src/main/ets/test/GetSystemVolumeInDb.test.ets
+10
-10
multimedia/audio/audio_js_standard/AudioManagerEnhance/src/main/ets/test/IsVolumeUnadjustable.test.ets
...erEnhance/src/main/ets/test/IsVolumeUnadjustable.test.ets
+1
-1
multimedia/audio/audio_js_standard/AudioRendererEnhance/src/main/ets/test/Const.ets
...standard/AudioRendererEnhance/src/main/ets/test/Const.ets
+4
-0
multimedia/audio/audio_js_standard/AudioRendererEnhance/src/main/ets/test/GetCurrentOutputDevices.test.ets
...nhance/src/main/ets/test/GetCurrentOutputDevices.test.ets
+4
-4
multimedia/audio/audio_js_standard/AudioRendererEnhance/src/main/ets/test/GetMaxAndMinStreamVolume.test.ets
...hance/src/main/ets/test/GetMaxAndMinStreamVolume.test.ets
+37
-58
multimedia/audio/audio_js_standard/AudioRendererEnhance/src/main/ets/test/GetUnderflowCount.test.ets
...dererEnhance/src/main/ets/test/GetUnderflowCount.test.ets
+28
-36
未找到文件。
multimedia/audio/audio_js_standard/AudioManagerEnhance/src/main/ets/test/Const.ets
浏览文件 @
e2e5373e
...
...
@@ -23,4 +23,7 @@ export const OUTPUT_NUMBER_1 = 1;
export const INVALID_INPUT_PARAMETER_401 = 401;
export const INVALID_INPUT_PARAMETER_6800101 = 6800101;
export const UNSUPORTED_OPTION_6800104 = 6800104;
export const DEAFULT_MEDIA_DB = 0.08370080590248108;
\ No newline at end of file
export const DEAFULT_MEDIA_DB = 0.08370080590248108;
//---------------AudioVolumeType: not steamapi------------------
export const AudioVolumeType = [0, 2, 3, 4, 5, 9];
\ No newline at end of file
multimedia/audio/audio_js_standard/AudioManagerEnhance/src/main/ets/test/GetMax_Minvolume.test.ets
浏览文件 @
e2e5373e
...
...
@@ -85,13 +85,11 @@ export default function audioManagerTest() {
try
{
let
maxvol
;
var
maxvol1
=
new
ArrayList
<
Number
>
();
var
maxvol2
=
[
15
,
15
,
15
,
15
,
15
,
15
,
15
];
for
(
let
index
in
audio
.
AudioVolumeType
){
maxvol
=
await
audioVolumeGroupManager
.
getMaxVolume
(
audio
.
AudioVolumeType
[
index
]);
console
.
info
(
`${index} max volume : ${maxvol}`
);
if
(
index
!=
'ALL'
){
maxvol1
.
add
(
maxvol
);
}
var
maxvol2
=
[
15
,
15
,
15
,
15
,
15
,
15
];
for
(
let
index
=
0
;
index
<
env
.
AudioVolumeType
.
length
;
index
++
)
{
maxvol
=
await
audioVolumeGroupManager
.
getMaxVolume
(
env
.
AudioVolumeType
[
index
]);
console
.
info
(
`${env.AudioVolumeType[index]} max volume : ${maxvol}`
);
maxvol1
.
add
(
maxvol
);
}
for
(
let
i
=
0
;
i
<
maxvol1
.
length
;
i
++
){
console
.
info
(
`check maxvolume: maxvol1 : ${maxvol1[i]}, maxvol2 : ${maxvol2[i]}`
);
...
...
@@ -117,13 +115,11 @@ export default function audioManagerTest() {
try
{
let
minvol
;
var
minvol1
=
new
ArrayList
<
Number
>
();
var
minvol2
=
[
1
,
1
,
0
,
0
,
0
,
1
,
1
];
for
(
let
index
in
audio
.
AudioVolumeType
){
minvol
=
await
audioVolumeGroupManager
.
getMinVolume
(
audio
.
AudioVolumeType
[
index
]);
console
.
info
(
`${index} min volume : ${minvol}`
);
if
(
index
!=
'ALL'
){
minvol1
.
add
(
minvol
);
}
var
minvol2
=
[
1
,
0
,
0
,
1
,
1
,
1
];
for
(
let
index
=
0
;
index
<
env
.
AudioVolumeType
.
length
;
index
++
)
{
minvol
=
await
audioVolumeGroupManager
.
getMinVolume
(
env
.
AudioVolumeType
[
index
]);
console
.
info
(
`${env.AudioVolumeType[index]} min volume : ${minvol}`
);
minvol1
.
add
(
minvol
);
}
for
(
let
i
=
0
;
i
<
minvol1
.
length
;
i
++
){
console
.
info
(
`check minvolume minvol1 : ${minvol1[i]}, minvol2 : ${minvol2[i]}`
);
...
...
multimedia/audio/audio_js_standard/AudioManagerEnhance/src/main/ets/test/GetSystemVolumeInDb.test.ets
浏览文件 @
e2e5373e
...
...
@@ -116,15 +116,15 @@ export default function audioManagerTest() {
it
(
'SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_GETSYSTEMVOLUMEINDB_PROMISE_0200'
,
0
,
async
function
(
done
)
{
try
{
var
db1
=
new
ArrayList
<
Number
>
();
var
db2
=
[
0.06932847946882248
,
0.0
6932847946882248
,
0.08370080590248108
,
0.08370080590248108
,
0.08370080590248108
,
0.06932847946882248
,
0.06932847946882248
,
0.0837008059024810
8
];
for
(
let
index
in
audio
.
AudioVolumeType
)
{
await
audioVolumeGroupManager
.
getSystemVolumeInDb
(
audio
.
AudioVolumeType
[
index
],
3
,
audio
.
DeviceType
.
SPEAKER
)
var
db2
=
[
0.06932847946882248
,
0.0
8370080590248108
,
0.08370080590248108
,
0.06932847946882248
,
0.06932847946882248
,
0.0693284794688224
8
];
for
(
let
index
=
0
;
index
<
env
.
AudioVolumeType
.
length
;
index
++
)
{
await
audioVolumeGroupManager
.
getSystemVolumeInDb
(
env
.
AudioVolumeType
[
index
],
3
,
audio
.
DeviceType
.
SPEAKER
)
.
then
((
data
)
=>
{
console
.
info
(
`${
index
} getSystemVolumeInDb :SUCCESS ${data}`
);
console
.
info
(
`${
env.AudioVolumeType[index]
} getSystemVolumeInDb :SUCCESS ${data}`
);
db1
.
add
(
data
);
})
.
catch
((
error
)
=>
{
console
.
log
(
`${TagFrmwk}: ${
index
} getSystemVolumeInDb : error ${error}`
);
console
.
log
(
`${TagFrmwk}: ${
env.AudioVolumeType[index]
} getSystemVolumeInDb : error ${error}`
);
expect
(
false
)
.
assertTrue
();
done
();
});
...
...
@@ -520,11 +520,11 @@ export default function audioManagerTest() {
var
db2
=
new
ArrayList
<
Number
>
();
var
device
=
[
audio
.
DeviceType
.
SPEAKER
,
audio
.
DeviceType
.
EARPIECE
,
audio
.
DeviceType
.
WIRED_HEADSET
];
for
(
var
deviceIndex
=
0
;
deviceIndex
<
device
.
length
;
deviceIndex
++
)
{
for
(
let
typeIndex
in
audio
.
AudioVolumeType
)
{
let
maxVol
=
await
audioVolumeGroupManager
.
getMaxVolume
(
audio
.
AudioVolumeType
[
typeIndex
]);
let
minVol
=
await
audioVolumeGroupManager
.
getMinVolume
(
audio
.
AudioVolumeType
[
typeIndex
]);
for
(
let
typeIndex
=
0
;
typeIndex
<
env
.
AudioVolumeType
.
length
;
typeIndex
++
)
{
let
maxVol
=
await
audioVolumeGroupManager
.
getMaxVolume
(
env
.
AudioVolumeType
[
typeIndex
]);
let
minVol
=
await
audioVolumeGroupManager
.
getMinVolume
(
env
.
AudioVolumeType
[
typeIndex
]);
for
(
let
volIndex
=
minVol
;
volIndex
<=
maxVol
;
volIndex
++
)
{
await
audioVolumeGroupManager
.
getSystemVolumeInDb
(
audio
.
AudioVolumeType
[
typeIndex
],
volIndex
,
device
[
deviceIndex
],
(
err
,
data
)
=>
{
await
audioVolumeGroupManager
.
getSystemVolumeInDb
(
env
.
AudioVolumeType
[
typeIndex
],
volIndex
,
device
[
deviceIndex
],
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
info
(
`getSystemVolumeInDb : error ${err.message} ${err.code}`
);
expect
(
false
)
.
assertTrue
();
...
...
@@ -533,7 +533,7 @@ export default function audioManagerTest() {
db1
.
add
(
data
);
}
});
await
audioVolumeGroupManager
.
getSystemVolumeInDb
(
audio
.
AudioVolumeType
[
typeIndex
],
volIndex
,
device
[
deviceIndex
],
(
err
,
data
)
=>
{
await
audioVolumeGroupManager
.
getSystemVolumeInDb
(
env
.
AudioVolumeType
[
typeIndex
],
volIndex
,
device
[
deviceIndex
],
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
info
(
`getSystemVolumeInDb : error ${err.message} ${err.code}`
);
expect
(
false
)
.
assertTrue
();
...
...
multimedia/audio/audio_js_standard/AudioManagerEnhance/src/main/ets/test/IsVolumeUnadjustable.test.ets
浏览文件 @
e2e5373e
...
...
@@ -106,7 +106,7 @@ export default function audioManagerTest() {
it
(
'SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_ISVOLUMEUNADJUSTABLE_0200'
,
0
,
async
function
(
done
)
{
try
{
let
bol
=
await
audioVolumeGroupManager
.
isVolumeUnadjustable
();
let
vol
=
await
audioVolumeGroupManager
.
getVolume
(
audio
.
AudioVolumeType
.
MEDIA
);
let
vol
=
await
audioVolumeGroupManager
.
get
Min
Volume
(
audio
.
AudioVolumeType
.
MEDIA
);
await
audioVolumeGroupManager
.
setVolume
(
audio
.
AudioVolumeType
.
MEDIA
,
vol
+
1
);
let
vol1
=
await
audioVolumeGroupManager
.
getVolume
(
audio
.
AudioVolumeType
.
MEDIA
);
expect
(
bol
)
.
assertEqual
(
false
);
...
...
multimedia/audio/audio_js_standard/AudioRendererEnhance/src/main/ets/test/Const.ets
浏览文件 @
e2e5373e
...
...
@@ -16,8 +16,12 @@
//public invalid
export const OUTPUT_NUMBER_0 = 0;
export const OUTPUT_NUMBER_1 = 1;
export const OUTPUT_NUMBER_2 = 2;
//--------------------------------------------------------------
export const INVALID_INPUT_PARAMETER_401 = 401;
export const INVALID_INPUT_PARAMETER_6800101 = 6800101;
export const UNSUPORTED_OPTION_6800104 = 6800104;
//----------------StreamUsage: not streamapi--------------------
export const StreamUsage = [0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13];
\ No newline at end of file
multimedia/audio/audio_js_standard/AudioRendererEnhance/src/main/ets/test/GetCurrentOutputDevices.test.ets
浏览文件 @
e2e5373e
...
...
@@ -140,7 +140,7 @@ export default function audioRendererTest() {
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
)
.
assert
LargerOrEqual
(
env
.
OUTPUT_NUMBER_0
);
expect
(
data
.
id
)
.
assert
Equal
(
env
.
OUTPUT_NUMBER_1
);
done
();
})
.
catch
((
error
)
=>
{
console
.
log
(
"${TagFrmwkRender}: getCurrentOutputDevices error = "
+
error
);
...
...
@@ -169,7 +169,7 @@ export default function audioRendererTest() {
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
)
.
assert
LargerOrEqual
(
env
.
OUTPUT_NUMBER_0
);
expect
(
data
.
id
)
.
assert
Equal
(
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`
);
...
...
@@ -210,7 +210,7 @@ export default function audioRendererTest() {
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
)
.
assert
LargerOrEqual
(
env
.
OUTPUT_NUMBER_0
);
expect
(
data
.
id
)
.
assert
Equal
(
env
.
OUTPUT_NUMBER_1
);
done
();
}
});
...
...
@@ -235,7 +235,7 @@ export default function audioRendererTest() {
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
)
.
assert
LargerOrEqual
(
env
.
OUTPUT_NUMBER_0
);
expect
(
data
.
id
)
.
assert
Equal
(
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/GetMaxAndMinStreamVolume.test.ets
浏览文件 @
e2e5373e
...
...
@@ -236,9 +236,8 @@ export default function audioRendererTest() {
* @tc.level : Level 0
*/
it
(
'SUB_MULTIMEDIA_AUDIO_RENDERER_GETMAXSTREAMVOLUME_PROMISE_0300'
,
0
,
async
function
(
done
)
{
let
StreamType
;
try
{
for
(
StreamType
in
audio
.
StreamUsage
)
{
for
(
let
index
=
0
;
index
<
env
.
StreamUsage
.
length
;
index
++
)
{
let
audioRender
;
let
AudioStreamInfo
=
{
samplingRate
:
audio
.
AudioSamplingRate
.
SAMPLE_RATE_44100
,
...
...
@@ -248,7 +247,7 @@ export default function audioRendererTest() {
}
let
AudioRendererInfo
=
{
content
:
audio
.
ContentType
.
CONTENT_TYPE_UNKNOWN
,
usage
:
StreamType
,
usage
:
env
.
StreamUsage
[
index
]
,
rendererFlags
:
0
}
let
AudioRendererOptions
=
{
...
...
@@ -256,24 +255,20 @@ export default function audioRendererTest() {
rendererInfo
:
AudioRendererInfo
}
try
{
if
(
Number
(
audio
.
StreamUsage
[
StreamType
])
!=
9
)
{
await
audio
.
createAudioRenderer
(
AudioRendererOptions
)
.
then
((
data
)
=>
{
audioRender
=
data
;
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : Stream Type: ${StreamType} SUCCESS data state: `
+
Object
.
keys
(
data
));
})
.
catch
((
err
)
=>
{
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : ERROR : `
+
err
.
message
);
});
}
else
{
audioRender
=
audioRen
;
}
await
audio
.
createAudioRenderer
(
AudioRendererOptions
)
.
then
((
data
)
=>
{
audioRender
=
data
;
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : Stream Type: ${env.StreamUsage[index]} SUCCESS data state: `
+
Object
.
keys
(
data
));
})
.
catch
((
err
)
=>
{
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : ERROR : `
+
err
.
message
);
});
}
catch
(
error
)
{
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : catch ERROR : `
+
error
.
code
+
error
.
message
);
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : catch ERROR : `
+
error
.
code
+
error
.
message
);
}
await
audioRender
.
getMaxStreamVolume
()
.
then
((
data
)
=>
{
console
.
info
(
`${TagFrmwkRender}:getMaxStreamVolume:Stream Type: ${
StreamType
} SUCCESS ${data}`
);
console
.
info
(
`${TagFrmwkRender}:getMaxStreamVolume:Stream Type: ${
env.StreamUsage[index]
} SUCCESS ${data}`
);
expect
(
data
)
.
assertEqual
(
env
.
OUTPUT_NUMBER_1
);
})
.
catch
((
error
)
=>
{
console
.
info
(
`${TagFrmwkRender}:getMaxStreamVolume:Stream Type: ${
StreamType
} ERROR : code: ${error.code}, mesage: ${error.message}`
);
console
.
info
(
`${TagFrmwkRender}:getMaxStreamVolume:Stream Type: ${
env.StreamUsage[index]
} ERROR : code: ${error.code}, mesage: ${error.message}`
);
expect
(
false
)
.
assertTrue
();
done
();
});
...
...
@@ -397,9 +392,8 @@ export default function audioRendererTest() {
* @tc.level : Level 0
*/
it
(
'SUB_MULTIMEDIA_AUDIO_RENDERER_GETMINSTREAMVOLUME_PROMISE_0300'
,
0
,
async
function
(
done
)
{
let
StreamType
;
try
{
for
(
StreamType
in
audio
.
StreamUsage
)
{
for
(
let
index
=
0
;
index
<
env
.
StreamUsage
.
length
;
index
++
)
{
let
audioRender
;
let
AudioStreamInfo
=
{
samplingRate
:
audio
.
AudioSamplingRate
.
SAMPLE_RATE_44100
,
...
...
@@ -409,7 +403,7 @@ export default function audioRendererTest() {
}
let
AudioRendererInfo
=
{
content
:
audio
.
ContentType
.
CONTENT_TYPE_UNKNOWN
,
usage
:
StreamType
,
usage
:
env
.
StreamUsage
[
index
]
,
rendererFlags
:
0
}
let
AudioRendererOptions
=
{
...
...
@@ -417,24 +411,20 @@ export default function audioRendererTest() {
rendererInfo
:
AudioRendererInfo
}
try
{
if
(
Number
(
audio
.
StreamUsage
[
StreamType
])
!=
9
)
{
await
audio
.
createAudioRenderer
(
AudioRendererOptions
)
.
then
((
data
)
=>
{
audioRender
=
data
;
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : Stream Type: ${StreamType} SUCCESS data state: `
+
Object
.
keys
(
data
));
})
.
catch
((
err
)
=>
{
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : ERROR : `
+
err
.
message
);
});
}
else
{
audioRender
=
audioRen
;
}
await
audio
.
createAudioRenderer
(
AudioRendererOptions
)
.
then
((
data
)
=>
{
audioRender
=
data
;
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : Stream Type: ${env.StreamUsage[index]} SUCCESS data state: `
+
Object
.
keys
(
data
));
})
.
catch
((
err
)
=>
{
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : ERROR : `
+
err
.
message
);
});
}
catch
(
error
)
{
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : catch ERROR : `
+
error
.
code
+
error
.
message
);
}
await
audioRender
.
getMinStreamVolume
()
.
then
((
data
)
=>
{
console
.
info
(
`${TagFrmwkRender}:getMinStreamVolume:Stream Type: ${
StreamType
} SUCCESS ${data}`
);
console
.
info
(
`${TagFrmwkRender}:getMinStreamVolume:Stream Type: ${
env.StreamUsage[index]
} SUCCESS ${data}`
);
expect
(
data
)
.
assertEqual
(
env
.
OUTPUT_NUMBER_0
);
})
.
catch
((
error
)
=>
{
console
.
info
(
`${TagFrmwkRender}:getMinStreamVolume:Stream Type: ${
StreamType
} ERROR : code: ${error.code}, mesage: ${error.message}`
);
console
.
info
(
`${TagFrmwkRender}:getMinStreamVolume:Stream Type: ${
env.StreamUsage[index]
} ERROR : code: ${error.code}, mesage: ${error.message}`
);
expect
(
false
)
.
assertTrue
();
done
();
});
...
...
@@ -540,9 +530,8 @@ export default function audioRendererTest() {
* @tc.level : Level 0
*/
it
(
'SUB_MULTIMEDIA_AUDIO_RENDERER_GETMAXSTREAMVOLUME_CALLBACK_0300'
,
0
,
async
function
(
done
)
{
let
StreamType
;
try
{
for
(
StreamType
in
audio
.
StreamUsage
)
{
for
(
let
index
=
0
;
index
<
env
.
StreamUsage
.
length
;
index
++
)
{
let
audioRender
;
let
AudioStreamInfo
=
{
samplingRate
:
audio
.
AudioSamplingRate
.
SAMPLE_RATE_44100
,
...
...
@@ -552,7 +541,7 @@ export default function audioRendererTest() {
}
let
AudioRendererInfo
=
{
content
:
audio
.
ContentType
.
CONTENT_TYPE_UNKNOWN
,
usage
:
StreamType
,
usage
:
env
.
StreamUsage
[
index
]
,
rendererFlags
:
0
}
let
AudioRendererOptions
=
{
...
...
@@ -560,16 +549,12 @@ export default function audioRendererTest() {
rendererInfo
:
AudioRendererInfo
}
try
{
if
(
Number
(
audio
.
StreamUsage
[
StreamType
])
!=
9
)
{
await
audio
.
createAudioRenderer
(
AudioRendererOptions
)
.
then
((
data
)
=>
{
audioRender
=
data
;
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : Stream Type: ${StreamType} SUCCESS data state: `
+
Object
.
keys
(
data
));
})
.
catch
((
err
)
=>
{
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : ERROR : `
+
err
.
message
);
});
}
else
{
audioRender
=
audioRen
;
}
await
audio
.
createAudioRenderer
(
AudioRendererOptions
)
.
then
((
data
)
=>
{
audioRender
=
data
;
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : Stream Type: ${env.StreamUsage[index]} SUCCESS data state: `
+
Object
.
keys
(
data
));
})
.
catch
((
err
)
=>
{
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : ERROR : `
+
err
.
message
);
});
}
catch
(
error
)
{
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : catch ERROR : `
+
error
.
code
+
error
.
message
);
}
...
...
@@ -687,10 +672,8 @@ export default function audioRendererTest() {
* @tc.level : Level 0
*/
it
(
'SUB_MULTIMEDIA_AUDIO_RENDERER_GETMINSTREAMVOLUME_CALLBACK_0300'
,
0
,
async
function
(
done
)
{
let
StreamType
;
try
{
for
(
StreamType
in
audio
.
StreamUsage
)
{
for
(
let
index
=
0
;
index
<
env
.
StreamUsage
.
length
;
index
++
)
{
let
audioRender
;
let
AudioStreamInfo
=
{
samplingRate
:
audio
.
AudioSamplingRate
.
SAMPLE_RATE_44100
,
...
...
@@ -700,7 +683,7 @@ export default function audioRendererTest() {
}
let
AudioRendererInfo
=
{
content
:
audio
.
ContentType
.
CONTENT_TYPE_UNKNOWN
,
usage
:
StreamType
,
usage
:
env
.
StreamUsage
[
index
]
,
rendererFlags
:
0
}
let
AudioRendererOptions
=
{
...
...
@@ -708,16 +691,12 @@ export default function audioRendererTest() {
rendererInfo
:
AudioRendererInfo
}
try
{
if
(
Number
(
audio
.
StreamUsage
[
StreamType
])
!=
9
)
{
await
audio
.
createAudioRenderer
(
AudioRendererOptions
)
.
then
((
data
)
=>
{
audioRender
=
data
;
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : Stream Type: ${StreamType} SUCCESS data state: `
+
Object
.
keys
(
data
));
})
.
catch
((
err
)
=>
{
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : ERROR : `
+
err
.
message
);
});
}
else
{
audioRender
=
audioRen
;
}
await
audio
.
createAudioRenderer
(
AudioRendererOptions
)
.
then
((
data
)
=>
{
audioRender
=
data
;
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : Stream Type: ${env.StreamUsage[index]} SUCCESS data state: `
+
Object
.
keys
(
data
));
})
.
catch
((
err
)
=>
{
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : ERROR : `
+
err
.
message
);
});
}
catch
(
error
)
{
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : catch ERROR : `
+
error
.
code
+
error
.
message
);
}
...
...
multimedia/audio/audio_js_standard/AudioRendererEnhance/src/main/ets/test/GetUnderflowCount.test.ets
浏览文件 @
e2e5373e
...
...
@@ -145,7 +145,7 @@ export default function audioRendererTest() {
try
{
await
audioRen
.
getUnderflowCount
()
.
then
((
data
)
=>
{
console
.
info
(
`${TagFrmwkRender}:getUnderflowCount :SUCCESS ${data}`
);
expect
(
data
)
.
assert
LargerOr
Equal
(
env
.
OUTPUT_NUMBER_0
);
expect
(
data
)
.
assertEqual
(
env
.
OUTPUT_NUMBER_0
);
done
();
})
.
catch
((
error
)
=>
{
console
.
log
(
"${TagFrmwkRender}:getUnderflowCount : error = "
+
error
);
...
...
@@ -172,7 +172,8 @@ export default function audioRendererTest() {
try
{
await
renderPlay
();
await
audioRen
.
getUnderflowCount
()
.
then
((
data
)
=>
{
expect
(
data
)
.
assertLargerOrEqual
(
env
.
OUTPUT_NUMBER_0
);
console
.
log
(
`getUnderflowCount :SUCCESS ${data}`
);
expect
(
data
)
.
assertEqual
(
env
.
OUTPUT_NUMBER_2
);
audioRen
.
drain
()
.
then
(()
=>
{
audioRen
.
stop
()
.
then
(()
=>
{
done
();
...
...
@@ -203,9 +204,8 @@ export default function audioRendererTest() {
* @tc.level : Level 0
*/
it
(
'SUB_MULTIMEDIA_AUDIO_RENDERER_GETUNDERFLOWCOUNT_PROMISE_0300'
,
0
,
async
function
(
done
)
{
let
StreamType
;
try
{
for
(
StreamType
in
audio
.
StreamUsage
)
{
for
(
let
index
=
0
;
index
<
env
.
StreamUsage
.
length
;
index
++
)
{
let
audioRender
;
let
AudioStreamInfo
=
{
samplingRate
:
audio
.
AudioSamplingRate
.
SAMPLE_RATE_44100
,
...
...
@@ -215,7 +215,7 @@ export default function audioRendererTest() {
}
let
AudioRendererInfo
=
{
content
:
audio
.
ContentType
.
CONTENT_TYPE_UNKNOWN
,
usage
:
Number
(
audio
.
StreamUsage
[
StreamType
])
,
usage
:
env
.
StreamUsage
[
index
]
,
rendererFlags
:
0
}
let
AudioRendererOptions
=
{
...
...
@@ -223,22 +223,18 @@ export default function audioRendererTest() {
rendererInfo
:
AudioRendererInfo
}
try
{
if
(
Number
(
audio
.
StreamUsage
[
StreamType
])
!=
9
)
{
await
audio
.
createAudioRenderer
(
AudioRendererOptions
)
.
then
((
data
)
=>
{
audioRender
=
data
;
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : Stream Type: ${StreamType}: ${Number(audio.StreamUsage[StreamType])}`
);
})
.
catch
((
err
)
=>
{
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : ERROR : `
+
err
.
code
+
err
.
message
);
});
}
else
{
audioRender
=
audioRen
;
}
await
audio
.
createAudioRenderer
(
AudioRendererOptions
)
.
then
((
data
)
=>
{
audioRender
=
data
;
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : Stream Type: ${env.StreamUsage[index]} success`
);
})
.
catch
((
err
)
=>
{
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : ERROR : `
+
err
.
code
+
err
.
message
);
});
}
catch
(
error
)
{
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : catch ERROR : `
+
error
.
code
+
error
.
message
);
}
await
audioRender
.
getUnderflowCount
()
.
then
((
data
)
=>
{
console
.
info
(
`${TagFrmwkRender}: getUnderflowCount SUCCESS! ${
StreamType
} data ${data}:, now release audiorender`
);
expect
(
data
)
.
assert
LargerOrEqual
(
0
);
console
.
info
(
`${TagFrmwkRender}: getUnderflowCount SUCCESS! ${
env.StreamUsage[index]
} data ${data}:, now release audiorender`
);
expect
(
data
)
.
assert
Equal
(
env
.
OUTPUT_NUMBER_
0
);
})
.
catch
((
error
)
=>
{
console
.
info
(
`${TagFrmwkRender}: getUnderflowCount: ERROR : code: ${error.code}, mesage: ${error.message}`
);
expect
(
false
)
.
assertTrue
();
...
...
@@ -246,7 +242,7 @@ export default function audioRendererTest() {
});
sleep
(
1000
);
await
audioRender
.
release
()
.
then
(()
=>
{
console
.
info
(
`${TagFrmwkRender}: Renderer ${
StreamType
} release SUCCESS! `
);
console
.
info
(
`${TagFrmwkRender}: Renderer ${
env.StreamUsage[index]
} release SUCCESS! `
);
})
.
catch
((
err
)
=>
{
console
.
info
(
`${TagFrmwkRender}: Renderer release ERROR: ${err.message}`
);
});
...
...
@@ -274,7 +270,7 @@ export default function audioRendererTest() {
done
();
}
else
{
console
.
info
(
`${TagFrmwkRender}: getUnderflowCount : Success! ${data}`
);
expect
(
data
)
.
assert
LargerOr
Equal
(
env
.
OUTPUT_NUMBER_0
);
expect
(
data
)
.
assertEqual
(
env
.
OUTPUT_NUMBER_0
);
done
();
}
});
...
...
@@ -297,7 +293,8 @@ export default function audioRendererTest() {
expect
(
false
)
.
assertTrue
();
done
();
}
else
{
expect
(
data
)
.
assertLargerOrEqual
(
env
.
OUTPUT_NUMBER_0
);
console
.
log
(
`getUnderflowCount :SUCCESS ${data}`
);
expect
(
data
)
.
assertEqual
(
env
.
OUTPUT_NUMBER_2
);
audioRen
.
drain
()
.
then
(()
=>
{
audioRen
.
stop
()
.
then
(()
=>
{
done
();
...
...
@@ -325,9 +322,8 @@ export default function audioRendererTest() {
* @tc.level : Level 0
*/
it
(
'SUB_MULTIMEDIA_AUDIO_RENDERER_GETUNDERFLOWCOUNT_CALLBACK_0300'
,
0
,
async
function
(
done
)
{
let
StreamType
;
try
{
for
(
StreamType
in
audio
.
StreamUsage
)
{
for
(
let
index
=
0
;
index
<
env
.
StreamUsage
.
length
;
index
++
)
{
let
audioRender
;
let
AudioStreamInfo
=
{
samplingRate
:
audio
.
AudioSamplingRate
.
SAMPLE_RATE_44100
,
...
...
@@ -337,7 +333,7 @@ export default function audioRendererTest() {
}
let
AudioRendererInfo
=
{
content
:
audio
.
ContentType
.
CONTENT_TYPE_SPEECH
,
usage
:
StreamType
,
usage
:
env
.
StreamUsage
[
index
]
,
rendererFlags
:
0
}
let
AudioRendererOptions
=
{
...
...
@@ -345,16 +341,12 @@ export default function audioRendererTest() {
rendererInfo
:
AudioRendererInfo
}
try
{
if
(
Number
(
audio
.
StreamUsage
[
StreamType
])
!=
9
)
{
await
audio
.
createAudioRenderer
(
AudioRendererOptions
)
.
then
((
data
)
=>
{
audioRender
=
data
;
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : Stream Type: ${StreamType} SUCCESS data state: `
+
Object
.
keys
(
data
));
})
.
catch
((
err
)
=>
{
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : ERROR : `
+
err
.
message
);
});
}
else
{
audioRender
=
audioRen
;
}
await
audio
.
createAudioRenderer
(
AudioRendererOptions
)
.
then
((
data
)
=>
{
audioRender
=
data
;
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : Stream Type: ${env.StreamUsage[index]} SUCCESS data state: `
+
Object
.
keys
(
data
));
})
.
catch
((
err
)
=>
{
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : ERROR : `
+
err
.
message
);
});
}
catch
(
error
)
{
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : catch ERROR : `
+
error
.
code
+
error
.
message
);
}
...
...
@@ -363,13 +355,13 @@ export default function audioRendererTest() {
expect
(
false
)
.
assertTrue
();
done
();
}
else
{
console
.
log
(
`${TagFrmwkRender}:getUnderflowCount StreamType:${
StreamType
} execution success, data: ${JSON.stringify(data)}`
);
expect
(
data
)
.
assert
LargerOr
Equal
(
env
.
OUTPUT_NUMBER_0
);
console
.
log
(
`${TagFrmwkRender}:getUnderflowCount StreamType:${
env.StreamUsage[index]
} execution success, data: ${JSON.stringify(data)}`
);
expect
(
data
)
.
assertEqual
(
env
.
OUTPUT_NUMBER_0
);
}
});
sleep
(
1000
);
await
audioRender
.
release
()
.
then
(()
=>
{
console
.
info
(
`${TagFrmwkRender}: Renderer ${
StreamType
} release : SUCCESS`
);
console
.
info
(
`${TagFrmwkRender}: Renderer ${
env.StreamUsage[index]
} release : SUCCESS`
);
})
.
catch
((
err
)
=>
{
console
.
info
(
`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`
);
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录