Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
d96c23f4
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看板
未验证
提交
d96c23f4
编写于
1月 10, 2023
作者:
O
openharmony_ci
提交者:
Gitee
1月 10, 2023
浏览文件
操作
浏览文件
下载
差异文件
!7040 delete audio system api
Merge pull request !7040 from wangtao/mas_sys
上级
dc200301
d8eea552
变更
4
展开全部
隐藏空白更改
内联
并排
Showing
4 changed file
with
114 addition
and
577 deletion
+114
-577
multimedia/audio/audio_js_standard/AudioCapturerChangeInfo/src/main/js/test/AudioCapturerChangeInfo.test.js
...angeInfo/src/main/js/test/AudioCapturerChangeInfo.test.js
+10
-10
multimedia/audio/audio_js_standard/AudioRendererChangeInfo/src/main/js/test/AudioRendererChangeInfo.test.js
...angeInfo/src/main/js/test/AudioRendererChangeInfo.test.js
+13
-13
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioFramework.test.js
...dard/audioManager/src/main/js/test/AudioFramework.test.js
+0
-241
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioManagerApi9.test.js
...rd/audioManager/src/main/js/test/AudioManagerApi9.test.js
+91
-313
未找到文件。
multimedia/audio/audio_js_standard/AudioCapturerChangeInfo/src/main/js/test/AudioCapturerChangeInfo.test.js
浏览文件 @
d96c23f4
...
...
@@ -122,7 +122,7 @@ describe('audioCapturerChange', function () {
console
.
info
(
`
${
Tag
}
: C:
${
i
}
${
AudioCapturerChangeInfoArray
[
i
].
deviceDescriptors
[
j
].
channelCounts
[
0
]}
`
);
console
.
info
(
`
${
Tag
}
: CM:
${
i
}
${
AudioCapturerChangeInfoArray
[
i
].
deviceDescriptors
[
j
].
channelMasks
}
`
);
}
if
(
AudioCapturerChangeInfoArray
[
i
].
capturerState
==
1
&&
devDescriptor
!=
null
)
{
if
(
devDescriptor
!=
null
)
{
audioStreamManager
.
off
(
'
audioCapturerChange
'
);
await
audioCap
.
release
();
expect
(
true
).
assertTrue
();
...
...
@@ -184,7 +184,7 @@ describe('audioCapturerChange', function () {
for
(
let
j
=
0
;
j
<
AudioCapturerChangeInfoArray
[
i
].
deviceDescriptors
.
length
;
j
++
)
{
console
.
info
(
`
${
Tag
}
:deviceDescriptors
${
i
}
:
${
JSON
.
stringify
(
AudioCapturerChangeInfoArray
[
i
].
deviceDescriptors
[
j
])}
`
);
}
if
(
AudioCapturerChangeInfoArray
[
i
].
capturerState
==
2
&&
devDescriptor
!=
null
)
{
if
(
devDescriptor
!=
null
)
{
resultFlag
=
true
;
console
.
info
(
`
${
Tag
}
: [CAPTURER-CHANGE-ON-002] ResultFlag for element
${
i
}
is:
${
resultFlag
}
`
);
audioStreamManagerCB
.
off
(
'
audioCapturerChange
'
);
...
...
@@ -260,7 +260,7 @@ describe('audioCapturerChange', function () {
for
(
let
j
=
0
;
j
<
AudioCapturerChangeInfoArray
[
i
].
deviceDescriptors
.
length
;
j
++
)
{
console
.
info
(
`
${
Tag
}
:deviceDescriptors
${
i
}
:
${
JSON
.
stringify
(
AudioCapturerChangeInfoArray
[
i
].
deviceDescriptors
[
j
])}
`
);
}
if
(
AudioCapturerChangeInfoArray
[
i
].
capturerState
==
3
&&
devDescriptor
!=
null
)
{
if
(
devDescriptor
!=
null
)
{
resultFlag
=
true
;
console
.
info
(
`
${
Tag
}
: [CAPTURER-CHANGE-ON-003] ResultFlag for element
${
i
}
is:
${
resultFlag
}
`
);
}
...
...
@@ -350,7 +350,7 @@ describe('audioCapturerChange', function () {
for
(
let
j
=
0
;
j
<
AudioCapturerChangeInfoArray
[
i
].
deviceDescriptors
.
length
;
j
++
)
{
console
.
info
(
`
${
Tag
}
:deviceDescriptors
${
i
}
:
${
JSON
.
stringify
(
AudioCapturerChangeInfoArray
[
i
].
deviceDescriptors
[
j
])}
`
);
}
if
(
AudioCapturerChangeInfoArray
[
i
].
capturerState
==
4
&&
devDescriptor
!=
null
)
{
if
(
devDescriptor
!=
null
)
{
resultFlag
=
true
;
console
.
info
(
`
${
Tag
}
: [CAPTURER-CHANGE-ON-004] ResultFlag for element
${
i
}
is:
${
resultFlag
}
`
);
}
...
...
@@ -994,7 +994,7 @@ describe('audioCapturerChange', function () {
for
(
let
j
=
0
;
j
<
AudioCapturerChangeInfoArray
[
i
].
deviceDescriptors
.
length
;
j
++
)
{
console
.
info
(
`
${
Tag
}
:deviceDescriptors
${
i
}
:
${
JSON
.
stringify
(
AudioCapturerChangeInfoArray
[
i
].
deviceDescriptors
[
j
])}
`
);
}
if
(
AudioCapturerChangeInfoArray
[
i
].
capturerState
==
1
&&
devDescriptor
!=
null
)
{
if
(
devDescriptor
!=
null
)
{
audioStreamManagerCB
.
off
(
'
audioCapturerChange
'
);
console
.
info
(
`audioCapturerChange off Success `
);
expect
(
true
).
assertTrue
();
...
...
@@ -1084,7 +1084,7 @@ describe('audioCapturerChange', function () {
for
(
let
j
=
0
;
j
<
AudioCapturerChangeInfoArray
[
i
].
deviceDescriptors
.
length
;
j
++
)
{
console
.
info
(
`
${
Tag
}
:deviceDescriptors
${
i
}
:
${
JSON
.
stringify
(
AudioCapturerChangeInfoArray
[
i
].
deviceDescriptors
[
j
])}
`
);
}
if
(
AudioCapturerChangeInfoArray
[
i
].
capturerState
==
2
&&
devDescriptor
!=
null
)
{
if
(
devDescriptor
!=
null
)
{
audioStreamManager
.
off
(
'
audioCapturerChange
'
);
expect
(
true
).
assertTrue
();
done
();
...
...
@@ -1179,7 +1179,7 @@ describe('audioCapturerChange', function () {
for
(
let
j
=
0
;
j
<
AudioCapturerChangeInfoArray
[
i
].
deviceDescriptors
.
length
;
j
++
)
{
console
.
info
(
`
${
Tag
}
:deviceDescriptors
${
i
}
:
${
JSON
.
stringify
(
AudioCapturerChangeInfoArray
[
i
].
deviceDescriptors
[
j
])}
`
);
}
if
(
AudioCapturerChangeInfoArray
[
i
].
capturerState
==
3
&&
devDescriptor
!=
null
)
{
if
(
devDescriptor
!=
null
)
{
audioStreamManager
.
off
(
'
audioCapturerChange
'
);
expect
(
true
).
assertTrue
();
done
();
...
...
@@ -1348,7 +1348,7 @@ describe('audioCapturerChange', function () {
for
(
let
j
=
0
;
j
<
AudioCapturerChangeInfoArray
[
i
].
deviceDescriptors
.
length
;
j
++
)
{
console
.
info
(
`
${
Tag
}
:deviceDescriptors
${
i
}
:
${
JSON
.
stringify
(
AudioCapturerChangeInfoArray
[
i
].
deviceDescriptors
[
j
])}
`
);
}
if
(
AudioCapturerChangeInfoArray
[
i
].
capturerState
==
1
&&
devDescriptor
!=
null
)
{
if
(
devDescriptor
!=
null
)
{
audioStreamManager
.
off
(
'
audioCapturerChange
'
);
await
audioCap
.
release
().
then
(
function
()
{
console
.
info
(
`
${
Tag
}
: Capturer release : SUCCESS`
);
...
...
@@ -1439,7 +1439,7 @@ describe('audioCapturerChange', function () {
for
(
let
j
=
0
;
j
<
AudioCapturerChangeInfoArray
[
i
].
deviceDescriptors
.
length
;
j
++
)
{
console
.
info
(
`
${
Tag
}
:deviceDescriptors
${
i
}
:
${
JSON
.
stringify
(
AudioCapturerChangeInfoArray
[
i
].
deviceDescriptors
[
j
])}
`
);
}
if
(
AudioCapturerChangeInfoArray
[
i
].
capturerState
==
2
&&
devDescriptor
!=
null
)
{
if
(
devDescriptor
!=
null
)
{
audioStreamManagerCB
.
off
(
'
audioCapturerChange
'
);
await
audioCap
.
release
().
then
(
function
()
{
console
.
info
(
`
${
Tag
}
: Capturer release : SUCCESS`
);
...
...
@@ -1537,7 +1537,7 @@ describe('audioCapturerChange', function () {
for
(
let
j
=
0
;
j
<
AudioCapturerChangeInfoArray
[
i
].
deviceDescriptors
.
length
;
j
++
)
{
console
.
info
(
`
${
Tag
}
:deviceDescriptors
${
i
}
:
${
JSON
.
stringify
(
AudioCapturerChangeInfoArray
[
i
].
deviceDescriptors
[
j
])}
`
);
}
if
(
AudioCapturerChangeInfoArray
[
i
].
capturerState
==
3
&&
devDescriptor
!=
null
)
{
if
(
devDescriptor
!=
null
)
{
audioStreamManager
.
off
(
'
audioCapturerChange
'
);
await
audioCap
.
release
().
then
(
function
()
{
console
.
info
(
`
${
Tag
}
: Capturer release : SUCCESS`
);
...
...
multimedia/audio/audio_js_standard/AudioRendererChangeInfo/src/main/js/test/AudioRendererChangeInfo.test.js
浏览文件 @
d96c23f4
...
...
@@ -99,7 +99,7 @@ describe('audioRendererChange', function () {
console
.
info
(
`
${
Tag
}
: C:
${
i
}
${
AudioRendererChangeInfoArray
[
i
].
deviceDescriptors
[
j
].
channelCounts
[
0
]}
`
);
console
.
info
(
`
${
Tag
}
: CM:
${
i
}
${
AudioRendererChangeInfoArray
[
i
].
deviceDescriptors
[
j
].
channelMasks
}
`
);
}
if
(
AudioRendererChangeInfoArray
[
i
].
rendererState
==
1
&&
devDescriptor
!=
null
)
{
if
(
devDescriptor
!=
null
)
{
resultFlag
=
true
;
console
.
info
(
`
${
Tag
}
: [RENDERER-CHANGE-ON-001] ResultFlag for
${
i
}
is:
${
resultFlag
}
`
);
}
...
...
@@ -178,7 +178,7 @@ describe('audioRendererChange', function () {
for
(
let
j
=
0
;
j
<
AudioRendererChangeInfoArray
[
i
].
deviceDescriptors
.
length
;
j
++
)
{
console
.
info
(
`
${
Tag
}
:
${
i
}
${
JSON
.
stringify
(
AudioRendererChangeInfoArray
[
i
].
deviceDescriptors
[
j
])}
`
);
}
if
(
AudioRendererChangeInfoArray
[
i
].
rendererState
==
2
&&
devDescriptor
!=
null
)
{
if
(
devDescriptor
!=
null
)
{
resultFlag
=
true
;
console
.
info
(
`
${
Tag
}
: [RENDERER-CHANGE-ON-002] ResultFlag for
${
i
}
is:
${
resultFlag
}
`
);
}
...
...
@@ -269,7 +269,7 @@ describe('audioRendererChange', function () {
for
(
let
j
=
0
;
j
<
AudioRendererChangeInfoArray
[
i
].
deviceDescriptors
.
length
;
j
++
)
{
console
.
info
(
`
${
Tag
}
:
${
i
}
${
JSON
.
stringify
(
AudioRendererChangeInfoArray
[
i
].
deviceDescriptors
[
j
])}
`
);
}
if
(
AudioRendererChangeInfoArray
[
i
].
rendererState
==
3
&&
devDescriptor
!=
null
)
{
if
(
devDescriptor
!=
null
)
{
resultFlag
=
true
;
console
.
info
(
`
${
Tag
}
: [RENDERER-CHANGE-ON-003] ResultFlag for
${
i
}
is:
${
resultFlag
}
`
);
}
...
...
@@ -361,7 +361,7 @@ describe('audioRendererChange', function () {
for
(
let
j
=
0
;
j
<
AudioRendererChangeInfoArray
[
i
].
deviceDescriptors
.
length
;
j
++
)
{
console
.
info
(
`
${
Tag
}
:
${
i
}
${
JSON
.
stringify
(
AudioRendererChangeInfoArray
[
i
].
deviceDescriptors
[
j
])}
`
);
}
if
(
AudioRendererChangeInfoArray
[
i
].
rendererState
==
4
&&
devDescriptor
!=
null
)
{
if
(
devDescriptor
!=
null
)
{
resultFlag
=
true
;
console
.
info
(
`
${
Tag
}
: [RENDERER-CHANGE-ON-004] ResultFlag for
${
i
}
is:
${
resultFlag
}
`
);
}
...
...
@@ -440,7 +440,7 @@ describe('audioRendererChange', function () {
for
(
let
j
=
0
;
j
<
AudioRendererChangeInfoArray
[
i
].
deviceDescriptors
.
length
;
j
++
)
{
console
.
info
(
`
${
Tag
}
:
${
i
}
${
JSON
.
stringify
(
AudioRendererChangeInfoArray
[
i
].
deviceDescriptors
[
j
])}
`
);
}
if
(
AudioRendererChangeInfoArray
[
i
].
rendererState
==
5
&&
devDescriptor
!=
null
)
{
if
(
devDescriptor
!=
null
)
{
resultFlag
=
true
;
console
.
info
(
`
${
Tag
}
: [RENDERER-CHANGE-ON-005] ResultFlag for
${
i
}
is:
${
resultFlag
}
`
);
}
...
...
@@ -1877,7 +1877,7 @@ describe('audioRendererChange', function () {
for
(
let
j
=
0
;
j
<
AudioRendererChangeInfoArray
[
i
].
deviceDescriptors
.
length
;
j
++
)
{
console
.
info
(
`
${
Tag
}
:
${
i
}
${
JSON
.
stringify
(
AudioRendererChangeInfoArray
[
i
].
deviceDescriptors
[
j
])}
`
);
}
if
(
AudioRendererChangeInfoArray
[
i
].
rendererState
==
1
&&
devDescriptor
!=
null
)
{
if
(
devDescriptor
!=
null
)
{
resultFlag
=
true
;
console
.
info
(
`
${
Tag
}
: State :
${
AudioRendererChangeInfoArray
[
i
].
rendererState
}
`
);
}
...
...
@@ -1970,7 +1970,7 @@ describe('audioRendererChange', function () {
for
(
let
j
=
0
;
j
<
AudioRendererChangeInfoArray
[
i
].
deviceDescriptors
.
length
;
j
++
)
{
console
.
info
(
`
${
Tag
}
:
${
i
}
${
JSON
.
stringify
(
AudioRendererChangeInfoArray
[
i
].
deviceDescriptors
[
j
])}
`
);
}
if
(
AudioRendererChangeInfoArray
[
i
].
rendererState
==
2
&&
devDescriptor
!=
null
)
{
if
(
devDescriptor
!=
null
)
{
resultFlag
=
true
;
console
.
info
(
`
${
Tag
}
: State :
${
AudioRendererChangeInfoArray
[
i
].
rendererState
}
`
);
}
...
...
@@ -2071,7 +2071,7 @@ describe('audioRendererChange', function () {
for
(
let
j
=
0
;
j
<
AudioRendererChangeInfoArray
[
i
].
deviceDescriptors
.
length
;
j
++
)
{
console
.
info
(
`
${
Tag
}
:
${
i
}
${
JSON
.
stringify
(
AudioRendererChangeInfoArray
[
i
].
deviceDescriptors
[
j
])}
`
);
}
if
(
AudioRendererChangeInfoArray
[
i
].
rendererState
==
3
&&
devDescriptor
!=
null
)
{
if
(
devDescriptor
!=
null
)
{
resultFlag
=
true
;
console
.
info
(
`
${
Tag
}
: State :
${
AudioRendererChangeInfoArray
[
i
].
rendererState
}
`
);
}
...
...
@@ -2172,7 +2172,7 @@ describe('audioRendererChange', function () {
for
(
let
j
=
0
;
j
<
AudioRendererChangeInfoArray
[
i
].
deviceDescriptors
.
length
;
j
++
)
{
console
.
info
(
`
${
Tag
}
:
${
i
}
${
JSON
.
stringify
(
AudioRendererChangeInfoArray
[
i
].
deviceDescriptors
[
j
])}
`
);
}
if
(
AudioRendererChangeInfoArray
[
i
].
rendererState
==
5
&&
devDescriptor
!=
null
)
{
if
(
devDescriptor
!=
null
)
{
resultFlag
=
true
;
console
.
info
(
`
${
Tag
}
: State :
${
AudioRendererChangeInfoArray
[
i
].
rendererState
}
`
);
}
...
...
@@ -2352,7 +2352,7 @@ describe('audioRendererChange', function () {
for
(
let
j
=
0
;
j
<
AudioRendererChangeInfoArray
[
i
].
deviceDescriptors
.
length
;
j
++
)
{
console
.
info
(
`
${
Tag
}
:
${
i
}
${
JSON
.
stringify
(
AudioRendererChangeInfoArray
[
i
].
deviceDescriptors
[
j
])}
`
);
}
if
(
AudioRendererChangeInfoArray
[
i
].
rendererState
==
1
&&
devDescriptor
!=
null
)
{
if
(
devDescriptor
!=
null
)
{
resultFlag
=
true
;
console
.
info
(
`
${
Tag
}
: State :
${
AudioRendererChangeInfoArray
[
i
].
rendererState
}
`
);
}
...
...
@@ -2451,7 +2451,7 @@ describe('audioRendererChange', function () {
for
(
let
j
=
0
;
j
<
AudioRendererChangeInfoArray
[
i
].
deviceDescriptors
.
length
;
j
++
)
{
console
.
info
(
`
${
Tag
}
:
${
i
}
${
JSON
.
stringify
(
AudioRendererChangeInfoArray
[
i
].
deviceDescriptors
[
j
])}
`
);
}
if
(
AudioRendererChangeInfoArray
[
i
].
rendererState
==
2
&&
devDescriptor
!=
null
)
{
if
(
devDescriptor
!=
null
)
{
resultFlag
=
true
;
console
.
info
(
`
${
Tag
}
: State :
${
AudioRendererChangeInfoArray
[
i
].
rendererState
}
`
);
}
...
...
@@ -2557,7 +2557,7 @@ describe('audioRendererChange', function () {
for
(
let
j
=
0
;
j
<
AudioRendererChangeInfoArray
[
i
].
deviceDescriptors
.
length
;
j
++
)
{
console
.
info
(
`
${
Tag
}
:
${
i
}
${
JSON
.
stringify
(
AudioRendererChangeInfoArray
[
i
].
deviceDescriptors
[
j
])}
`
);
}
if
(
AudioRendererChangeInfoArray
[
i
].
rendererState
==
3
&&
devDescriptor
!=
null
)
{
if
(
devDescriptor
!=
null
)
{
resultFlag
=
true
;
console
.
info
(
`
${
Tag
}
: State :
${
AudioRendererChangeInfoArray
[
i
].
rendererState
}
`
);
}
...
...
@@ -2663,7 +2663,7 @@ describe('audioRendererChange', function () {
for
(
let
j
=
0
;
j
<
AudioRendererChangeInfoArray
[
i
].
deviceDescriptors
.
length
;
j
++
)
{
console
.
info
(
`
${
Tag
}
:
${
i
}
${
JSON
.
stringify
(
AudioRendererChangeInfoArray
[
i
].
deviceDescriptors
[
j
])}
`
);
}
if
(
AudioRendererChangeInfoArray
[
i
].
rendererState
==
5
&&
devDescriptor
!=
null
)
{
if
(
devDescriptor
!=
null
)
{
resultFlag
=
true
;
console
.
info
(
`AFRenLog: RenSta :
${
AudioRendererChangeInfoArray
[
i
].
rendererState
}
`
);
}
...
...
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioFramework.test.js
浏览文件 @
d96c23f4
...
...
@@ -4425,247 +4425,6 @@ describe('audioFramework', function () {
});
})
/**
*@tc.number : SUB_MULTIMEDIA_AUDIO_MANAGER_ONVOLUMECHANGE_0100
*@tc.name : OnVolumeChange - setVolume - MEDIA
*@tc.desc : OnVolumeChange - setVolume - MEDIA
*@tc.size : MEDIUM
*@tc.type : Function
*@tc.level : Level 1
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_MANAGER_ONVOLUMECHANGE_0100
'
,
1
,
async
function
(
done
)
{
audioManager
=
audio
.
getAudioManager
();
audioManager
.
on
(
'
volumeChange
'
,
(
VolumeEvent
)
=>
{
console
.
log
(
`
${
TagFrmwk
}
: Volume Change Event is called`
);
switch
(
VolumeEvent
.
volumeType
)
{
case
audio
.
AudioVolumeType
.
MEDIA
:
console
.
info
(
`
${
TagFrmwk
}
: Audio VolumeEvent is :
${
VolumeEvent
}
`
);
if
(
VolumeEvent
.
volume
==
lowVol
)
{
console
.
info
(
`
${
TagFrmwk
}
: MEDIA CallBack : PASS :
${
VolumeEvent
.
volume
}
`
);
expect
(
true
).
assertTrue
();
}
break
;
default
:
console
.
info
(
`
${
TagFrmwk
}
: Audio VolumeEvent is :
${
VolumeEvent
}
`
);
expect
(
false
).
assertTrue
();
break
;
}
done
();
});
try
{
await
audioManager
.
setVolume
(
audioMedia
,
lowVol
);
console
.
info
(
'
setVolume success
'
)
}
catch
(
err
)
{
console
.
log
(
'
err :
'
+
JSON
.
stringify
(
err
))
expect
(
false
).
assertTrue
();
done
();
}
})
/**
*@tc.number : SUB_MULTIMEDIA_AUDIO_MANAGER_ONVOLUMECHANGE_0200
*@tc.name : OnVolumeChange - setVolume - RINGTONE
*@tc.desc : OnVolumeChange - setVolume - RINGTONE
*@tc.size : MEDIUM
*@tc.type : Function
*@tc.level : Level 1
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_MANAGER_ONVOLUMECHANGE_0200
'
,
1
,
async
function
(
done
)
{
audioManager
=
audio
.
getAudioManager
();
audioManager
.
on
(
'
volumeChange
'
,
(
VolumeEvent
)
=>
{
console
.
log
(
`
${
TagFrmwk
}
: Volume Change Event is called`
);
switch
(
VolumeEvent
.
volumeType
)
{
case
audio
.
AudioVolumeType
.
RINGTONE
:
console
.
info
(
`
${
TagFrmwk
}
: Audio VolumeEvent is :
${
VolumeEvent
}
`
);
if
(
VolumeEvent
.
volume
==
lowVol
)
{
console
.
info
(
`
${
TagFrmwk
}
: RINGTONE CallBack : PASS :
${
VolumeEvent
.
volume
}
`
);
expect
(
true
).
assertTrue
();
}
break
;
default
:
console
.
info
(
`
${
TagFrmwk
}
: Audio VolumeEvent is :
${
VolumeEvent
}
`
);
expect
(
false
).
assertTrue
();
break
;
}
done
();
});
try
{
await
audioManager
.
setVolume
(
audioRingtone
,
lowVol
);
console
.
info
(
'
setVolume success
'
)
}
catch
(
err
)
{
console
.
log
(
'
err :
'
+
JSON
.
stringify
(
err
))
expect
(
false
).
assertTrue
();
done
();
}
})
/**
*@tc.number : SUB_MULTIMEDIA_AUDIO_MANAGER_ONVOLUMECHANGE_0300
*@tc.name : OnVolumeChange - setVolume - VOICE_CALL
*@tc.desc : OnVolumeChange - setVolume - VOICE_CALL
*@tc.size : MEDIUM
*@tc.type : Function
*@tc.level : Level 2
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_MANAGER_ONVOLUMECHANGE_0300
'
,
2
,
async
function
(
done
)
{
audioManager
=
audio
.
getAudioManager
();
audioManager
.
on
(
'
volumeChange
'
,
(
VolumeEvent
)
=>
{
console
.
log
(
`
${
TagFrmwk
}
: Volume Change Event is called`
);
switch
(
VolumeEvent
.
volumeType
)
{
case
audio
.
AudioVolumeType
.
VOICE_CALL
:
console
.
info
(
`
${
TagFrmwk
}
: Audio VolumeEvent is :
${
VolumeEvent
}
`
);
if
(
VolumeEvent
.
volume
==
lowVol
)
{
console
.
info
(
`
${
TagFrmwk
}
: VOICE_CALL CallBack : PASS :
${
VolumeEvent
.
volume
}
`
);
expect
(
true
).
assertTrue
();
}
break
;
default
:
console
.
info
(
`
${
TagFrmwk
}
: Audio VolumeEvent is :
${
VolumeEvent
}
`
);
expect
(
false
).
assertTrue
();
break
;
}
done
();
});
try
{
await
audioManager
.
setVolume
(
audio
.
AudioVolumeType
.
VOICE_CALL
,
lowVol
);
console
.
info
(
'
setVolume success
'
)
}
catch
(
err
)
{
console
.
log
(
'
err :
'
+
JSON
.
stringify
(
err
))
expect
(
false
).
assertTrue
();
done
();
}
})
/**
*@tc.number : SUB_MULTIMEDIA_AUDIO_MANAGER_ONVOLUMECHANGE_0400
*@tc.name : OnVolumeChange - setVolume - VOICE_ASSISTANT
*@tc.desc : OnVolumeChange - setVolume - VOICE_ASSISTANT
*@tc.size : MEDIUM
*@tc.type : Function
*@tc.level : Level 2
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_MANAGER_ONVOLUMECHANGE_0400
'
,
2
,
async
function
(
done
)
{
audioManager
=
audio
.
getAudioManager
();
audioManager
.
on
(
'
volumeChange
'
,
(
VolumeEvent
)
=>
{
console
.
log
(
`
${
TagFrmwk
}
: Volume Change Event is called`
);
switch
(
VolumeEvent
.
volumeType
)
{
case
audio
.
AudioVolumeType
.
VOICE_ASSISTANT
:
console
.
info
(
`
${
TagFrmwk
}
: Audio VolumeEvent is :
${
VolumeEvent
}
`
);
if
(
VolumeEvent
.
volume
==
lowVol
)
{
console
.
info
(
`
${
TagFrmwk
}
: VOICE_ASSISTANT CallBack : PASS :
${
VolumeEvent
.
volume
}
`
);
expect
(
true
).
assertTrue
();
}
break
;
default
:
console
.
info
(
`
${
TagFrmwk
}
: Audio VolumeEvent is :
${
VolumeEvent
}
`
);
expect
(
false
).
assertTrue
();
break
;
}
done
();
});
try
{
await
audioManager
.
setVolume
(
audio
.
AudioVolumeType
.
VOICE_ASSISTANT
,
lowVol
);
console
.
info
(
'
setVolume success
'
)
}
catch
(
err
)
{
console
.
log
(
'
err :
'
+
JSON
.
stringify
(
err
))
expect
(
false
).
assertTrue
();
done
();
}
})
/**
*@tc.number : SUB_MULTIMEDIA_AUDIO_MANAGER_RINGERMODECHANGE_0100
*@tc.name : RingerModeChange - RINGER_MODE_SILENT
*@tc.desc : RingerModeChange - RINGER_MODE_SILENT
*@tc.size : MEDIUM
*@tc.type : Function
*@tc.level : Level 1
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_MANAGER_RINGERMODECHANGE_0100
'
,
1
,
async
function
(
done
)
{
audioManager
.
on
(
'
ringerModeChange
'
,
(
ringerMode
)
=>
{
console
.
log
(
`
${
TagFrmwk
}
: RingerModeChange is called`
);
switch
(
ringerMode
)
{
case
audio
.
AudioRingMode
.
RINGER_MODE_SILENT
:
console
.
info
(
`
${
TagFrmwk
}
: Ringer Mode Changed to : RINGER_MODE_SILENT :
${
ringerMode
}
`
);
expect
(
true
).
assertTrue
();
break
;
default
:
console
.
info
(
`
${
TagFrmwk
}
: Ringer Mode Changed : UNKNOWN
${
ringerMode
}
`
);
expect
(
false
).
assertTrue
();
break
;
}
});
await
audioManager
.
setRingerMode
(
audio
.
AudioRingMode
.
RINGER_MODE_SILENT
);
done
();
})
/**
*@tc.number : SUB_MULTIMEDIA_AUDIO_MANAGER_RINGERMODECHANGE_0200
*@tc.name : RingerModeChange - RINGER_MODE_VIBRATE
*@tc.desc : RingerModeChange - RINGER_MODE_VIBRATE
*@tc.size : MEDIUM
*@tc.type : Function
*@tc.level : Level 1
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_MANAGER_RINGERMODECHANGE_0200
'
,
1
,
async
function
(
done
)
{
audioManager
.
on
(
'
ringerModeChange
'
,
(
ringerMode
)
=>
{
console
.
log
(
`
${
TagFrmwk
}
: RingerModeChange is called`
);
switch
(
ringerMode
)
{
case
audio
.
AudioRingMode
.
RINGER_MODE_VIBRATE
:
console
.
info
(
`
${
TagFrmwk
}
: Ringer Mode Changed to : RINGER_MODE_VIBRATE :
${
ringerMode
}
`
);
expect
(
true
).
assertTrue
();
break
;
default
:
console
.
info
(
`
${
TagFrmwk
}
: Ringer Mode Changed : UNKNOWN
${
ringerMode
}
`
);
expect
(
false
).
assertTrue
();
break
;
}
done
();
});
try
{
await
audioManager
.
setRingerMode
(
audio
.
AudioRingMode
.
RINGER_MODE_VIBRATE
);
}
catch
(
err
)
{
console
.
log
(
'
err :
'
+
JSON
.
stringify
(
err
))
expect
(
false
).
assertTrue
();
done
();
}
})
/**
*@tc.number : SUB_MULTIMEDIA_AUDIO_MANAGER_RINGERMODECHANGE_0300
*@tc.name : RingerModeChange - RINGER_MODE_NORMAL
*@tc.desc : RingerModeChange - RINGER_MODE_NORMAL
*@tc.size : MEDIUM
*@tc.type : Function
*@tc.level : Level 2
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_MANAGER_RINGERMODECHANGE_0300
'
,
2
,
async
function
(
done
)
{
audioManager
.
on
(
'
ringerModeChange
'
,
(
ringerMode
)
=>
{
console
.
log
(
`
${
TagFrmwk
}
: RingerModeChange is called`
);
switch
(
ringerMode
)
{
case
audio
.
AudioRingMode
.
RINGER_MODE_NORMAL
:
console
.
info
(
`
${
TagFrmwk
}
: Ringer Mode Changed to : RINGER_MODE_NORMAL :
${
ringerMode
}
`
);
expect
(
true
).
assertTrue
();
break
;
default
:
console
.
info
(
`
${
TagFrmwk
}
: Ringer Mode Changed : UNKNOWN
${
ringerMode
}
`
);
expect
(
false
).
assertTrue
();
break
;
}
done
();
});
try
{
await
audioManager
.
setRingerMode
(
audio
.
AudioRingMode
.
RINGER_MODE_NORMAL
);
}
catch
(
err
)
{
console
.
log
(
'
err :
'
+
JSON
.
stringify
(
err
))
expect
(
false
).
assertTrue
();
done
();
}
})
/**
*@tc.number : SUB_MULTIMEDIA_AUDIO_MANAGER_INTERRUPT_0100
*@tc.name : InterruptType - INTERRUPT_TYPE_BEGIN
...
...
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioManagerApi9.test.js
浏览文件 @
d96c23f4
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录