Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
da0ee515
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看板
提交
da0ee515
编写于
1月 09, 2023
作者:
L
lwx1121892
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify timeout
Signed-off-by:
N
lwx1121892
<
liuxueqi3@huawei.com
>
上级
73e86935
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
152 addition
and
625 deletion
+152
-625
multimedia/audio/audio_js_standard/AudioCapturer/src/main/js/test/AudioCapturer.test.js
...dard/AudioCapturer/src/main/js/test/AudioCapturer.test.js
+10
-11
multimedia/audio/audio_js_standard/AudioCapturerChangeInfo/src/main/js/test/AudioCapturerChangeInfo.test.js
...angeInfo/src/main/js/test/AudioCapturerChangeInfo.test.js
+19
-21
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
+9
-252
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/audioVoip/src/main/js/test/AudioVOIP.test.js
..._js_standard/audioVoip/src/main/js/test/AudioVOIP.test.js
+10
-15
未找到文件。
multimedia/audio/audio_js_standard/AudioCapturer/src/main/js/test/AudioCapturer.test.js
浏览文件 @
da0ee515
...
...
@@ -449,20 +449,19 @@ export default function audioCapturer() {
})
}
async
function
driveFn
()
{
console
.
info
(
`come in driveFn`
)
let
driver
=
await
UiDriver
.
create
()
console
.
info
(
`driver is
${
JSON
.
stringify
(
driver
)}
`
)
await
sleep
(
2000
)
console
.
info
(
`UiDriver start`
)
let
button
=
await
driver
.
findComponent
(
BY
.
text
(
'
允许
'
))
console
.
info
(
`button is
${
JSON
.
stringify
(
button
)}
`
)
await
sleep
(
5000
)
await
button
.
click
()
console
.
info
(
`come in driveFn`
)
;
let
driver
=
await
UiDriver
.
create
()
;
console
.
info
(
`driver is
${
JSON
.
stringify
(
driver
)}
`
)
;
await
sleep
(
100
);
console
.
info
(
`UiDriver start`
)
;
let
button
=
await
driver
.
findComponent
(
BY
.
text
(
'
允许
'
))
;
console
.
info
(
`button is
${
JSON
.
stringify
(
button
)}
`
)
;
await
sleep
(
100
);
await
button
.
click
()
;
}
beforeAll
(
async
function
()
{
await
getPermission
();
sleep
(
2000
)
await
driveFn
();
console
.
info
(
'
TestLog: Start Testing AudioFrameworkTest Interfaces
'
);
})
...
...
multimedia/audio/audio_js_standard/AudioCapturerChangeInfo/src/main/js/test/AudioCapturerChangeInfo.test.js
浏览文件 @
da0ee515
...
...
@@ -37,22 +37,20 @@ describe('audioCapturerChange', function () {
})
}
async
function
driveFn
()
{
console
.
info
(
`come in driveFn`
)
let
driver
=
await
UiDriver
.
create
()
console
.
info
(
`driver is
${
JSON
.
stringify
(
driver
)}
`
)
await
sleep
(
2000
)
console
.
info
(
`UiDriver start`
)
let
button
=
await
driver
.
findComponent
(
BY
.
text
(
'
允许
'
))
console
.
info
(
`button is
${
JSON
.
stringify
(
button
)}
`
)
await
sleep
(
5000
)
await
button
.
click
()
console
.
info
(
`come in driveFn`
)
;
let
driver
=
await
UiDriver
.
create
()
;
console
.
info
(
`driver is
${
JSON
.
stringify
(
driver
)}
`
)
;
await
sleep
(
100
);
console
.
info
(
`UiDriver start`
)
;
let
button
=
await
driver
.
findComponent
(
BY
.
text
(
'
允许
'
))
;
console
.
info
(
`button is
${
JSON
.
stringify
(
button
)}
`
)
;
await
sleep
(
100
);
await
button
.
click
()
;
}
beforeAll
(
async
function
()
{
await
getPermission
();
sleep
(
2000
)
await
driveFn
();
await
sleep
(
5000
);
audioStreamManager
=
audioManager
.
getStreamManager
();
audioStreamManagerCB
=
audioManager
.
getStreamManager
();
console
.
info
(
'
TestLog: Start Testing AudioFrameworkTest Interfaces
'
);
...
...
@@ -122,7 +120,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 +182,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 +258,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 +348,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 +992,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 +1082,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 +1177,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 +1346,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 +1437,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 +1535,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
浏览文件 @
da0ee515
...
...
@@ -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
浏览文件 @
da0ee515
...
...
@@ -105,22 +105,20 @@ describe('audioFramework', function () {
})
}
async
function
driveFn
()
{
console
.
info
(
`come in driveFn`
)
let
driver
=
await
UiDriver
.
create
()
console
.
info
(
`driver is
${
JSON
.
stringify
(
driver
)}
`
)
sleep
(
2000
)
console
.
info
(
`UiDriver start`
)
let
button
=
await
driver
.
findComponent
(
BY
.
text
(
'
允许
'
))
console
.
info
(
`button is
${
JSON
.
stringify
(
button
)}
`
)
await
sleep
(
5000
)
await
button
.
click
()
console
.
info
(
`come in driveFn`
)
;
let
driver
=
await
UiDriver
.
create
()
;
console
.
info
(
`driver is
${
JSON
.
stringify
(
driver
)}
`
)
;
await
sleep
(
100
);
console
.
info
(
`UiDriver start`
)
;
let
button
=
await
driver
.
findComponent
(
BY
.
text
(
'
允许
'
))
;
console
.
info
(
`button is
${
JSON
.
stringify
(
button
)}
`
)
;
await
sleep
(
100
);
await
button
.
click
()
;
}
beforeAll
(
async
function
()
{
await
getPermission
();
sleep
(
2000
)
await
driveFn
();
await
sleep
(
1000
);
await
getAudioManager
();
console
.
info
(
'
TestLog: Start Testing AudioFrameworkTest Interfaces
'
);
})
...
...
@@ -4425,247 +4423,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
浏览文件 @
da0ee515
此差异已折叠。
点击以展开。
multimedia/audio/audio_js_standard/audioVoip/src/main/js/test/AudioVOIP.test.js
浏览文件 @
da0ee515
...
...
@@ -40,26 +40,21 @@ describe('audioVoip', function () {
})
}
async
function
driveFn
()
{
console
.
info
(
`come in driveFn`
)
let
driver
=
await
UiDriver
.
create
()
console
.
info
(
`driver is
${
JSON
.
stringify
(
driver
)}
`
)
await
sleep
(
2000
)
console
.
info
(
`UiDriver start`
)
let
button
=
await
driver
.
findComponent
(
BY
.
text
(
'
允许
'
))
while
(
button
){
console
.
info
(
`button is
${
JSON
.
stringify
(
button
)}
`
)
await
button
.
click
()
await
sleep
(
5000
)
button
=
await
driver
.
findComponent
(
BY
.
text
(
'
允许
'
))
}
console
.
info
(
`come in driveFn`
);
let
driver
=
await
UiDriver
.
create
();
console
.
info
(
`driver is
${
JSON
.
stringify
(
driver
)}
`
);
await
sleep
(
100
);
console
.
info
(
`UiDriver start`
);
let
button
=
await
driver
.
findComponent
(
BY
.
text
(
'
允许
'
));
console
.
info
(
`button is
${
JSON
.
stringify
(
button
)}
`
);
await
sleep
(
100
);
await
button
.
click
();
}
beforeAll
(
async
function
()
{
console
.
info
(
`AudioFrameworkTest: beforeAll: Prerequisites at the test suite level`
);
await
getPermission
();
sleep
(
2000
)
await
driveFn
();
await
sleep
(
100
);
console
.
info
(
`AudioFrameworkTest: beforeAll: END`
);
})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录