Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
4d911162
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看板
提交
4d911162
编写于
7月 26, 2023
作者:
W
wangzx0705
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modifty final acts testcase
Signed-off-by:
N
wangzx0705
<
wangzx0705@thundersoft.com
>
上级
37100992
变更
9
展开全部
显示空白变更内容
内联
并排
Showing
9 changed file
with
595 addition
and
1077 deletion
+595
-1077
multimedia/audio/audio_js_standard/AudioManagerEnhance/src/main/ets/test/Const.ets
..._standard/AudioManagerEnhance/src/main/ets/test/Const.ets
+2
-1
multimedia/audio/audio_js_standard/AudioManagerEnhance/src/main/ets/test/GetSystemVolumeInDb.test.ets
...gerEnhance/src/main/ets/test/GetSystemVolumeInDb.test.ets
+279
-720
multimedia/audio/audio_js_standard/AudioManagerEnhance/src/main/ets/test/List.test.ets
...ndard/AudioManagerEnhance/src/main/ets/test/List.test.ets
+0
-3
multimedia/audio/audio_js_standard/AudioRendererEnhance/Test.json
...ia/audio/audio_js_standard/AudioRendererEnhance/Test.json
+1
-0
multimedia/audio/audio_js_standard/AudioRendererEnhance/src/main/ets/test/GetAndSetRendererSamplingRate.test.ets
.../src/main/ets/test/GetAndSetRendererSamplingRate.test.ets
+0
-1
multimedia/audio/audio_js_standard/AudioRendererEnhance/src/main/ets/test/GetCurrentOutputDevices.test.ets
...nhance/src/main/ets/test/GetCurrentOutputDevices.test.ets
+56
-73
multimedia/audio/audio_js_standard/AudioRendererEnhance/src/main/ets/test/GetMaxAndMinStreamVolume.test.ets
...hance/src/main/ets/test/GetMaxAndMinStreamVolume.test.ets
+66
-60
multimedia/audio/audio_js_standard/AudioRendererEnhance/src/main/ets/test/GetUnderflowCount.test.ets
...dererEnhance/src/main/ets/test/GetUnderflowCount.test.ets
+95
-113
multimedia/audio/audio_js_standard/AudioRendererEnhance/src/main/ets/test/OnOffOutputDeviceChange.test.ets
...nhance/src/main/ets/test/OnOffOutputDeviceChange.test.ets
+96
-106
未找到文件。
multimedia/audio/audio_js_standard/AudioManagerEnhance/src/main/ets/test/Const.ets
浏览文件 @
4d911162
...
@@ -23,3 +23,4 @@ export const OUTPUT_NUMBER_1 = 1;
...
@@ -23,3 +23,4 @@ export const OUTPUT_NUMBER_1 = 1;
export const INVALID_INPUT_PARAMETER_401 = 401;
export const INVALID_INPUT_PARAMETER_401 = 401;
export const INVALID_INPUT_PARAMETER_6800101 = 6800101;
export const INVALID_INPUT_PARAMETER_6800101 = 6800101;
export const UNSUPORTED_OPTION_6800104 = 6800104;
export const UNSUPORTED_OPTION_6800104 = 6800104;
export const DEAFULT_MEDIA_DB = 0.08370080590248108;
\ No newline at end of file
multimedia/audio/audio_js_standard/AudioManagerEnhance/src/main/ets/test/GetSystemVolumeInDb.test.ets
浏览文件 @
4d911162
此差异已折叠。
点击以展开。
multimedia/audio/audio_js_standard/AudioManagerEnhance/src/main/ets/test/List.test.ets
浏览文件 @
4d911162
...
@@ -14,9 +14,6 @@
...
@@ -14,9 +14,6 @@
*/
*/
import isVolumeUnadjustable from './IsVolumeUnadjustable.test.ets';
import isVolumeUnadjustable from './IsVolumeUnadjustable.test.ets';
import getSystemVolumeInDb from './GetSystemVolumeInDb.test.ets';
import getSystemVolumeInDb from './GetSystemVolumeInDb.test.ets';
import adjustVolumeByStep from './AdjustVolumeByStep.test.ets';
import adjustSystemVolumeByStep from './AdjustSystemVolumeByStep.test.ets';
import getDefaultVolume from './GetDefaultVolume.test.ets';
import getMax_Minvolume from './GetMax_Minvolume.test.ets';
import getMax_Minvolume from './GetMax_Minvolume.test.ets';
export default function testsuite() {
export default function testsuite() {
...
...
multimedia/audio/audio_js_standard/AudioRendererEnhance/Test.json
浏览文件 @
4d911162
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
{
{
"type"
:
"ShellKit"
,
"type"
:
"ShellKit"
,
"run-command"
:
[
"run-command"
:
[
"power-shell wakeup"
,
"mkdir -p /data/app/el2/100/base/com.example.xts_test_case/haps/entry/files"
,
"mkdir -p /data/app/el2/100/base/com.example.xts_test_case/haps/entry/files"
,
"chmod 777 -R /data/app/el2/100/base/com.example.xts_test_case/haps/entry"
"chmod 777 -R /data/app/el2/100/base/com.example.xts_test_case/haps/entry"
],
],
...
...
multimedia/audio/audio_js_standard/AudioRendererEnhance/src/main/ets/test/GetAndSetRendererSamplingRate.test.ets
浏览文件 @
4d911162
...
@@ -654,6 +654,5 @@ export default function audioRendererTest() {
...
@@ -654,6 +654,5 @@ export default function audioRendererTest() {
}
}
});
});
});
});
})
})
}
}
\ No newline at end of file
multimedia/audio/audio_js_standard/AudioRendererEnhance/src/main/ets/test/GetCurrentOutputDevices.test.ets
浏览文件 @
4d911162
...
@@ -36,8 +36,8 @@ export default function audioRendererTest() {
...
@@ -36,8 +36,8 @@ export default function audioRendererTest() {
encodingType
:
audio
.
AudioEncodingType
.
ENCODING_TYPE_RAW
encodingType
:
audio
.
AudioEncodingType
.
ENCODING_TYPE_RAW
}
}
let
AudioRendererInfo
=
{
let
AudioRendererInfo
=
{
content
:
audio
.
ContentType
.
CONTENT_TYPE_
SPEECH
,
content
:
audio
.
ContentType
.
CONTENT_TYPE_
UNKNOWN
,
usage
:
audio
.
StreamUsage
.
STREAM_USAGE_
VOICE_COMMUNICATION
,
usage
:
audio
.
StreamUsage
.
STREAM_USAGE_
MEDIA
,
rendererFlags
:
0
rendererFlags
:
0
}
}
let
AudioRendererOptions
=
{
let
AudioRendererOptions
=
{
...
@@ -138,21 +138,17 @@ export default function audioRendererTest() {
...
@@ -138,21 +138,17 @@ export default function audioRendererTest() {
try
{
try
{
await
audioRen
.
getCurrentOutputDevices
()
.
then
((
data
)
=>
{
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}`
);
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}`
);
try
{
expect
(
data
.
deviceRole
)
.
assertEqual
(
audio
.
DeviceRole
.
OUTPUT_DEVICE
);
expect
(
data
.
deviceRole
)
.
assertEqual
(
audio
.
DeviceRole
.
OUTPUT_DEVICE
);
expect
(
data
.
deviceType
)
.
assertEqual
(
audio
.
DeviceType
.
SPEAKER
);
expect
(
data
.
deviceType
)
.
assertEqual
(
audio
.
DeviceType
.
SPEAKER
);
expect
(
data
.
id
)
.
assertLargerOrEqual
(
env
.
OUTPUT_NUMBER_0
);
expect
(
data
.
id
)
.
assertLargerOrEqual
(
env
.
OUTPUT_NUMBER_0
);
}
catch
(
error
)
{
console
.
log
(
'${TagFrmwkRender}: assertion get output deviceinfo failure'
);
}
done
();
done
();
})
.
catch
((
error
)
=>
{
})
.
catch
((
error
)
=>
{
console
.
log
(
"${TagFrmwkRender}: getCurrentOutputDevices
:
error = "
+
error
);
console
.
log
(
"${TagFrmwkRender}: getCurrentOutputDevices error = "
+
error
);
expect
(
false
)
.
assertTrue
();
expect
(
false
)
.
assertTrue
();
done
();
done
();
});
});
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
log
(
"SUB_MULTIMEDIA_AUDIO_RENDERER_GETCURRENTOUTPUTDEVICES_PROMISE_0100: catch error = "
+
error
);
console
.
info
(
`get current output deviceinfo unknown errro: [${error.code}, ${error.message}]`
);
expect
(
false
)
.
assertTrue
();
expect
(
false
)
.
assertTrue
();
done
();
done
();
}
}
...
@@ -173,7 +169,19 @@ export default function audioRendererTest() {
...
@@ -173,7 +169,19 @@ 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}`
);
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
.
deviceRole
)
.
assertEqual
(
audio
.
DeviceRole
.
OUTPUT_DEVICE
);
expect
(
data
.
deviceType
)
.
assertEqual
(
audio
.
DeviceType
.
SPEAKER
);
expect
(
data
.
deviceType
)
.
assertEqual
(
audio
.
DeviceType
.
SPEAKER
);
expect
(
data
.
id
)
.
assertLargerOrEqual
(
0
);
expect
(
data
.
id
)
.
assertLargerOrEqual
(
env
.
OUTPUT_NUMBER_0
);
console
.
info
(
`${TagFrmwkRender}: Renderer get current output device SUCCESS, now stop audiorender`
);
audioRen
.
drain
()
.
then
(()
=>
{
console
.
info
(
`${TagFrmwkRender}: Renderer drain : SUCCESS, stop audiorender`
);
audioRen
.
stop
()
.
then
(()
=>
{
console
.
info
(
`${TagFrmwkRender}: Renderer stopp : SUCCESS`
);
done
();
})
.
catch
((
err
)
=>
{
console
.
info
(
`${TagFrmwkRender}: Renderer stop:ERROR : ${err.message}`
);
});
})
.
catch
((
err
)
=>
{
console
.
error
(
`${TagFrmwkRender}: Renderer drain: ERROR : ${err.message}`
);
});
})
.
catch
((
error
)
=>
{
})
.
catch
((
error
)
=>
{
console
.
log
(
"${TagFrmwkRender}: getCurrentOutputDevices : error = "
+
error
);
console
.
log
(
"${TagFrmwkRender}: getCurrentOutputDevices : error = "
+
error
);
expect
(
false
)
.
assertTrue
();
expect
(
false
)
.
assertTrue
();
...
@@ -183,17 +191,6 @@ export default function audioRendererTest() {
...
@@ -183,17 +191,6 @@ export default function audioRendererTest() {
expect
(
false
)
.
assertTrue
();
expect
(
false
)
.
assertTrue
();
done
();
done
();
}
}
await
audioRen
.
drain
()
.
then
(()
=>
{
console
.
info
(
`${TagFrmwkRender}: Renderer drained : SUCCESS`
);
})
.
catch
((
err
)
=>
{
console
.
error
(
`${TagFrmwkRender}: Renderer drain: ERROR : ${err.message}`
);
});
await
audioRen
.
stop
()
.
then
(()
=>
{
console
.
info
(
`${TagFrmwkRender}: Renderer stopped : SUCCESS`
);
})
.
catch
((
err
)
=>
{
console
.
info
(
`${TagFrmwkRender}: Renderer stop:ERROR : ${err.message}`
);
});
done
();
});
});
/**
/**
...
@@ -205,27 +202,18 @@ export default function audioRendererTest() {
...
@@ -205,27 +202,18 @@ export default function audioRendererTest() {
* @tc.level : Level 0
* @tc.level : Level 0
*/
*/
it
(
'SUB_MULTIMEDIA_AUDIO_RENDERER_GETCURRENTOUTPUTDEVICES_CALLBACK_0100'
,
0
,
async
function
(
done
)
{
it
(
'SUB_MULTIMEDIA_AUDIO_RENDERER_GETCURRENTOUTPUTDEVICES_CALLBACK_0100'
,
0
,
async
function
(
done
)
{
try
{
audioRen
.
getCurrentOutputDevices
((
err
,
data
)
=>
{
await
audioRen
.
getCurrentOutputDevices
((
err
,
data
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
info
(
`${TagFrmwkRender}: ####getCurrentOutputDevices : ERROR :
code: ${err.code}, mesage: ${err.message}`
);
console
.
info
(
`${TagFrmwkRender}: getCurrentOutputDevices ERROR !
code: ${err.code}, mesage: ${err.message}`
);
expect
(
false
)
.
assertTrue
();
expect
(
false
)
.
assertTrue
();
}
else
{
}
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}`
);
console
.
info
(
`${TagFrmwkRender}: deviceRole:${data.deviceRole}, deviceType:${data.deviceType}, id:${data.id}, address:${data.address}, sampleRates:${data.sampleRates}, channelCounts:${data.channelCounts}, channelMasks:${data.channelMasks}`
);
try
{
expect
(
data
.
deviceRole
)
.
assertEqual
(
audio
.
DeviceRole
.
OUTPUT_DEVICE
);
expect
(
data
.
deviceRole
)
.
assertEqual
(
audio
.
DeviceRole
.
OUTPUT_DEVICE
);
expect
(
data
.
deviceType
)
.
assertEqual
(
audio
.
DeviceType
.
SPEAKER
);
expect
(
data
.
deviceType
)
.
assertEqual
(
audio
.
DeviceType
.
SPEAKER
);
expect
(
data
.
id
)
.
assertLargerOrEqual
(
env
.
OUTPUT_NUMBER_0
);
expect
(
data
.
id
)
.
assertLargerOrEqual
(
env
.
OUTPUT_NUMBER_0
);
}
catch
(
error
){
done
();
console
.
log
(
'${TagFrmwkRender}: ######assertion failure'
);
}
}
}
});
});
}
catch
(
error
){
console
.
info
(
`SUB_MULTIMEDIA_AUDIO_RENDERER_GETCURRENTOUTPUTDEVICES_CALLBACK_0100: catch error, error: [${error.code}, ${error.message}]`
);
expect
(
false
)
.
assertTrue
();
};
done
();
});
});
/**
/**
...
@@ -237,36 +225,31 @@ export default function audioRendererTest() {
...
@@ -237,36 +225,31 @@ export default function audioRendererTest() {
* @tc.level : Level 0
* @tc.level : Level 0
*/
*/
it
(
'SUB_MULTIMEDIA_AUDIO_RENDERER_GETCURRENTOUTPUTDEVICES_CALLBACK_0200'
,
0
,
async
function
(
done
)
{
it
(
'SUB_MULTIMEDIA_AUDIO_RENDERER_GETCURRENTOUTPUTDEVICES_CALLBACK_0200'
,
0
,
async
function
(
done
)
{
try
{
await
renderPlay
();
await
renderPlay
();
await
audioRen
.
getCurrentOutputDevices
((
err
,
data
)
=>
{
audioRen
.
getCurrentOutputDevices
((
err
,
data
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
info
(
`${TagFrmwkRender}: ####getCurrentOutputDevices : ERROR : code
: ${err.code}, mesage: ${err.message}`
);
console
.
info
(
`${TagFrmwkRender}: getCurrentOutputDevices ERROR! error
: ${err.code}, mesage: ${err.message}`
);
expect
(
false
)
.
assertTrue
();
expect
(
false
)
.
assertTrue
();
done
();
done
();
}
else
{
}
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}`
);
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
(
true
)
.
assertTrue
();
expect
(
data
.
deviceRole
)
.
assertEqual
(
audio
.
DeviceRole
.
OUTPUT_DEVICE
);
}
expect
(
data
.
deviceType
)
.
assertEqual
(
audio
.
DeviceType
.
SPEAKER
);
});
expect
(
data
.
id
)
.
assertLargerOrEqual
(
env
.
OUTPUT_NUMBER_0
);
}
catch
(
error
){
console
.
info
(
`${TagFrmwkRender}: Renderer getCurrentOutputDevices SUCCESS! now stop the audiorenderer`
);
console
.
info
(
`SUB_MULTIMEDIA_AUDIO_RENDERER_GETCURRENTOUTPUTDEVICES_CALLBACK_0200: catch error, error: [${error.code}, ${error.message}]`
);
audioRen
.
drain
()
.
then
(()
=>
{
expect
(
false
)
.
assertTrue
();
console
.
info
(
`${TagFrmwkRender}: Renderer drain, stop the audiorenderer`
);
audioRen
.
stop
()
.
then
(()
=>
{
console
.
info
(
`${TagFrmwkRender}: Renderer stopp SUCCESS, testcase SUCCESS!`
);
done
();
done
();
};
await
audioRen
.
drain
()
.
then
(()
=>
{
console
.
info
(
`${TagFrmwkRender}: Renderer drained : SUCCESS`
);
})
.
catch
((
err
)
=>
{
})
.
catch
((
err
)
=>
{
console
.
error
(
`${TagFrmwkRender}: Renderer drain:
ERROR : ${err.message}`
);
console
.
info
(
`${TagFrmwkRender}: Renderer stop:
ERROR : ${err.message}`
);
});
});
await
audioRen
.
stop
()
.
then
(()
=>
{
console
.
info
(
`${TagFrmwkRender}: Renderer stopped : SUCCESS`
);
})
.
catch
((
err
)
=>
{
})
.
catch
((
err
)
=>
{
console
.
info
(
`${TagFrmwkRender}: Renderer stop:ERROR : ${err.message}`
);
console
.
error
(
`${TagFrmwkRender}: Renderer drain: ERROR : ${err.message}`
);
});
}
});
});
done
();
});
});
})
})
}
}
multimedia/audio/audio_js_standard/AudioRendererEnhance/src/main/ets/test/GetMaxAndMinStreamVolume.test.ets
浏览文件 @
4d911162
...
@@ -175,16 +175,16 @@ export default function audioRendererTest() {
...
@@ -175,16 +175,16 @@ export default function audioRendererTest() {
it
(
'SUB_MULTIMEDIA_AUDIO_RENDERER_GETMAXSTREAMVOLUME_PROMISE_0100'
,
0
,
async
function
(
done
)
{
it
(
'SUB_MULTIMEDIA_AUDIO_RENDERER_GETMAXSTREAMVOLUME_PROMISE_0100'
,
0
,
async
function
(
done
)
{
try
{
try
{
await
audioRen
.
getMaxStreamVolume
()
.
then
((
data
)
=>
{
await
audioRen
.
getMaxStreamVolume
()
.
then
((
data
)
=>
{
console
.
info
(
`${TagFrmwkRender}:
#####
getMaxStreamVolume :SUCCESS ${data}`
);
console
.
info
(
`${TagFrmwkRender}:getMaxStreamVolume :SUCCESS ${data}`
);
expect
(
data
)
.
assertEqual
(
env
.
OUTPUT_NUMBER_1
);
expect
(
data
)
.
assertEqual
(
env
.
OUTPUT_NUMBER_1
);
done
();
done
();
})
.
catch
((
error
)
=>
{
})
.
catch
((
error
)
=>
{
console
.
log
(
"${TagFrmwkRender}:
#####
getMaxStreamVolume : error = "
+
error
);
console
.
log
(
"${TagFrmwkRender}:getMaxStreamVolume : error = "
+
error
);
expect
(
false
)
.
assertTrue
();
expect
(
false
)
.
assertTrue
();
done
();
done
();
});
});
}
catch
(
error
){
}
catch
(
error
){
console
.
log
(
"
SUB_MULTIMEDIA_AUDIO_RENDERER_GETMAXSTREAMVOLUME_PROMISE_0100:
catch error = "
+
error
);
console
.
log
(
"
GETMAXSTREAMVOLUME
catch error = "
+
error
);
expect
(
false
)
.
assertTrue
();
expect
(
false
)
.
assertTrue
();
done
();
done
();
}
}
...
@@ -202,10 +202,10 @@ export default function audioRendererTest() {
...
@@ -202,10 +202,10 @@ export default function audioRendererTest() {
try
{
try
{
await
renderPlay
();
await
renderPlay
();
await
audioRen
.
getMaxStreamVolume
()
.
then
((
data
)
=>
{
await
audioRen
.
getMaxStreamVolume
()
.
then
((
data
)
=>
{
console
.
info
(
`${TagFrmwkRender}:
#####
getMaxStreamVolume :SUCCESS ${data}`
);
console
.
info
(
`${TagFrmwkRender}:getMaxStreamVolume :SUCCESS ${data}`
);
expect
(
data
)
.
assertEqual
(
env
.
OUTPUT_NUMBER_1
);
expect
(
data
)
.
assertEqual
(
env
.
OUTPUT_NUMBER_1
);
})
.
catch
((
error
)
=>
{
})
.
catch
((
error
)
=>
{
console
.
log
(
"${TagFrmwkRender}:
#####
getMaxStreamVolume : error = "
+
error
);
console
.
log
(
"${TagFrmwkRender}:getMaxStreamVolume : error = "
+
error
);
expect
(
false
)
.
assertTrue
();
expect
(
false
)
.
assertTrue
();
done
();
done
();
});
});
...
@@ -221,7 +221,7 @@ export default function audioRendererTest() {
...
@@ -221,7 +221,7 @@ export default function audioRendererTest() {
});
});
done
();
done
();
}
catch
(
error
){
}
catch
(
error
){
console
.
log
(
"
SUB_MULTIMEDIA_AUDIO_RENDERER_GETMAXSTREAMVOLUME_PROMISE_0200:
catch error = "
+
error
);
console
.
log
(
"
GETMAXSTREAMVOLUME
catch error = "
+
error
);
expect
(
false
)
.
assertTrue
();
expect
(
false
)
.
assertTrue
();
done
();
done
();
}
}
...
@@ -255,24 +255,25 @@ export default function audioRendererTest() {
...
@@ -255,24 +255,25 @@ export default function audioRendererTest() {
streamInfo
:
AudioStreamInfo
,
streamInfo
:
AudioStreamInfo
,
rendererInfo
:
AudioRendererInfo
rendererInfo
:
AudioRendererInfo
}
}
try
{
try
{
if
(
Number
(
audio
.
StreamUsage
[
StreamType
])
!=
9
)
{
await
audio
.
createAudioRenderer
(
AudioRendererOptions
)
.
then
((
data
)
=>
{
await
audio
.
createAudioRenderer
(
AudioRendererOptions
)
.
then
((
data
)
=>
{
audioRender
=
data
;
audioRender
=
data
;
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : Stream Type: ${StreamType} SUCCESS data state: `
+
Object
.
keys
(
data
));
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : Stream Type: ${StreamType} SUCCESS data state: `
+
Object
.
keys
(
data
));
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : Stream Type: ${StreamType} STREAM_USAGE_MEDIA SUCCESS data value: `
+
JSON
.
stringify
(
data
));
})
.
catch
((
err
)
=>
{
})
.
catch
((
err
)
=>
{
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : ERROR : `
+
err
.
message
);
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : ERROR : `
+
err
.
message
);
});
});
}
else
{
audioRender
=
audioRen
;
}
}
catch
(
error
)
{
}
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
)
=>
{
await
audioRender
.
getMaxStreamVolume
()
.
then
((
data
)
=>
{
console
.
info
(
`${TagFrmwkRender}:
####
getMaxStreamVolume:Stream Type: ${StreamType} SUCCESS ${data}`
);
console
.
info
(
`${TagFrmwkRender}:getMaxStreamVolume:Stream Type: ${StreamType} SUCCESS ${data}`
);
expect
(
data
)
.
assertEqual
(
env
.
OUTPUT_NUMBER_1
);
expect
(
data
)
.
assertEqual
(
env
.
OUTPUT_NUMBER_1
);
})
.
catch
((
error
)
=>
{
})
.
catch
((
error
)
=>
{
console
.
info
(
`${TagFrmwkRender}:
#####
getMaxStreamVolume:Stream Type: ${StreamType} ERROR : code: ${error.code}, mesage: ${error.message}`
);
console
.
info
(
`${TagFrmwkRender}:getMaxStreamVolume:Stream Type: ${StreamType} ERROR : code: ${error.code}, mesage: ${error.message}`
);
expect
(
false
)
.
assertTrue
();
expect
(
false
)
.
assertTrue
();
done
();
done
();
});
});
...
@@ -286,7 +287,7 @@ export default function audioRendererTest() {
...
@@ -286,7 +287,7 @@ export default function audioRendererTest() {
}
}
done
();
done
();
}
catch
(
error
){
}
catch
(
error
){
console
.
info
(
`
SUB_MULTIMEDIA_AUDIO_RENDERER_GETMAXSTREAMVOLUME_PROMISE_0300:
Stream ERROR : code: ${error.code}, mesage: ${error.message}`
);
console
.
info
(
`
GETMAXSTREAMVOLUME
Stream ERROR : code: ${error.code}, mesage: ${error.message}`
);
}
}
});
});
...
@@ -301,7 +302,7 @@ export default function audioRendererTest() {
...
@@ -301,7 +302,7 @@ export default function audioRendererTest() {
it
(
'SUB_MULTIMEDIA_AUDIO_RENDERER_GETMAXSTREAMVOLUME_PROMISE_0400'
,
0
,
async
function
(
done
)
{
it
(
'SUB_MULTIMEDIA_AUDIO_RENDERER_GETMAXSTREAMVOLUME_PROMISE_0400'
,
0
,
async
function
(
done
)
{
try
{
try
{
await
audioRen
.
getMaxStreamVolume
()
.
then
((
data
)
=>
{
await
audioRen
.
getMaxStreamVolume
()
.
then
((
data
)
=>
{
console
.
info
(
`${TagFrmwkRender}:
#####
getMaxStreamVolume :SUCCESS ${data}`
);
console
.
info
(
`${TagFrmwkRender}:getMaxStreamVolume :SUCCESS ${data}`
);
expect
(
data
)
.
assertEqual
(
env
.
OUTPUT_NUMBER_1
);
expect
(
data
)
.
assertEqual
(
env
.
OUTPUT_NUMBER_1
);
audioRen
.
setVolume
(
data
)
.
then
(()
=>
{
audioRen
.
setVolume
(
data
)
.
then
(()
=>
{
console
.
info
(
`${TagFrmwkRender}: setVolume to maxVolume Success! maxVolume: ${data}`
);
console
.
info
(
`${TagFrmwkRender}: setVolume to maxVolume Success! maxVolume: ${data}`
);
...
@@ -313,12 +314,12 @@ export default function audioRendererTest() {
...
@@ -313,12 +314,12 @@ export default function audioRendererTest() {
done
();
done
();
});
});
})
.
catch
((
error
)
=>
{
})
.
catch
((
error
)
=>
{
console
.
info
(
`${TagFrmwkRender}:
####
getMaxStreamVolume : ERROR : code: ${error.code}, mesage: ${error.message}`
);
console
.
info
(
`${TagFrmwkRender}:getMaxStreamVolume : ERROR : code: ${error.code}, mesage: ${error.message}`
);
expect
(
false
)
.
assertTrue
();
expect
(
false
)
.
assertTrue
();
done
();
done
();
});
});
}
catch
(
error
){
}
catch
(
error
){
console
.
info
(
`
SUB_MULTIMEDIA_AUDIO_RENDERER_GETMAXSTREAMVOLUME_PROMISE_0400:
catch error, error: [${error.code}, ${error.message}]`
);
console
.
info
(
`
GETMAXSTREAMVOLUME
catch error, error: [${error.code}, ${error.message}]`
);
expect
(
false
)
.
assertTrue
();
expect
(
false
)
.
assertTrue
();
done
();
done
();
}
}
...
@@ -335,16 +336,16 @@ export default function audioRendererTest() {
...
@@ -335,16 +336,16 @@ export default function audioRendererTest() {
it
(
'SUB_MULTIMEDIA_AUDIO_RENDERER_GETMINSTREAMVOLUME_PROMISE_0100'
,
0
,
async
function
(
done
)
{
it
(
'SUB_MULTIMEDIA_AUDIO_RENDERER_GETMINSTREAMVOLUME_PROMISE_0100'
,
0
,
async
function
(
done
)
{
try
{
try
{
await
audioRen
.
getMinStreamVolume
()
.
then
((
data
)
=>
{
await
audioRen
.
getMinStreamVolume
()
.
then
((
data
)
=>
{
console
.
info
(
`${TagFrmwkRender}:
####
getMinStreamVolume :SUCCESS ${data}`
);
console
.
info
(
`${TagFrmwkRender}:getMinStreamVolume :SUCCESS ${data}`
);
expect
(
data
)
.
assertEqual
(
env
.
OUTPUT_NUMBER_0
);
expect
(
data
)
.
assertEqual
(
env
.
OUTPUT_NUMBER_0
);
done
();
done
();
})
.
catch
((
error
)
=>
{
})
.
catch
((
error
)
=>
{
console
.
info
(
`${TagFrmwkRender}:
#####
getMinStreamVolume : ERROR : code: ${error.code}, mesage: ${error.message}`
);
console
.
info
(
`${TagFrmwkRender}:getMinStreamVolume : ERROR : code: ${error.code}, mesage: ${error.message}`
);
expect
(
false
)
.
assertTrue
();
expect
(
false
)
.
assertTrue
();
done
();
done
();
});
});
}
catch
(
error
){
}
catch
(
error
){
console
.
info
(
`
SUB_MULTIMEDIA_AUDIO_RENDERER_GETMINSTREAMVOLUME_PROMISE_0100:
catch error, error: [${error.code}, ${error.message}]`
);
console
.
info
(
`
GETMINSTREAMVOLUME
catch error, error: [${error.code}, ${error.message}]`
);
expect
(
false
)
.
assertTrue
();
expect
(
false
)
.
assertTrue
();
done
();
done
();
}
}
...
@@ -362,10 +363,10 @@ export default function audioRendererTest() {
...
@@ -362,10 +363,10 @@ export default function audioRendererTest() {
try
{
try
{
await
renderPlay
();
await
renderPlay
();
await
audioRen
.
getMinStreamVolume
()
.
then
((
data
)
=>
{
await
audioRen
.
getMinStreamVolume
()
.
then
((
data
)
=>
{
console
.
info
(
`${TagFrmwkRender}:
#####
getMinStreamVolume :SUCCESS ${data}`
);
console
.
info
(
`${TagFrmwkRender}:getMinStreamVolume :SUCCESS ${data}`
);
expect
(
data
)
.
assertEqual
(
env
.
OUTPUT_NUMBER_0
);
expect
(
data
)
.
assertEqual
(
env
.
OUTPUT_NUMBER_0
);
})
.
catch
((
error
)
=>
{
})
.
catch
((
error
)
=>
{
console
.
info
(
`${TagFrmwkRender}:
####
getMinStreamVolume : ERROR : code: ${error.code}, mesage: ${error.message}`
);
console
.
info
(
`${TagFrmwkRender}:getMinStreamVolume : ERROR : code: ${error.code}, mesage: ${error.message}`
);
expect
(
false
)
.
assertTrue
();
expect
(
false
)
.
assertTrue
();
done
();
done
();
});
});
...
@@ -381,7 +382,7 @@ export default function audioRendererTest() {
...
@@ -381,7 +382,7 @@ export default function audioRendererTest() {
});
});
done
();
done
();
}
catch
(
error
){
}
catch
(
error
){
console
.
info
(
`
SUB_MULTIMEDIA_AUDIO_RENDERER_GETMINSTREAMVOLUME_PROMISE_0200:
catch error, error: [${error.code}, ${error.message}]`
);
console
.
info
(
`
GETMINSTREAMVOLUME
catch error, error: [${error.code}, ${error.message}]`
);
expect
(
false
)
.
assertTrue
();
expect
(
false
)
.
assertTrue
();
done
();
done
();
}
}
...
@@ -415,23 +416,25 @@ export default function audioRendererTest() {
...
@@ -415,23 +416,25 @@ export default function audioRendererTest() {
streamInfo
:
AudioStreamInfo
,
streamInfo
:
AudioStreamInfo
,
rendererInfo
:
AudioRendererInfo
rendererInfo
:
AudioRendererInfo
}
}
try
{
try
{
if
(
Number
(
audio
.
StreamUsage
[
StreamType
])
!=
9
)
{
await
audio
.
createAudioRenderer
(
AudioRendererOptions
)
.
then
((
data
)
=>
{
await
audio
.
createAudioRenderer
(
AudioRendererOptions
)
.
then
((
data
)
=>
{
audioRender
=
data
;
audioRender
=
data
;
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : Stream Type: ${StreamType} SUCCESS data state: `
+
Object
.
keys
(
data
));
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : Stream Type: ${StreamType} SUCCESS data state: `
+
Object
.
keys
(
data
));
})
.
catch
((
err
)
=>
{
})
.
catch
((
err
)
=>
{
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : ERROR : `
+
err
.
message
);
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : ERROR : `
+
err
.
message
);
});
});
}
else
{
audioRender
=
audioRen
;
}
}
catch
(
error
)
{
}
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
.
getMinStreamVolume
()
.
then
((
data
)
=>
{
await
audioRender
.
getMinStreamVolume
()
.
then
((
data
)
=>
{
console
.
info
(
`${TagFrmwkRender}:
####
getMinStreamVolume:Stream Type: ${StreamType} SUCCESS ${data}`
);
console
.
info
(
`${TagFrmwkRender}:getMinStreamVolume:Stream Type: ${StreamType} SUCCESS ${data}`
);
expect
(
data
)
.
assertEqual
(
env
.
OUTPUT_NUMBER_0
);
expect
(
data
)
.
assertEqual
(
env
.
OUTPUT_NUMBER_0
);
})
.
catch
((
error
)
=>
{
})
.
catch
((
error
)
=>
{
console
.
info
(
`${TagFrmwkRender}:
#####
getMinStreamVolume:Stream Type: ${StreamType} ERROR : code: ${error.code}, mesage: ${error.message}`
);
console
.
info
(
`${TagFrmwkRender}:getMinStreamVolume:Stream Type: ${StreamType} ERROR : code: ${error.code}, mesage: ${error.message}`
);
expect
(
false
)
.
assertTrue
();
expect
(
false
)
.
assertTrue
();
done
();
done
();
});
});
...
@@ -445,7 +448,7 @@ export default function audioRendererTest() {
...
@@ -445,7 +448,7 @@ export default function audioRendererTest() {
}
}
done
();
done
();
}
catch
(
error
){
}
catch
(
error
){
console
.
info
(
`
SUB_MULTIMEDIA_AUDIO_RENDERER_GETMINSTREAMVOLUME_PROMISE_0300:
Stream ERROR : code: ${error.code}, mesage: ${error.message}`
);
console
.
info
(
`
GETMINSTREAMVOLUME
Stream ERROR : code: ${error.code}, mesage: ${error.message}`
);
}
}
});
});
...
@@ -460,7 +463,7 @@ export default function audioRendererTest() {
...
@@ -460,7 +463,7 @@ export default function audioRendererTest() {
it
(
'SUB_MULTIMEDIA_AUDIO_RENDERER_GETMINSTREAMVOLUME_PROMISE_0400'
,
0
,
async
function
(
done
)
{
it
(
'SUB_MULTIMEDIA_AUDIO_RENDERER_GETMINSTREAMVOLUME_PROMISE_0400'
,
0
,
async
function
(
done
)
{
try
{
try
{
await
audioRen
.
getMinStreamVolume
()
.
then
((
data
)
=>
{
await
audioRen
.
getMinStreamVolume
()
.
then
((
data
)
=>
{
console
.
info
(
`${TagFrmwkRender}:
#####
getMinStreamVolume :SUCCESS ${data}`
);
console
.
info
(
`${TagFrmwkRender}: getMinStreamVolume :SUCCESS ${data}`
);
expect
(
data
)
.
assertEqual
(
env
.
OUTPUT_NUMBER_0
);
expect
(
data
)
.
assertEqual
(
env
.
OUTPUT_NUMBER_0
);
audioRen
.
setVolume
(
data
)
.
then
(()
=>
{
audioRen
.
setVolume
(
data
)
.
then
(()
=>
{
console
.
info
(
`${TagFrmwkRender}: setVolume to minVolume Success! minVolume: ${data}`
);
console
.
info
(
`${TagFrmwkRender}: setVolume to minVolume Success! minVolume: ${data}`
);
...
@@ -472,12 +475,12 @@ export default function audioRendererTest() {
...
@@ -472,12 +475,12 @@ export default function audioRendererTest() {
done
();
done
();
});
});
})
.
catch
((
error
)
=>
{
})
.
catch
((
error
)
=>
{
console
.
info
(
`${TagFrmwkRender}:
####
getMinStreamVolume : ERROR : code: ${error.code}, mesage: ${error.message}`
);
console
.
info
(
`${TagFrmwkRender}:getMinStreamVolume : ERROR : code: ${error.code}, mesage: ${error.message}`
);
expect
(
false
)
.
assertTrue
();
expect
(
false
)
.
assertTrue
();
done
();
done
();
});
});
}
catch
(
error
){
}
catch
(
error
){
console
.
info
(
`
SUB_MULTIMEDIA_AUDIO_RENDERER_GETMINSTREAMVOLUME_PROMISE_0400:
catch error, error: [${error.code}, ${error.message}]`
);
console
.
info
(
`
GETMINSTREAMVOLUME
catch error, error: [${error.code}, ${error.message}]`
);
expect
(
false
)
.
assertTrue
();
expect
(
false
)
.
assertTrue
();
done
();
done
();
}
}
...
@@ -556,19 +559,20 @@ export default function audioRendererTest() {
...
@@ -556,19 +559,20 @@ export default function audioRendererTest() {
streamInfo
:
AudioStreamInfo
,
streamInfo
:
AudioStreamInfo
,
rendererInfo
:
AudioRendererInfo
rendererInfo
:
AudioRendererInfo
}
}
try
{
try
{
if
(
Number
(
audio
.
StreamUsage
[
StreamType
])
!=
9
)
{
await
audio
.
createAudioRenderer
(
AudioRendererOptions
)
.
then
((
data
)
=>
{
await
audio
.
createAudioRenderer
(
AudioRendererOptions
)
.
then
((
data
)
=>
{
audioRender
=
data
;
audioRender
=
data
;
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : Stream Type: ${StreamType} SUCCESS data state: `
+
Object
.
keys
(
data
));
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : Stream Type: ${StreamType} SUCCESS data state: `
+
Object
.
keys
(
data
));
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : Stream Type: ${StreamType} STREAM_USAGE_MEDIA SUCCESS data value: `
+
JSON
.
stringify
(
data
));
})
.
catch
((
err
)
=>
{
})
.
catch
((
err
)
=>
{
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : ERROR : `
+
err
.
message
);
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : ERROR : `
+
err
.
message
);
});
});
}
else
{
audioRender
=
audioRen
;
}
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : catch ERROR : `
+
error
.
code
+
error
.
message
);
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : catch ERROR : `
+
error
.
code
+
error
.
message
);
}
}
audioRen
.
getMaxStreamVolume
((
err
,
maxVolume
)
=>
{
audioRen
.
getMaxStreamVolume
((
err
,
maxVolume
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
'${TagFrmwkRender} Get max stream volume Fail: ${err}'
);
console
.
error
(
'${TagFrmwkRender} Get max stream volume Fail: ${err}'
);
...
@@ -591,7 +595,7 @@ export default function audioRendererTest() {
...
@@ -591,7 +595,7 @@ export default function audioRendererTest() {
done
();
done
();
}
catch
(
error
){
}
catch
(
error
){
console
.
log
(
`${TagFrmwkRender}:
####
getMaxStreamVolume: catch error, error: [${error.code}, ${error.message}]`
);
console
.
log
(
`${TagFrmwkRender}:getMaxStreamVolume: catch error, error: [${error.code}, ${error.message}]`
);
expect
(
false
)
.
assertTrue
();
expect
(
false
)
.
assertTrue
();
done
();
done
();
}
}
...
@@ -703,18 +707,20 @@ export default function audioRendererTest() {
...
@@ -703,18 +707,20 @@ export default function audioRendererTest() {
streamInfo
:
AudioStreamInfo
,
streamInfo
:
AudioStreamInfo
,
rendererInfo
:
AudioRendererInfo
rendererInfo
:
AudioRendererInfo
}
}
try
{
try
{
if
(
Number
(
audio
.
StreamUsage
[
StreamType
])
!=
9
)
{
await
audio
.
createAudioRenderer
(
AudioRendererOptions
)
.
then
((
data
)
=>
{
await
audio
.
createAudioRenderer
(
AudioRendererOptions
)
.
then
((
data
)
=>
{
audioRender
=
data
;
audioRender
=
data
;
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : Stream Type: ${StreamType} SUCCESS data state: `
+
Object
.
keys
(
data
));
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : Stream Type: ${StreamType} SUCCESS data state: `
+
Object
.
keys
(
data
));
})
.
catch
((
err
)
=>
{
})
.
catch
((
err
)
=>
{
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : ERROR : `
+
err
.
message
);
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : ERROR : `
+
err
.
message
);
});
});
}
else
{
audioRender
=
audioRen
;
}
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : catch ERROR : `
+
error
.
code
+
error
.
message
);
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : catch ERROR : `
+
error
.
code
+
error
.
message
);
}
}
audioRen
.
getMinStreamVolume
((
err
,
minVolume
)
=>
{
audioRen
.
getMinStreamVolume
((
err
,
minVolume
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
'${TagFrmwkRender} Get min stream volume Fail: ${err}'
);
console
.
error
(
'${TagFrmwkRender} Get min stream volume Fail: ${err}'
);
...
@@ -735,7 +741,7 @@ export default function audioRendererTest() {
...
@@ -735,7 +741,7 @@ export default function audioRendererTest() {
}
}
done
();
done
();
}
catch
(
error
){
}
catch
(
error
){
console
.
log
(
`${TagFrmwkRender}:
####
getMinStreamVolume: catch error, error: [${error.code}, ${error.message}]`
);
console
.
log
(
`${TagFrmwkRender}:getMinStreamVolume: catch error, error: [${error.code}, ${error.message}]`
);
expect
(
false
)
.
assertTrue
();
expect
(
false
)
.
assertTrue
();
done
();
done
();
}
}
...
...
multimedia/audio/audio_js_standard/AudioRendererEnhance/src/main/ets/test/GetUnderflowCount.test.ets
浏览文件 @
4d911162
...
@@ -36,7 +36,7 @@ export default function audioRendererTest() {
...
@@ -36,7 +36,7 @@ export default function audioRendererTest() {
encodingType
:
audio
.
AudioEncodingType
.
ENCODING_TYPE_RAW
encodingType
:
audio
.
AudioEncodingType
.
ENCODING_TYPE_RAW
}
}
let
AudioRendererInfo
=
{
let
AudioRendererInfo
=
{
content
:
audio
.
ContentType
.
CONTENT_TYPE_
MUSIC
,
content
:
audio
.
ContentType
.
CONTENT_TYPE_
UNKNOWN
,
usage
:
audio
.
StreamUsage
.
STREAM_USAGE_MEDIA
,
usage
:
audio
.
StreamUsage
.
STREAM_USAGE_MEDIA
,
rendererFlags
:
0
rendererFlags
:
0
}
}
...
@@ -144,16 +144,16 @@ export default function audioRendererTest() {
...
@@ -144,16 +144,16 @@ export default function audioRendererTest() {
it
(
'SUB_MULTIMEDIA_AUDIO_RENDERER_GETUNDERFLOWCOUNT_PROMISE_0100'
,
0
,
async
function
(
done
)
{
it
(
'SUB_MULTIMEDIA_AUDIO_RENDERER_GETUNDERFLOWCOUNT_PROMISE_0100'
,
0
,
async
function
(
done
)
{
try
{
try
{
await
audioRen
.
getUnderflowCount
()
.
then
((
data
)
=>
{
await
audioRen
.
getUnderflowCount
()
.
then
((
data
)
=>
{
console
.
info
(
`${TagFrmwkRender}:
####
getUnderflowCount :SUCCESS ${data}`
);
console
.
info
(
`${TagFrmwkRender}:getUnderflowCount :SUCCESS ${data}`
);
expect
(
data
)
.
assertLargerOrEqual
(
env
.
OUTPUT_NUMBER_0
);
expect
(
data
)
.
assertLargerOrEqual
(
env
.
OUTPUT_NUMBER_0
);
done
();
done
();
})
.
catch
((
error
)
=>
{
})
.
catch
((
error
)
=>
{
console
.
log
(
"${TagFrmwkRender}:
####
getUnderflowCount : error = "
+
error
);
console
.
log
(
"${TagFrmwkRender}:getUnderflowCount : error = "
+
error
);
expect
(
false
)
.
assertTrue
();
expect
(
false
)
.
assertTrue
();
done
();
done
();
});
});
}
catch
(
error
){
}
catch
(
error
){
console
.
log
(
"
SUB_MULTIMEDIA_AUDIO_RENDERER_GETUNDERFLOWCOUNT_PROMISE_0100: catch
error = "
+
error
);
console
.
log
(
"
GETUNDERFLOWCOUNT catch unknown
error = "
+
error
);
expect
(
false
)
.
assertTrue
();
expect
(
false
)
.
assertTrue
();
done
();
done
();
}
}
...
@@ -169,29 +169,26 @@ export default function audioRendererTest() {
...
@@ -169,29 +169,26 @@ export default function audioRendererTest() {
* @tc.level : Level 0
* @tc.level : Level 0
*/
*/
it
(
'SUB_MULTIMEDIA_AUDIO_RENDERER_GETUNDERFLOWCOUNT_PROMISE_0200'
,
0
,
async
function
(
done
)
{
it
(
'SUB_MULTIMEDIA_AUDIO_RENDERER_GETUNDERFLOWCOUNT_PROMISE_0200'
,
0
,
async
function
(
done
)
{
try
{
try
{
await
renderPlay
();
await
renderPlay
();
await
audioRen
.
getUnderflowCount
()
.
then
((
data
)
=>
{
await
audioRen
.
getUnderflowCount
()
.
then
((
data
)
=>
{
console
.
info
(
`${TagFrmwkRender}: ####getUnderflowCount :SUCCESS ${data}`
);
expect
(
data
)
.
assertLargerOrEqual
(
env
.
OUTPUT_NUMBER_0
);
expect
(
data
)
.
assertLargerOrEqual
(
env
.
OUTPUT_NUMBER_0
);
})
.
catch
((
error
)
=>
{
audioRen
.
drain
()
.
then
(()
=>
{
console
.
log
(
"${TagFrmwkRender}: ####getUnderflowCount : error = "
+
error
);
audioRen
.
stop
()
.
then
(()
=>
{
expect
(
false
)
.
assertTrue
();
done
();
done
();
});
await
audioRen
.
drain
()
.
then
(()
=>
{
console
.
info
(
`${TagFrmwkRender}: Renderer drained : SUCCESS`
);
})
.
catch
((
err
)
=>
{
})
.
catch
((
err
)
=>
{
console
.
error
(
`${TagFrmwkRender}: Renderer drain:
ERROR : ${err.message}`
);
console
.
info
(
`${TagFrmwkRender}: Renderer stop:
ERROR : ${err.message}`
);
});
});
await
audioRen
.
stop
()
.
then
(()
=>
{
console
.
info
(
`${TagFrmwkRender}: Renderer stopped : SUCCESS`
);
})
.
catch
((
err
)
=>
{
})
.
catch
((
err
)
=>
{
console
.
info
(
`${TagFrmwkRender}: Renderer stop:
ERROR : ${err.message}`
);
console
.
error
(
`${TagFrmwkRender}: Renderer drain:
ERROR : ${err.message}`
);
});
});
})
.
catch
((
error
)
=>
{
console
.
log
(
"${TagFrmwkRender}: getUnderflowCount : error = "
+
error
);
expect
(
false
)
.
assertTrue
();
done
();
done
();
}
catch
(
error
){
});
console
.
log
(
"SUB_MULTIMEDIA_AUDIO_RENDERER_GETUNDERFLOWCOUNT_PROMISE_0200: catch error = "
+
error
);
}
catch
(
error
)
{
console
.
log
(
"GETUNDERFLOWCOUNT catch unknown error = "
+
error
);
expect
(
false
)
.
assertTrue
();
expect
(
false
)
.
assertTrue
();
done
();
done
();
}
}
...
@@ -207,7 +204,7 @@ export default function audioRendererTest() {
...
@@ -207,7 +204,7 @@ export default function audioRendererTest() {
*/
*/
it
(
'SUB_MULTIMEDIA_AUDIO_RENDERER_GETUNDERFLOWCOUNT_PROMISE_0300'
,
0
,
async
function
(
done
)
{
it
(
'SUB_MULTIMEDIA_AUDIO_RENDERER_GETUNDERFLOWCOUNT_PROMISE_0300'
,
0
,
async
function
(
done
)
{
let
StreamType
;
let
StreamType
;
try
{
try
{
for
(
StreamType
in
audio
.
StreamUsage
)
{
for
(
StreamType
in
audio
.
StreamUsage
)
{
let
audioRender
;
let
audioRender
;
let
AudioStreamInfo
=
{
let
AudioStreamInfo
=
{
...
@@ -217,46 +214,47 @@ export default function audioRendererTest() {
...
@@ -217,46 +214,47 @@ export default function audioRendererTest() {
encodingType
:
audio
.
AudioEncodingType
.
ENCODING_TYPE_RAW
encodingType
:
audio
.
AudioEncodingType
.
ENCODING_TYPE_RAW
}
}
let
AudioRendererInfo
=
{
let
AudioRendererInfo
=
{
content
:
audio
.
ContentType
.
CONTENT_TYPE_
SPEECH
,
content
:
audio
.
ContentType
.
CONTENT_TYPE_
UNKNOWN
,
usage
:
StreamType
,
usage
:
Number
(
audio
.
StreamUsage
[
StreamType
])
,
rendererFlags
:
0
rendererFlags
:
0
}
}
let
AudioRendererOptions
=
{
let
AudioRendererOptions
=
{
streamInfo
:
AudioStreamInfo
,
streamInfo
:
AudioStreamInfo
,
rendererInfo
:
AudioRendererInfo
rendererInfo
:
AudioRendererInfo
}
}
try
{
try
{
if
(
Number
(
audio
.
StreamUsage
[
StreamType
])
!=
9
)
{
await
audio
.
createAudioRenderer
(
AudioRendererOptions
)
.
then
((
data
)
=>
{
await
audio
.
createAudioRenderer
(
AudioRendererOptions
)
.
then
((
data
)
=>
{
audioRender
=
data
;
audioRender
=
data
;
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : Stream Type: ${StreamType} SUCCESS data state: `
+
Object
.
keys
(
data
));
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : Stream Type: ${StreamType}: ${Number(audio.StreamUsage[StreamType])}`
);
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : Stream Type: ${StreamType} STREAM_USAGE_MEDIA SUCCESS data value: `
+
JSON
.
stringify
(
data
));
})
.
catch
((
err
)
=>
{
})
.
catch
((
err
)
=>
{
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : ERROR : `
+
err
.
message
);
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : ERROR : `
+
err
.
code
+
err
.
message
);
});
});
}
else
{
audioRender
=
audioRen
;
}
}
catch
(
error
)
{
}
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
.
getUnderflowCount
()
.
then
((
data
)
=>
{
await
audioRender
.
getUnderflowCount
()
.
then
((
data
)
=>
{
console
.
info
(
`${TagFrmwkRender}:
####getUnderflowCount:Stream Type: ${StreamType} SUCCESS ${data}
`
);
console
.
info
(
`${TagFrmwkRender}:
getUnderflowCount SUCCESS! ${StreamType} data ${data}:, now release audiorender
`
);
expect
(
data
)
.
assertLargerOrEqual
(
env
.
OUTPUT_NUMBER_
0
);
expect
(
data
)
.
assertLargerOrEqual
(
0
);
})
.
catch
((
error
)
=>
{
})
.
catch
((
error
)
=>
{
console
.
info
(
`${TagFrmwkRender}:
#####getUnderflowCount:Stream Type: ${StreamType}
ERROR : code: ${error.code}, mesage: ${error.message}`
);
console
.
info
(
`${TagFrmwkRender}:
getUnderflowCount:
ERROR : code: ${error.code}, mesage: ${error.message}`
);
expect
(
false
)
.
assertTrue
();
expect
(
false
)
.
assertTrue
();
done
();
done
();
});
});
sleep
(
1000
);
sleep
(
1000
);
await
audioRender
.
release
()
.
then
(()
=>
{
await
audioRender
.
release
()
.
then
(()
=>
{
console
.
info
(
`${TagFrmwkRender}: Renderer
release : SUCCESS
`
);
console
.
info
(
`${TagFrmwkRender}: Renderer
${StreamType} release SUCCESS!
`
);
})
.
catch
((
err
)
=>
{
})
.
catch
((
err
)
=>
{
console
.
info
(
`${TagFrmwkRender}: Renderer release
:ERROR
: ${err.message}`
);
console
.
info
(
`${TagFrmwkRender}: Renderer release
ERROR
: ${err.message}`
);
});
});
}
}
done
();
done
();
}
catch
(
error
){
}
catch
(
error
)
{
console
.
info
(
`SUB_MULTIMEDIA_AUDIO_RENDERER_GETUNDERFLOWCOUNT_PROMISE_0300:Stream ERROR : code: ${error.code}, mesage: ${error.message}`
);
expect
(
false
)
.
assertTrue
();
done
();
}
}
});
});
...
@@ -269,23 +267,17 @@ export default function audioRendererTest() {
...
@@ -269,23 +267,17 @@ export default function audioRendererTest() {
* @tc.level : Level 0
* @tc.level : Level 0
*/
*/
it
(
'SUB_MULTIMEDIA_AUDIO_RENDERER_GETUNDERFLOWCOUNT_CALLBACK_0100'
,
0
,
async
function
(
done
)
{
it
(
'SUB_MULTIMEDIA_AUDIO_RENDERER_GETUNDERFLOWCOUNT_CALLBACK_0100'
,
0
,
async
function
(
done
)
{
try
{
audioRen
.
getUnderflowCount
((
err
,
data
)
=>
{
audioRen
.
getUnderflowCount
((
err
,
data
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
info
(
`${TagFrmwkRender}: ####getUnderflowCount : ERROR :
code: ${err.code}, mesage: ${err.message}`
);
console
.
info
(
`${TagFrmwkRender}: getUnderflowCount ERROR!
code: ${err.code}, mesage: ${err.message}`
);
expect
(
false
)
.
assertTrue
();
expect
(
false
)
.
assertTrue
();
done
();
done
();
}
else
{
}
else
{
console
.
info
(
`${TagFrmwkRender}: ####getUnderflowCount : Success
${data}`
);
console
.
info
(
`${TagFrmwkRender}: getUnderflowCount : Success!
${data}`
);
expect
(
data
)
.
assertLargerOrEqual
(
env
.
OUTPUT_NUMBER_0
);
expect
(
data
)
.
assertLargerOrEqual
(
env
.
OUTPUT_NUMBER_0
);
done
();
done
();
}
}
});
});
}
catch
(
error
){
console
.
info
(
`SUB_MULTIMEDIA_AUDIO_RENDERER_GETUNDERFLOWCOUNT_CALLBACK_0100: catch error, error: [${error.code}, ${error.message}]`
);
expect
(
false
)
.
assertTrue
();
done
();
};
});
});
/**
/**
...
@@ -297,35 +289,31 @@ export default function audioRendererTest() {
...
@@ -297,35 +289,31 @@ export default function audioRendererTest() {
* @tc.level : Level 0
* @tc.level : Level 0
*/
*/
it
(
'SUB_MULTIMEDIA_AUDIO_RENDERER_GETUNDERFLOWCOUNT_CALLBACK_0200'
,
0
,
async
function
(
done
)
{
it
(
'SUB_MULTIMEDIA_AUDIO_RENDERER_GETUNDERFLOWCOUNT_CALLBACK_0200'
,
0
,
async
function
(
done
)
{
let
CallBack
:
any
=
(
error
,
data
)
=>
{
try
{
await
renderPlay
();
audioRen
.
getUnderflowCount
((
error
,
data
)
=>
{
if
(
error
)
{
if
(
error
)
{
console
.
log
(
`${TagFrmwkRender}: ####CallBack:
execution fail,error: [${error.code}, ${error.message}]`
);
console
.
log
(
`${TagFrmwkRender}: getUnderflowCount
execution fail,error: [${error.code}, ${error.message}]`
);
expect
(
false
)
.
assertTrue
();
expect
(
false
)
.
assertTrue
();
done
();
done
();
}
else
{
}
else
{
console
.
log
(
`${TagFrmwkRender}: ####CallBack: execution success, data: ${JSON.stringify(data)}`
);
expect
(
data
)
.
assertLargerOrEqual
(
env
.
OUTPUT_NUMBER_0
);
expect
(
data
)
.
assertLargerOrEqual
(
env
.
OUTPUT_NUMBER_0
);
}
audioRen
.
drain
()
.
then
(()
=>
{
};
audioRen
.
stop
()
.
then
(()
=>
{
try
{
await
renderPlay
();
audioRen
.
getUnderflowCount
(
CallBack
);
}
catch
(
error
){
console
.
log
(
`${TagFrmwkRender}: ####getUnderflowCount: catch error, error: [${error.code}, ${error.message}]`
);
expect
(
false
)
.
assertTrue
();
done
();
done
();
};
await
audioRen
.
drain
()
.
then
(()
=>
{
console
.
info
(
`${TagFrmwkRender}: Renderer drained : SUCCESS`
);
})
.
catch
((
err
)
=>
{
})
.
catch
((
err
)
=>
{
console
.
error
(
`${TagFrmwkRender}: Renderer drain:
ERROR : ${err.message}`
);
console
.
info
(
`${TagFrmwkRender}: Renderer stop:
ERROR : ${err.message}`
);
});
});
await
audioRen
.
stop
()
.
then
(()
=>
{
console
.
info
(
`${TagFrmwkRender}: Renderer stopped : SUCCESS`
);
})
.
catch
((
err
)
=>
{
})
.
catch
((
err
)
=>
{
console
.
info
(
`${TagFrmwkRender}: Renderer stop:ERROR : ${err.message}`
);
console
.
error
(
`${TagFrmwkRender}: Renderer drain: ERROR : ${err.message}`
);
});
}
});
});
}
catch
(
error
)
{
console
.
log
(
`${TagFrmwkRender}: getUnderflowCount unknown error, error: [${error.code}, ${error.message}]`
);
expect
(
false
)
.
assertTrue
();
done
();
done
();
}
});
});
/**
/**
...
@@ -338,18 +326,7 @@ export default function audioRendererTest() {
...
@@ -338,18 +326,7 @@ export default function audioRendererTest() {
*/
*/
it
(
'SUB_MULTIMEDIA_AUDIO_RENDERER_GETUNDERFLOWCOUNT_CALLBACK_0300'
,
0
,
async
function
(
done
)
{
it
(
'SUB_MULTIMEDIA_AUDIO_RENDERER_GETUNDERFLOWCOUNT_CALLBACK_0300'
,
0
,
async
function
(
done
)
{
let
StreamType
;
let
StreamType
;
let
CallBack
:
any
=
(
error
,
data
)
=>
{
try
{
if
(
error
)
{
console
.
log
(
`${TagFrmwkRender}: ####CallBack: execution fail,error: [${error.code}, ${error.message}]`
);
expect
(
false
)
.
assertTrue
();
done
();
}
else
{
console
.
log
(
`${TagFrmwkRender}: ####CallBack:StreamType:${StreamType} execution success, data: ${JSON.stringify(data)}`
);
expect
(
data
)
.
assertLargerOrEqual
(
env
.
OUTPUT_NUMBER_0
);
}
};
try
{
for
(
StreamType
in
audio
.
StreamUsage
)
{
for
(
StreamType
in
audio
.
StreamUsage
)
{
let
audioRender
;
let
audioRender
;
let
AudioStreamInfo
=
{
let
AudioStreamInfo
=
{
...
@@ -367,36 +344,41 @@ export default function audioRendererTest() {
...
@@ -367,36 +344,41 @@ export default function audioRendererTest() {
streamInfo
:
AudioStreamInfo
,
streamInfo
:
AudioStreamInfo
,
rendererInfo
:
AudioRendererInfo
rendererInfo
:
AudioRendererInfo
}
}
try
{
try
{
if
(
Number
(
audio
.
StreamUsage
[
StreamType
])
!=
9
)
{
await
audio
.
createAudioRenderer
(
AudioRendererOptions
)
.
then
((
data
)
=>
{
await
audio
.
createAudioRenderer
(
AudioRendererOptions
)
.
then
((
data
)
=>
{
audioRender
=
data
;
audioRender
=
data
;
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : Stream Type: ${StreamType} SUCCESS data state: `
+
Object
.
keys
(
data
));
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : Stream Type: ${StreamType} SUCCESS data state: `
+
Object
.
keys
(
data
));
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : Stream Type: ${StreamType} STREAM_USAGE_MEDIA SUCCESS data value: `
+
JSON
.
stringify
(
data
));
})
.
catch
((
err
)
=>
{
})
.
catch
((
err
)
=>
{
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : ERROR : `
+
err
.
message
);
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : ERROR : `
+
err
.
message
);
});
});
}
else
{
audioRender
=
audioRen
;
}
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : catch ERROR : `
+
error
.
code
+
error
.
message
);
console
.
info
(
`${TagFrmwkRender}: AudioRender Created : catch ERROR : `
+
error
.
code
+
error
.
message
);
}
}
audioRen
.
getUnderflowCount
((
error
,
data
)
=>
{
audioRen
.
getUnderflowCount
(
CallBack
);
if
(
error
)
{
expect
(
false
)
.
assertTrue
();
done
();
}
else
{
console
.
log
(
`${TagFrmwkRender}:getUnderflowCount StreamType:${StreamType} execution success, data: ${JSON.stringify(data)}`
);
expect
(
data
)
.
assertLargerOrEqual
(
env
.
OUTPUT_NUMBER_0
);
}
});
sleep
(
1000
);
sleep
(
1000
);
await
audioRender
.
release
()
.
then
(()
=>
{
await
audioRender
.
release
()
.
then
(()
=>
{
console
.
info
(
`${TagFrmwkRender}: Renderer release : SUCCESS`
);
console
.
info
(
`${TagFrmwkRender}: Renderer
${StreamType}
release : SUCCESS`
);
})
.
catch
((
err
)
=>
{
})
.
catch
((
err
)
=>
{
console
.
info
(
`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`
);
console
.
info
(
`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`
);
});
});
}
}
done
();
done
();
}
catch
(
error
){
}
catch
(
error
)
{
console
.
log
(
`${TagFrmwkRender}: ####getUnderflowCount: catch error, error: [${error.code}, ${error.message}]`
);
expect
(
false
)
.
assertTrue
();
expect
(
false
)
.
assertTrue
();
done
();
done
();
}
}
});
});
})
})
}
}
multimedia/audio/audio_js_standard/AudioRendererEnhance/src/main/ets/test/OnOffOutputDeviceChange.test.ets
浏览文件 @
4d911162
...
@@ -34,8 +34,8 @@ export default function audioRendererTest() {
...
@@ -34,8 +34,8 @@ export default function audioRendererTest() {
encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW
encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW
}
}
let AudioRendererInfo = {
let AudioRendererInfo = {
content: audio.ContentType.CONTENT_TYPE_
SPEECH
,
content: audio.ContentType.CONTENT_TYPE_
UNKNOWN
,
usage: audio.StreamUsage.STREAM_USAGE_
VOICE_COMMUNICATION
,
usage: audio.StreamUsage.STREAM_USAGE_
MEDIA
,
rendererFlags: 0
rendererFlags: 0
}
}
let AudioRendererOptions = {
let AudioRendererOptions = {
...
@@ -76,26 +76,24 @@ export default function audioRendererTest() {
...
@@ -76,26 +76,24 @@ export default function audioRendererTest() {
* @tc.desc : AudioRenderer - on "struct" - promise
* @tc.desc : AudioRenderer - on "struct" - promise
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level
0
* @tc.level : Level
2
*/
*/
it('SUB_MULTIMEDIA_AUDIO_RENDERER_ON_CALLBACK_0100', 0, async function (done) {
it('SUB_MULTIMEDIA_AUDIO_RENDERER_ON_CALLBACK_0100', 0, async function (done) {
let CallBack:any = (error,data) => {
try {
audioRen.on(-1, (error, data) => {
if (error) {
if (error) {
console.log(`${TagFrmwkRender}: ####CallBack: execution fail,
error: [${error.code}, ${error.message}]`);
console.log(`${TagFrmwkRender}: On error,
error: [${error.code}, ${error.message}]`);
expect(false).assertTrue();
expect(false).assertTrue();
done();
done();
}else{
} else {
console.log(`${TagFrmwkRender}: ####CallBack: execution success, data: ${JSON.stringify(data)}`);
expect(false).assertTrue();
expect(true).assertTrue();
done();
done();
}
}
};
});
try{
} catch (error) {
audioRen.on(-1, CallBack);
if (error) {
}catch(error){
console.log(`${TagFrmwkRender}: On catch error, error: [${error.code}, ${error.message}]`);
if (error.code == env.INVALID_INPUT_PARAMETER_401) {
expect(Number(error.code)).assertEqual(INVALID_INPUT_PARAMETER_401);
console.log(`${TagFrmwkRender}: ####on: catch error, error: [${error.code}, ${error.message}]`);
expect(true).assertTrue();
done();
done();
} else {
} else {
expect(false).assertTrue();
expect(false).assertTrue();
...
@@ -110,26 +108,24 @@ export default function audioRendererTest() {
...
@@ -110,26 +108,24 @@ export default function audioRendererTest() {
* @tc.desc : AudioRenderer - on "struct" - promise
* @tc.desc : AudioRenderer - on "struct" - promise
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level
0
* @tc.level : Level
2
*/
*/
it('SUB_MULTIMEDIA_AUDIO_RENDERER_ON_CALLBACK_0200', 0, async function (done) {
it('SUB_MULTIMEDIA_AUDIO_RENDERER_ON_CALLBACK_0200', 0, async function (done) {
let CallBack:any = (error,data) => {
try {
audioRen.on('123', (error, data) => {
if (error) {
if (error) {
console.log(`${TagFrmwkRender}: ####CallBack: execution fail,
error: [${error.code}, ${error.message}]`);
console.log(`${TagFrmwkRender}: On error,
error: [${error.code}, ${error.message}]`);
expect(false).assertTrue();
expect(false).assertTrue();
done();
done();
}else{
} else {
console.log(`${TagFrmwkRender}: ####CallBack: execution success, data: ${JSON.stringify(data)}`);
expect(false).assertTrue();
expect(true).assertTrue();
done();
done();
}
}
};
});
try{
} catch (error) {
audioRen.on('123', CallBack);
if (error) {
}catch(error){
console.log(`${TagFrmwkRender}: On catch error, error: [${error.code}, ${error.message}]`);
if (error.code == env.INVALID_INPUT_PARAMETER_6800101) {
expect(Number(error.code)).assertEqual(INVALID_INPUT_PARAMETER_6800101);
console.log(`${TagFrmwkRender}: ####on: catch error, error: [${error.code}, ${error.message}]`);
expect(true).assertTrue();
done();
done();
} else {
} else {
expect(false).assertTrue();
expect(false).assertTrue();
...
@@ -144,26 +140,25 @@ export default function audioRendererTest() {
...
@@ -144,26 +140,25 @@ export default function audioRendererTest() {
* @tc.desc : AudioRenderer - on "struct" - promise
* @tc.desc : AudioRenderer - on "struct" - promise
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level
0
* @tc.level : Level
2
*/
*/
it('SUB_MULTIMEDIA_AUDIO_RENDERER_ON_CALLBACK_0300', 0, async function (done) {
it('SUB_MULTIMEDIA_AUDIO_RENDERER_ON_CALLBACK_0300', 0, async function (done) {
let CallBack:any = (error,data) => {
try {
audioRen.on((error, data) => {
if (error) {
if (error) {
console.log(`${TagFrmwkRender}: ####CallBack:
execution fail,error: [${error.code}, ${error.message}]`);
console.log(`${TagFrmwkRender}: On
execution fail,error: [${error.code}, ${error.message}]`);
expect(false).assertTrue();
expect(false).assertTrue();
done();
done();
}else
{
} else
{
console.log(`${TagFrmwkRender}: ####CallBack: execution success, data: ${JSON.stringify(data)}
`);
console.log(`${TagFrmwkRender}: On execution success, testcase FAIL!
`);
expect(tru
e).assertTrue();
expect(fals
e).assertTrue();
done();
done();
}
}
};
});
try{
} catch (error) {
audioRen.on(CallBack);
if (error) {
}catch(error){
console.log(`${TagFrmwkRender}: On: catch error, error: [${error.code}, ${error.message}]`);
if (error.code == 401) {
expect(Number(error.code)).assertEqual(INVALID_INPUT_PARAMETER_401);
console.log(`${TagFrmwkRender}: ####on: catch error, error: [${error.code}, ${error.message}]`);
expect(true).assertTrue();
done();
done();
} else {
} else {
expect(false).assertTrue();
expect(false).assertTrue();
...
@@ -178,33 +173,31 @@ export default function audioRendererTest() {
...
@@ -178,33 +173,31 @@ export default function audioRendererTest() {
* @tc.desc : AudioRenderer - on "struct" - promise
* @tc.desc : AudioRenderer - on "struct" - promise
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level
0
* @tc.level : Level
2
*/
*/
it('SUB_MULTIMEDIA_AUDIO_RENDERER_OFF_CALLBACK_0100', 0, async function (done) {
it('SUB_MULTIMEDIA_AUDIO_RENDERER_OFF_CALLBACK_0100', 0, async function (done) {
let CallBack:any = (error,data) => {
try {
audioRen.off(-1, (error, data) => {
if (error) {
if (error) {
console.log(`${TagFrmwkRender}: ####CallBack:
execution fail,error: [${error.code}, ${error.message}]`);
console.log(`${TagFrmwkRender}:Off
execution fail,error: [${error.code}, ${error.message}]`);
expect(false).assertTrue();
expect(false).assertTrue();
done();
done();
}else
{
} else
{
console.log(`${TagFrmwkRender}: ####CallBack: execution success, data: ${JSON.stringify(data)}
`);
console.log(`${TagFrmwkRender}:Off execution success, testcase FAIL!
`);
expect(tru
e).assertTrue();
expect(fals
e).assertTrue();
done();
done();
}
}
};
});
try{
} catch (error) {
audioRen.off(-1, CallBack);
if (error) {
}catch(error){
console.log(`${TagFrmwkRender}:On catch error, error: [${error.code}, ${error.message}]`);
if (error.code == env.INVALID_INPUT_PARAMETER_6800101) {
expect(Number(error.code)).assertEqual(INVALID_INPUT_PARAMETER_6800101);
console.log(`${TagFrmwkRender}: ####on: catch error, error: [${error.code}, ${error.message}]`);
expect(true).assertTrue();
done();
done();
} else {
} else {
expect(false).assertTrue();
expect(false).assertTrue();
done();
done();
}
}
}
}
});
});
/**
/**
...
@@ -213,26 +206,25 @@ export default function audioRendererTest() {
...
@@ -213,26 +206,25 @@ export default function audioRendererTest() {
* @tc.desc : AudioRenderer - on "struct" - promise
* @tc.desc : AudioRenderer - on "struct" - promise
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level
0
* @tc.level : Level
2
*/
*/
it('SUB_MULTIMEDIA_AUDIO_RENDERER_OFF_CALLBACK_0200', 0, async function (done) {
it('SUB_MULTIMEDIA_AUDIO_RENDERER_OFF_CALLBACK_0200', 0, async function (done) {
let CallBack:any = (error,data) => {
try {
audioRen.off('123', (error, data) => {
if (error) {
if (error) {
console.log(`${TagFrmwkRender}: ####CallBack:
execution fail,error: [${error.code}, ${error.message}]`);
console.log(`${TagFrmwkRender}: Off
execution fail,error: [${error.code}, ${error.message}]`);
expect(false).assertTrue();
expect(false).assertTrue();
done();
done();
}else
{
} else
{
console.log(`${TagFrmwkRender}: ####CallBack: execution success, data: ${JSON.stringify(data)}
`);
console.log(`${TagFrmwkRender}: Off execution success, testcase FAIL!
`);
expect(true).assertTrue();
expect(true).assertTrue();
done();
done();
}
}
};
});
try{
} catch (error) {
audioRen.off('123', CallBack);
if (error) {
}catch(error){
console.log(`${TagFrmwkRender}: Off catch error, error: [${error.code}, ${error.message}]`);
if (error.code == env.UNSUPORTED_OPTION_6800104) {
expect(Number(error.code)).assertEqual(UNSUPORTED_OPTION_6800104);
console.log(`${TagFrmwkRender}: ####on: catch error, error: [${error.code}, ${error.message}]`);
expect(true).assertTrue();
done();
done();
} else {
} else {
expect(false).assertTrue();
expect(false).assertTrue();
...
@@ -247,26 +239,25 @@ export default function audioRendererTest() {
...
@@ -247,26 +239,25 @@ export default function audioRendererTest() {
* @tc.desc : AudioRenderer - off "struct" - promise
* @tc.desc : AudioRenderer - off "struct" - promise
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level
0
* @tc.level : Level
2
*/
*/
it('SUB_MULTIMEDIA_AUDIO_RENDERER_OFF_CALLBACK_0300', 0, async function (done) {
it('SUB_MULTIMEDIA_AUDIO_RENDERER_OFF_CALLBACK_0300', 0, async function (done) {
let CallBack:any = (error,data) => {
try {
audioRen.off((error, data) => {
if (error) {
if (error) {
console.log(`${TagFrmwkRender}: ####CallBack:
execution fail,error: [${error.code}, ${error.message}]`);
console.log(`${TagFrmwkRender}: Off
execution fail,error: [${error.code}, ${error.message}]`);
expect(false).assertTrue();
expect(false).assertTrue();
done();
done();
}else
{
} else
{
console.log(`${TagFrmwkRender}: ####CallBack: execution success, data: ${JSON.stringify(data)}
`);
console.log(`${TagFrmwkRender}: Off execution success, testcase FAIL!
`);
expect(tru
e).assertTrue();
expect(fals
e).assertTrue();
done();
done();
}
}
};
});
try{
} catch (error) {
audioRen.off(CallBack);
if (error) {
}catch(error){
console.log(`${TagFrmwkRender}: Off catch error, error: [${error.code}, ${error.message}]`);
if (error.code == env.INVALID_INPUT_PARAMETER_6800101) {
expect(Number(error.code)).assertEqual(INVALID_INPUT_PARAMETER_6800101);
console.log(`${TagFrmwkRender}: ####on: catch error, error: [${error.code}, ${error.message}]`);
expect(true).assertTrue();
done();
done();
} else {
} else {
expect(false).assertTrue();
expect(false).assertTrue();
...
@@ -274,6 +265,5 @@ export default function audioRendererTest() {
...
@@ -274,6 +265,5 @@ export default function audioRendererTest() {
}
}
}
}
});
});
})
})
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录