Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
8d3a54e6
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看板
提交
8d3a54e6
编写于
6月 29, 2022
作者:
H
Harshaprasad
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Adding scripts for State Change Listners
Signed-off-by:
N
Harshaprasad
<
harshaprasad@huawei.com
>
上级
f0ecba6a
变更
7
展开全部
隐藏空白更改
内联
并排
Showing
7 changed file
with
4213 addition
and
875 deletion
+4213
-875
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioCapturerChangeInfo.test.js
...oManager/src/main/js/test/AudioCapturerChangeInfo.test.js
+1580
-0
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioEventManagement.test.js
...udioManager/src/main/js/test/AudioEventManagement.test.js
+3
-271
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioFramework.test.js
...dard/audioManager/src/main/js/test/AudioFramework.test.js
+4
-189
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioRenderer.test.js
...ndard/audioManager/src/main/js/test/AudioRenderer.test.js
+2
-414
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioRendererChangeInfo.test.js
...oManager/src/main/js/test/AudioRendererChangeInfo.test.js
+2621
-0
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioVOIP.test.js
..._standard/audioManager/src/main/js/test/AudioVOIP.test.js
+1
-1
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/List.test.js
...io_js_standard/audioManager/src/main/js/test/List.test.js
+2
-0
未找到文件。
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioCapturerChangeInfo.test.js
0 → 100644
浏览文件 @
8d3a54e6
此差异已折叠。
点击以展开。
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioEventManagement.test.js
浏览文件 @
8d3a54e6
...
...
@@ -13,12 +13,13 @@
* limitations under the License.
*/
import
audio
from
'
@ohos.multimedia.audio
'
;
import
fileio
from
'
@ohos.fileio
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
;
describe
(
'
audioManger
_audio_1
'
,
function
()
{
describe
(
'
audioManger
'
,
function
()
{
console
.
info
(
'
AudioFrameworkTest: Create AudioManger Object JS Framework
'
);
const
audioManager
=
audio
.
getAudioManager
();
var
deviceRoleValue
=
null
;
...
...
@@ -59,9 +60,6 @@ describe('audioManger_audio_1', function () {
else
if
(
value
.
deviceType
==
3
){
devTypeName
=
'
WIRED_HEADSET
'
;
}
else
if
(
value
.
deviceType
==
7
){
devTypeName
=
'
BLUETOOTH_SCO
'
;
}
else
if
(
value
.
deviceType
==
8
){
devTypeName
=
'
BLUETOOTH_A2DP
'
;
}
...
...
@@ -491,63 +489,7 @@ describe('audioManger_audio_1', function () {
done
();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_PR_Activate_013
* @tc.name : setDeviceActive - BLUETOOTH_SCO - Activate - Promise
* @tc.desc : Activate BLUETOOTH_SCO - Promise
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
SUB_AUDIO_MANAGER_setDeviceActive_PR_Activate_013
'
,
0
,
async
function
(
done
)
{
await
audioManager
.
setDeviceActive
(
audio
.
ActiveDeviceType
.
BLUETOOTH_SCO
,
true
).
then
(
function
(){
console
.
info
(
'
AudioFrameworkTest: Device Test: Promise : setDeviceActive : BLUETOOTH_SCO: Activate
'
);
audioManager
.
isDeviceActive
(
audio
.
ActiveDeviceType
.
BLUETOOTH_SCO
).
then
(
function
(
value
){
if
(
value
==
true
){
console
.
info
(
'
AudioFrameworkTest: Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Activate : PASS :
'
+
value
);
expect
(
true
).
assertTrue
();
}
else
{
console
.
info
(
'
AudioFrameworkTest: Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Activate : FAIL :
'
+
value
);
expect
(
false
).
assertTrue
();
}
});
}).
catch
((
err
)
=>
{
console
.
info
(
'
AudioFrameworkTest: Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Activate : FAIL : Error :
'
+
err
.
message
);
expect
(
false
).
assertTrue
();
});
done
();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_PR_Activate_ENUM_014
* @tc.name : setDeviceActive - BLUETOOTH_SCO - Activate - Promise
* @tc.desc : Activate BLUETOOTH_SCO - Promise
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
SUB_AUDIO_MANAGER_setDeviceActive_PR_Activate_ENUM_014
'
,
0
,
async
function
(
done
)
{
await
audioManager
.
setDeviceActive
(
7
,
true
).
then
(
function
(){
console
.
info
(
'
AudioFrameworkTest: Device Test: Promise : setDeviceActive : BLUETOOTH_SCO: Activate
'
);
audioManager
.
isDeviceActive
(
7
).
then
(
function
(
value
){
if
(
value
==
true
){
console
.
info
(
'
AudioFrameworkTest: Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Activate : PASS :
'
+
value
);
expect
(
true
).
assertTrue
();
}
else
{
console
.
info
(
'
AudioFrameworkTest: Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Activate : FAIL :
'
+
value
);
expect
(
false
).
assertTrue
();
}
});
}).
catch
((
err
)
=>
{
console
.
info
(
'
AudioFrameworkTest: Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Activate : FAIL : Error :
'
+
err
.
message
);
expect
(
false
).
assertTrue
();
});
done
();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_PR_Deactivate_015
* @tc.name : setDeviceActive - SPEAKER - deactivate - Promise
...
...
@@ -665,139 +607,6 @@ describe('audioManger_audio_1', function () {
done
();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_PR_Deactivate_019
* @tc.name : setDeviceActive - BLUETOOTH_SCO - deactivate - Promise
* @tc.desc : Deactivate BLUETOOTH_SCO - Promise
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
SUB_AUDIO_MANAGER_setDeviceActive_PR_Deactivate_019
'
,
0
,
async
function
(
done
)
{
await
audioManager
.
setDeviceActive
(
audio
.
ActiveDeviceType
.
BLUETOOTH_SCO
,
false
).
then
(
function
(){
// Setting device active ENUM 3 = BLUETOOTH_SCO
console
.
info
(
'
AudioFrameworkTest: Device Test: Promise : setDeviceActive : BLUETOOTH_SCO: Deactivate
'
);
audioManager
.
isDeviceActive
(
audio
.
ActiveDeviceType
.
BLUETOOTH_SCO
).
then
(
function
(
value
){
if
(
value
==
false
){
console
.
info
(
'
AudioFrameworkTest: Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Deactivate : PASS :
'
+
value
);
expect
(
true
).
assertTrue
();
}
else
{
console
.
info
(
'
AudioFrameworkTest: Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Deactivate : FAIL :
'
+
value
);
expect
(
false
).
assertTrue
();
}
});
}).
catch
((
err
)
=>
{
console
.
info
(
'
AudioFrameworkTest: Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Deactivate : FAIL : Error :
'
+
err
.
message
);
expect
(
false
).
assertTrue
();
});
done
();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_PR_Deactivate_ENUM_020
* @tc.name : setDeviceActive - BLUETOOTH_SCO - deactivate - Promise
* @tc.desc : Deactivate BLUETOOTH_SCO - Promise
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
SUB_AUDIO_MANAGER_setDeviceActive_PR_Deactivate_ENUM_020
'
,
0
,
async
function
(
done
)
{
await
audioManager
.
setDeviceActive
(
7
,
true
).
then
(
function
(){
console
.
info
(
'
AudioFrameworkTest: Device Test: Promise : setDeviceActive : BLUETOOTH_SCO: Active
'
);
});
await
audioManager
.
setDeviceActive
(
7
,
false
).
then
(
function
(){
// Setting device active ENUM 3 = BLUETOOTH_SCO
console
.
info
(
'
AudioFrameworkTest: Device Test: Promise : setDeviceActive : BLUETOOTH_SCO: Deactivate
'
);
audioManager
.
isDeviceActive
(
7
).
then
(
function
(
value
){
if
(
value
==
false
){
console
.
info
(
'
AudioFrameworkTest: Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Deactivate : PASS :
'
+
value
);
expect
(
true
).
assertTrue
();
}
else
{
console
.
info
(
'
AudioFrameworkTest: Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Deactivate : FAIL :
'
+
value
);
expect
(
false
).
assertTrue
();
}
});
}).
catch
((
err
)
=>
{
console
.
info
(
'
AudioFrameworkTest: Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Deactivate : FAIL : Error :
'
+
err
.
message
);
expect
(
false
).
assertTrue
();
});
done
();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_CB_Activate_021
* @tc.name : setDeviceActive - BLUETOOTH_SCO - Activate - Callback
* @tc.desc : Activate BLUETOOTH_SCO - Callback
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
SUB_AUDIO_MANAGER_setDeviceActive_CB_Activate_021
'
,
0
,
async
function
(
done
)
{
audioManager
.
setDeviceActive
(
audio
.
ActiveDeviceType
.
BLUETOOTH_SCO
,
true
,
(
err
)
=>
{
if
(
err
)
{
console
.
error
(
`AudioFrameworkTest: Device Test: Callback : setDeviceActive : BLUETOOTH_SCO: Active: Error:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
}
else
{
console
.
info
(
'
AudioFrameworkTest: Device Test: Callback : setDeviceActive : BLUETOOTH_SCO: Active
'
);
audioManager
.
isDeviceActive
(
audio
.
ActiveDeviceType
.
BLUETOOTH_SCO
,(
err
,
value
)
=>
{
if
(
err
)
{
console
.
error
(
`AudioFrameworkTest: Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Active: Error:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
}
else
if
(
value
==
true
){
console
.
info
(
'
AudioFrameworkTest: Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Active : PASS :
'
+
value
);
expect
(
true
).
assertTrue
();
}
else
{
console
.
info
(
'
AudioFrameworkTest: Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Active : FAIL :
'
+
value
);
expect
(
false
).
assertTrue
();
}
done
();
});
}
done
();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_CB_Activate_ENUM_022
* @tc.name : setDeviceActive - BLUETOOTH_SCO - Activate - Callback
* @tc.desc : Activate BLUETOOTH_SCO - Callback
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
SUB_AUDIO_MANAGER_setDeviceActive_CB_Activate_ENUM_022
'
,
0
,
async
function
(
done
)
{
audioManager
.
setDeviceActive
(
7
,
true
,
(
err
)
=>
{
if
(
err
)
{
console
.
error
(
`AudioFrameworkTest: Device Test: Callback : setDeviceActive : BLUETOOTH_SCO: Active: Error:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
}
else
{
console
.
info
(
'
AudioFrameworkTest: Device Test: Callback : setDeviceActive : BLUETOOTH_SCO: Active
'
);
audioManager
.
isDeviceActive
(
7
,(
err
,
value
)
=>
{
if
(
err
)
{
console
.
error
(
`AudioFrameworkTest: Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Active: Error:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
}
else
if
(
value
==
true
){
console
.
info
(
'
AudioFrameworkTest: Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Active : PASS :
'
+
value
);
expect
(
true
).
assertTrue
();
}
else
{
console
.
info
(
'
AudioFrameworkTest: Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Active : FAIL :
'
+
value
);
expect
(
false
).
assertTrue
();
}
done
();
});
}
done
();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_CB_DEACTIVATE_023
* @tc.name : setDeviceActive - SPEAKER - deactivate - Callback
...
...
@@ -946,83 +755,6 @@ describe('audioManger_audio_1', function () {
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_DEACTIVATE_027
* @tc.name : setDeviceActive - BLUETOOTH_SCO - deactivate - Callback
* @tc.desc : Deactivate BLUETOOTH_SCO - Callback
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
SUB_AUDIO_MANAGER_setDeviceActive_DEACTIVATE_027
'
,
0
,
async
function
(
done
)
{
audioManager
.
setDeviceActive
(
audio
.
ActiveDeviceType
.
BLUETOOTH_SCO
,
false
,
(
err
)
=>
{
if
(
err
)
{
console
.
error
(
`AudioFrameworkTest: Device Test: Callback : setDeviceActive : BLUETOOTH_SCO: Deactivate: Error:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
}
else
{
console
.
info
(
'
AudioFrameworkTest: Device Test: Callback : setDeviceActive : BLUETOOTH_SCO: Active
'
);
audioManager
.
isDeviceActive
(
audio
.
ActiveDeviceType
.
BLUETOOTH_SCO
,(
err
,
value
)
=>
{
if
(
err
)
{
console
.
error
(
`AudioFrameworkTest: Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Deactivate: Error:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
}
else
if
(
value
==
false
){
console
.
info
(
'
AudioFrameworkTest: Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Deactivate : PASS :
'
+
value
);
expect
(
true
).
assertTrue
();
}
else
{
console
.
info
(
'
AudioFrameworkTest: Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Deactivate : FAIL :
'
+
value
);
expect
(
false
).
assertTrue
();
}
done
();
});
}
done
();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_DEACTIVATE_ENUM_028
* @tc.name : setDeviceActive - BLUETOOTH_SCO - deactivate - Callback
* @tc.desc : Deactivate BLUETOOTH_SCO - Callback
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
SUB_AUDIO_MANAGER_setDeviceActive_DEACTIVATE_ENUM_028
'
,
0
,
async
function
(
done
)
{
await
audioManager
.
setDeviceActive
(
7
,
true
).
then
(
function
(){
console
.
info
(
'
AudioFrameworkTest: Device Test: Promise : setDeviceActive : BLUETOOTH_SCO : Active
'
);
});
audioManager
.
setDeviceActive
(
7
,
false
,
(
err
)
=>
{
if
(
err
)
{
console
.
error
(
`AudioFrameworkTest: Device Test: Callback : setDeviceActive : BLUETOOTH_SCO: Deactivate: Error:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
}
else
{
console
.
info
(
'
AudioFrameworkTest: Device Test: Callback : setDeviceActive : BLUETOOTH_SCO: Active
'
);
audioManager
.
isDeviceActive
(
7
,
async
(
err
,
value
)
=>
{
if
(
err
)
{
console
.
error
(
`AudioFrameworkTest: Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Deactivate: Error:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
}
else
if
(
value
==
false
){
console
.
info
(
'
AudioFrameworkTest: Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Deactivate : PASS :
'
+
value
);
expect
(
true
).
assertTrue
();
}
else
{
console
.
info
(
'
AudioFrameworkTest: Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Deactivate : FAIL :
'
+
value
);
expect
(
false
).
assertTrue
();
}
done
();
await
sleep
(
1000
);
});
}
done
();
});
await
sleep
(
1000
);
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_DeviceType_001
* @tc.name : DeviceType - INVALID
...
...
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioFramework.test.js
浏览文件 @
8d3a54e6
...
...
@@ -13,11 +13,12 @@
* limitations under the License.
*/
import
audio
from
'
@ohos.multimedia.audio
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
;
describe
(
'
audioManger
_audio_2
'
,
function
()
{
describe
(
'
audioManger
'
,
function
()
{
console
.
info
(
'
AudioFrameworkTest: Create AudioManger Object JS Framework
'
);
const
audioManager
=
audio
.
getAudioManager
();
var
deviceRoleValue
=
null
;
...
...
@@ -29,7 +30,6 @@ describe('audioManger_audio_2', function () {
var
maxVol
=
15
;
var
lowVol
=
5
;
var
highVol
=
14
;
var
newVol
=
20
;
var
outOfRangeVol
=
28
;
var
longValue
=
'
28374837458743875804735081439085918459801437584738967509184509813904850914375904790589104801843
'
;
...
...
@@ -59,9 +59,6 @@ describe('audioManger_audio_2', function () {
else
if
(
value
.
deviceType
==
3
){
devTypeName
=
'
WIRED_HEADSET
'
;
}
else
if
(
value
.
deviceType
==
7
){
devTypeName
=
'
BLUETOOTH_SCO
'
;
}
else
if
(
value
.
deviceType
==
8
){
devTypeName
=
'
BLUETOOTH_A2DP
'
;
}
...
...
@@ -883,32 +880,6 @@ describe('audioManger_audio_2', function () {
done
();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_SetVolume_030
* @tc.name : setVolume - Media - Promise - Change Ringtone vol
* @tc.desc : Setvol to 20
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
SUB_AUDIO_MANAGER_SetVolume_030
'
,
0
,
async
function
(
done
)
{
const
promise
=
audioManager
.
setVolume
(
audio
.
AudioVolumeType
.
MEDIA
,
newVol
);
promise
.
then
(
function
()
{
audioManager
.
setVolume
(
audio
.
AudioVolumeType
.
RINGTONE
,
maxVol
);
audioManager
.
getVolume
(
audio
.
AudioVolumeType
.
MEDIA
).
then
(
function
(
data
)
{
if
(
data
==
lowVol
){
console
.
info
(
'
AudioFrameworkTest: Media getVolume Promise: ENAME : PASS :
'
+
data
);
expect
(
true
).
assertTrue
();
}
else
{
console
.
info
(
'
AudioFrameworkTest: Media getVolume Promise: ENAME : FAIL :
'
+
data
);
expect
(
false
).
assertTrue
();
}
});
});
await
promise
;
done
();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_SetVolume_026
* @tc.name : setVolume - Media - Callback - Change Ringtone vol
...
...
@@ -973,35 +944,6 @@ describe('audioManger_audio_2', function () {
await
promise
;
done
();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_SetVolume_029
* @tc.name : setVolume - Ringtone - Promise - Change Media vol
* @tc.desc : Setvol to 20
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
SUB_AUDIO_MANAGER_SetVolume_029
'
,
0
,
async
function
(
done
)
{
const
promise
=
audioManager
.
setVolume
(
audio
.
AudioVolumeType
.
RINGTONE
,
newVol
);
promise
.
then
(
function
()
{
console
.
info
(
'
AudioFrameworkTest: Ringtone setVolume promise: ENAME: successful
'
);
audioManager
.
setVolume
(
audio
.
AudioVolumeType
.
MEDIA
,
lowVol
);
audioManager
.
getVolume
(
audio
.
AudioVolumeType
.
RINGTONE
).
then
(
function
(
data
)
{
if
(
data
==
highVol
){
console
.
info
(
'
AudioFrameworkTest: Ringtone getVolume Promise: ENAME: PASS :
'
+
data
);
expect
(
true
).
assertTrue
();
}
else
{
console
.
info
(
'
AudioFrameworkTest: Ringtone getVolume Promise: ENAME: FAIL :
'
+
data
);
expect
(
false
).
assertTrue
();
}
});
});
await
promise
;
done
();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_SetVolume_028
...
...
@@ -3159,34 +3101,6 @@ describe('audioManger_audio_2', function () {
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_001
* @tc.name : setDeviceActive - BLUETOOTH_SCO - Activate - Promise
* @tc.desc : Activate BLUETOOTH_SCO - Promise
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
SUB_AUDIO_MANAGER_setDeviceActive_001
'
,
0
,
async
function
(
done
)
{
await
audioManager
.
setDeviceActive
(
audio
.
ActiveDeviceType
.
BLUETOOTH_SCO
,
true
).
then
(
function
(){
console
.
info
(
'
AudioFrameworkTest: Device Test: Promise : setDeviceActive : BLUETOOTH_SCO: Activate
'
);
audioManager
.
isDeviceActive
(
7
).
then
(
function
(
value
){
if
(
value
==
true
){
console
.
info
(
'
AudioFrameworkTest: Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Activate : PASS :
'
+
value
);
expect
(
true
).
assertTrue
();
}
else
{
console
.
info
(
'
AudioFrameworkTest: Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Activate : FAIL :
'
+
value
);
expect
(
false
).
assertTrue
();
}
});
}).
catch
((
err
)
=>
{
console
.
info
(
'
AudioFrameworkTest: Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Activate : FAIL : Error :
'
+
err
.
message
);
expect
(
false
).
assertTrue
();
});
done
();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_002
* @tc.name : setDeviceActive - SPEAKER - deactivate - Promise
...
...
@@ -3244,71 +3158,7 @@ describe('audioManger_audio_2', function () {
done
();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_004
* @tc.name : setDeviceActive - BLUETOOTH_SCO - deactivate - Promise
* @tc.desc : Deactivate BLUETOOTH_SCO - Promise
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
SUB_AUDIO_MANAGER_setDeviceActive_004
'
,
0
,
async
function
(
done
)
{
await
audioManager
.
setDeviceActive
(
7
,
false
).
then
(
function
(){
// Setting device active ENUM 3 = BLUETOOTH_SCO
console
.
info
(
'
AudioFrameworkTest: Device Test: Promise : setDeviceActive : BLUETOOTH_SCO: Deactivate
'
);
audioManager
.
isDeviceActive
(
audio
.
ActiveDeviceType
.
BLUETOOTH_SCO
).
then
(
function
(
value
){
if
(
value
==
false
){
console
.
info
(
'
AudioFrameworkTest: Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Deactivate : PASS :
'
+
value
);
expect
(
true
).
assertTrue
();
}
else
{
console
.
info
(
'
AudioFrameworkTest: Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Deactivate : FAIL :
'
+
value
);
expect
(
false
).
assertTrue
();
}
});
}).
catch
((
err
)
=>
{
console
.
info
(
'
AudioFrameworkTest: Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Deactivate : FAIL : Error :
'
+
err
.
message
);
expect
(
false
).
assertTrue
();
});
done
();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_005
* @tc.name : setDeviceActive - BLUETOOTH_SCO - Activate - Callback
* @tc.desc : Activate BLUETOOTH_SCO - Callback
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
SUB_AUDIO_MANAGER_setDeviceActive_005
'
,
0
,
async
function
(
done
)
{
audioManager
.
setDeviceActive
(
audio
.
ActiveDeviceType
.
BLUETOOTH_SCO
,
true
,
(
err
)
=>
{
if
(
err
)
{
console
.
error
(
`AudioFrameworkTest: Device Test: Callback : setDeviceActive : BLUETOOTH_SCO: Active: Error:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
}
else
{
console
.
info
(
'
AudioFrameworkTest: Device Test: Callback : setDeviceActive : BLUETOOTH_SCO: Active
'
);
audioManager
.
isDeviceActive
(
7
,(
err
,
value
)
=>
{
if
(
err
)
{
console
.
error
(
`AudioFrameworkTest: Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Active: Error:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
}
else
if
(
value
==
true
){
console
.
info
(
'
AudioFrameworkTest: Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Active : PASS :
'
+
value
);
expect
(
true
).
assertTrue
();
}
else
{
console
.
info
(
'
AudioFrameworkTest: Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Active : FAIL :
'
+
value
);
expect
(
false
).
assertTrue
();
}
done
();
});
}
done
();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_006
* @tc.name : setDeviceActive - SPEAKER - deactivate - Callback
...
...
@@ -3381,42 +3231,7 @@ describe('audioManger_audio_2', function () {
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_008
* @tc.name : setDeviceActive - BLUETOOTH_SCO - deactivate - Callback
* @tc.desc : Deactivate BLUETOOTH_SCO - Callback
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
SUB_AUDIO_MANAGER_setDeviceActive_008
'
,
0
,
async
function
(
done
)
{
audioManager
.
setDeviceActive
(
audio
.
ActiveDeviceType
.
BLUETOOTH_SCO
,
false
,
(
err
)
=>
{
if
(
err
)
{
console
.
error
(
`AudioFrameworkTest: Device Test: Callback : setDeviceActive : BLUETOOTH_SCO: Deactivate: Error:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
}
else
{
console
.
info
(
'
AudioFrameworkTest: Device Test: Callback : setDeviceActive : BLUETOOTH_SCO: Active
'
);
audioManager
.
isDeviceActive
(
7
,(
err
,
value
)
=>
{
if
(
err
)
{
console
.
error
(
`AudioFrameworkTest: Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Deactivate: Error:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
}
else
if
(
value
==
false
){
console
.
info
(
'
AudioFrameworkTest: Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Deactivate : PASS :
'
+
value
);
expect
(
true
).
assertTrue
();
}
else
{
console
.
info
(
'
AudioFrameworkTest: Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Deactivate : FAIL :
'
+
value
);
expect
(
false
).
assertTrue
();
}
done
();
});
}
done
();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setAudioParameter_001
* @tc.name : setAudioParameter - Promise - Character & Number
...
...
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioRenderer.test.js
浏览文件 @
8d3a54e6
...
...
@@ -23,7 +23,7 @@ import ability_featureAbility from '@ohos.ability.featureAbility';
import
resourceManager
from
'
@ohos.resourceManager
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
;
describe
(
'
audioRenderer
_audio_1
'
,
function
()
{
describe
(
'
audioRenderer
'
,
function
()
{
let
fdRead
;
let
readpath
;
...
...
@@ -1400,7 +1400,7 @@ describe('audioRenderer_audio_1', function () {
});
await
sleep
(
waitTime
);
}
await
sleep
(
20
00
);
await
sleep
(
1
00
);
if
(
resultFlag
==
false
){
console
.
info
(
'
AudioFrameworkRenderLog: resultFlag :
'
+
resultFlag
);
return
resultFlag
;
...
...
@@ -7523,416 +7523,4 @@ describe('audioRenderer_audio_1', function () {
done
();
})
/* *
* @tc.number : SUB_AUDIO_RENDERER_Play_audio_082
* @tc.name : AudioRenderer-Set11-Media - CALLBACK
* @tc.desc : AudioRenderer with parameter set 11
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
SUB_AUDIO_RENDERER_Play_audio_082
'
,
0
,
async
function
(
done
)
{
var
AudioStreamInfo
=
{
samplingRate
:
audio
.
AudioSamplingRate
.
SAMPLE_RATE_48000
,
channels
:
audio
.
AudioChannel
.
CHANNEL_2
,
sampleFormat
:
audio
.
AudioSampleFormat
.
SAMPLE_FORMAT_S32LE
,
encodingType
:
audio
.
AudioEncodingType
.
ENCODING_TYPE_RAW
}
var
AudioRendererInfo
=
{
content
:
audio
.
ContentType
.
CONTENT_TYPE_SPEECH
,
usage
:
audio
.
StreamUsage
.
STREAM_USAGE_VOICE_COMMUNICATION
,
rendererFlags
:
1
}
var
AudioRendererOptions
=
{
streamInfo
:
AudioStreamInfo
,
rendererInfo
:
AudioRendererInfo
}
readpath
=
'
StarWars10s-2C-48000-4SW.wav
'
await
getFdRead
(
readpath
,
done
)
var
resultFlag
=
await
playbackCB
(
AudioRendererOptions
,
readpath
);
console
.
info
(
'
AudioFrameworkRenderLog: resultFlag :
'
+
resultFlag
);
await
sleep
(
9000
);
expect
(
resultFlag
).
assertTrue
();
await
closeFileDescriptor
(
readpath
);
done
();
})
/* *
* @tc.number : SUB_AUDIO_RENDERER_Play_audio_083
* @tc.name : AudioRenderer-Set1-Media - CALLBACK
* @tc.desc : AudioRenderer with parameter set 1
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
SUB_AUDIO_RENDERER_Play_audio_083
'
,
0
,
async
function
(
done
)
{
var
AudioStreamInfo
=
{
samplingRate
:
audio
.
AudioSamplingRate
.
SAMPLE_RATE_44100
,
channels
:
audio
.
AudioChannel
.
CHANNEL_1
,
sampleFormat
:
audio
.
AudioSampleFormat
.
SAMPLE_FORMAT_S16LE
,
encodingType
:
audio
.
AudioEncodingType
.
ENCODING_TYPE_RAW
}
var
AudioRendererInfo
=
{
content
:
audio
.
ContentType
.
CONTENT_TYPE_SPEECH
,
usage
:
audio
.
StreamUsage
.
STREAM_USAGE_VOICE_COMMUNICATION
,
rendererFlags
:
1
}
var
AudioRendererOptions
=
{
streamInfo
:
AudioStreamInfo
,
rendererInfo
:
AudioRendererInfo
}
readpath
=
'
StarWars10s-1C-44100-2SW.wav
'
await
getFdRead
(
readpath
,
done
)
var
resultFlag
=
await
playbackCB
(
AudioRendererOptions
,
readpath
);
console
.
info
(
'
AudioFrameworkRenderLog: resultFlag :
'
+
resultFlag
);
await
sleep
(
5000
);
expect
(
resultFlag
).
assertTrue
();
await
closeFileDescriptor
(
readpath
);
done
();
})
/* *
* @tc.number : SUB_AUDIO_RENDERER_Play_audio_084
* @tc.name : AudioRenderer-Set2-Media - CALLBACK
* @tc.desc : AudioRenderer with parameter set 2
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
SUB_AUDIO_RENDERER_Play_audio_084
'
,
0
,
async
function
(
done
)
{
var
AudioStreamInfo
=
{
samplingRate
:
audio
.
AudioSamplingRate
.
SAMPLE_RATE_8000
,
channels
:
audio
.
AudioChannel
.
CHANNEL_1
,
sampleFormat
:
audio
.
AudioSampleFormat
.
SAMPLE_FORMAT_S16LE
,
encodingType
:
audio
.
AudioEncodingType
.
ENCODING_TYPE_RAW
}
var
AudioRendererInfo
=
{
content
:
audio
.
ContentType
.
CONTENT_TYPE_SPEECH
,
usage
:
audio
.
StreamUsage
.
STREAM_USAGE_VOICE_COMMUNICATION
,
rendererFlags
:
1
}
var
AudioRendererOptions
=
{
streamInfo
:
AudioStreamInfo
,
rendererInfo
:
AudioRendererInfo
}
readpath
=
'
StarWars10s-1C-8000-2SW.wav
'
await
getFdRead
(
readpath
,
done
)
var
resultFlag
=
await
playbackCB
(
AudioRendererOptions
,
readpath
);
await
sleep
(
100
);
console
.
info
(
'
AudioFrameworkRenderLog: resultFlag :
'
+
resultFlag
);
expect
(
resultFlag
).
assertTrue
();
await
closeFileDescriptor
(
readpath
);
done
();
})
/* *
* @tc.number : SUB_AUDIO_RENDERER_Play_audio_085
* @tc.name : AudioRenderer-Set3-Media - CALLBACK
* @tc.desc : AudioRenderer with parameter set 3
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
SUB_AUDIO_RENDERER_Play_audio_085
'
,
0
,
async
function
(
done
)
{
var
AudioStreamInfo
=
{
samplingRate
:
audio
.
AudioSamplingRate
.
SAMPLE_RATE_32000
,
channels
:
audio
.
AudioChannel
.
CHANNEL_1
,
sampleFormat
:
audio
.
AudioSampleFormat
.
SAMPLE_FORMAT_U8
,
encodingType
:
audio
.
AudioEncodingType
.
ENCODING_TYPE_RAW
}
var
AudioRendererInfo
=
{
content
:
audio
.
ContentType
.
CONTENT_TYPE_SPEECH
,
usage
:
audio
.
StreamUsage
.
STREAM_USAGE_VOICE_COMMUNICATION
,
rendererFlags
:
1
}
var
AudioRendererOptions
=
{
streamInfo
:
AudioStreamInfo
,
rendererInfo
:
AudioRendererInfo
}
readpath
=
'
StarWars10s-1C-32000-1SW.wav
'
await
getFdRead
(
readpath
,
done
)
var
resultFlag
=
await
playbackCB
(
AudioRendererOptions
,
readpath
);
await
sleep
(
100
);
console
.
info
(
'
AudioFrameworkRenderLog: resultFlag :
'
+
resultFlag
);
expect
(
resultFlag
).
assertTrue
();
await
closeFileDescriptor
(
readpath
);
done
();
})
/* *
* @tc.number : SUB_AUDIO_RENDERER_Play_audio_086
* @tc.name : AudioRenderer-Set4-Media - CALLBACK
* @tc.desc : AudioRenderer with parameter set 4
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
SUB_AUDIO_RENDERER_Play_audio_086
'
,
0
,
async
function
(
done
)
{
var
AudioStreamInfo
=
{
samplingRate
:
audio
.
AudioSamplingRate
.
SAMPLE_RATE_64000
,
channels
:
audio
.
AudioChannel
.
CHANNEL_1
,
sampleFormat
:
audio
.
AudioSampleFormat
.
SAMPLE_FORMAT_S24LE
,
encodingType
:
audio
.
AudioEncodingType
.
ENCODING_TYPE_RAW
}
var
AudioRendererInfo
=
{
content
:
audio
.
ContentType
.
CONTENT_TYPE_SPEECH
,
usage
:
audio
.
StreamUsage
.
STREAM_USAGE_VOICE_COMMUNICATION
,
rendererFlags
:
1
}
var
AudioRendererOptions
=
{
streamInfo
:
AudioStreamInfo
,
rendererInfo
:
AudioRendererInfo
}
readpath
=
'
StarWars10s-1C-64000-3SW.wav
'
await
getFdRead
(
readpath
,
done
)
var
resultFlag
=
await
playbackCB
(
AudioRendererOptions
,
readpath
);
await
sleep
(
100
);
console
.
info
(
'
AudioFrameworkRenderLog: resultFlag :
'
+
resultFlag
);
expect
(
resultFlag
).
assertTrue
();
await
closeFileDescriptor
(
readpath
);
done
();
})
/* *
* @tc.number : SUB_AUDIO_RENDERER_Play_audio_087
* @tc.name : AudioRenderer-Set5-Media - CALLBACK
* @tc.desc : AudioRenderer with parameter set 5
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
SUB_AUDIO_RENDERER_Play_audio_087
'
,
0
,
async
function
(
done
)
{
var
AudioStreamInfo
=
{
samplingRate
:
audio
.
AudioSamplingRate
.
SAMPLE_RATE_96000
,
channels
:
audio
.
AudioChannel
.
CHANNEL_1
,
sampleFormat
:
audio
.
AudioSampleFormat
.
SAMPLE_FORMAT_S32LE
,
encodingType
:
audio
.
AudioEncodingType
.
ENCODING_TYPE_RAW
}
var
AudioRendererInfo
=
{
content
:
audio
.
ContentType
.
CONTENT_TYPE_SPEECH
,
usage
:
audio
.
StreamUsage
.
STREAM_USAGE_VOICE_COMMUNICATION
,
rendererFlags
:
1
}
var
AudioRendererOptions
=
{
streamInfo
:
AudioStreamInfo
,
rendererInfo
:
AudioRendererInfo
}
readpath
=
'
StarWars10s-1C-96000-4SW.wav
'
await
getFdRead
(
readpath
,
done
)
var
resultFlag
=
await
playbackCB
(
AudioRendererOptions
,
readpath
);
await
sleep
(
100
);
console
.
info
(
'
AudioFrameworkRenderLog: resultFlag :
'
+
resultFlag
);
expect
(
resultFlag
).
assertTrue
();
await
closeFileDescriptor
(
readpath
);
done
();
})
/* *
* @tc.number : SUB_AUDIO_RENDERER_Play_audio_088
* @tc.name : AudioRenderer-Set6-Media - CALLBACK
* @tc.desc : AudioRenderer with parameter set 6
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
SUB_AUDIO_RENDERER_Play_audio_088
'
,
0
,
async
function
(
done
)
{
var
AudioStreamInfo
=
{
samplingRate
:
audio
.
AudioSamplingRate
.
SAMPLE_RATE_11025
,
channels
:
audio
.
AudioChannel
.
CHANNEL_2
,
sampleFormat
:
audio
.
AudioSampleFormat
.
SAMPLE_FORMAT_U8
,
encodingType
:
audio
.
AudioEncodingType
.
ENCODING_TYPE_RAW
}
var
AudioRendererInfo
=
{
content
:
audio
.
ContentType
.
CONTENT_TYPE_SPEECH
,
usage
:
audio
.
StreamUsage
.
STREAM_USAGE_VOICE_COMMUNICATION
,
rendererFlags
:
1
}
var
AudioRendererOptions
=
{
streamInfo
:
AudioStreamInfo
,
rendererInfo
:
AudioRendererInfo
}
readpath
=
'
StarWars10s-2C-11025-1SW.wav
'
await
getFdRead
(
readpath
,
done
)
var
resultFlag
=
await
playbackCB
(
AudioRendererOptions
,
readpath
);
await
sleep
(
100
);
console
.
info
(
'
AudioFrameworkRenderLog: resultFlag :
'
+
resultFlag
);
expect
(
resultFlag
).
assertTrue
();
await
closeFileDescriptor
(
readpath
);
done
();
})
/* *
* @tc.number : SUB_AUDIO_RENDERER_Play_audio_089
* @tc.name : AudioRenderer-Set7-Media - CALLBACK
* @tc.desc : AudioRenderer with parameter set 7
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
SUB_AUDIO_RENDERER_Play_audio_089
'
,
0
,
async
function
(
done
)
{
var
AudioStreamInfo
=
{
samplingRate
:
audio
.
AudioSamplingRate
.
SAMPLE_RATE_12000
,
channels
:
audio
.
AudioChannel
.
CHANNEL_2
,
sampleFormat
:
audio
.
AudioSampleFormat
.
SAMPLE_FORMAT_S16LE
,
encodingType
:
audio
.
AudioEncodingType
.
ENCODING_TYPE_RAW
}
var
AudioRendererInfo
=
{
content
:
audio
.
ContentType
.
CONTENT_TYPE_SPEECH
,
usage
:
audio
.
StreamUsage
.
STREAM_USAGE_VOICE_COMMUNICATION
,
rendererFlags
:
1
}
var
AudioRendererOptions
=
{
streamInfo
:
AudioStreamInfo
,
rendererInfo
:
AudioRendererInfo
}
readpath
=
'
StarWars10s-2C-12000-2SW.wav
'
await
getFdRead
(
readpath
,
done
)
var
resultFlag
=
await
playbackCB
(
AudioRendererOptions
,
readpath
);
await
sleep
(
100
);
console
.
info
(
'
AudioFrameworkRenderLog: resultFlag :
'
+
resultFlag
);
expect
(
resultFlag
).
assertTrue
();
await
closeFileDescriptor
(
readpath
);
done
();
})
/* *
* @tc.number : SUB_AUDIO_RENDERER_Play_audio_090
* @tc.name : AudioRenderer-Set8-Media - CALLBACK
* @tc.desc : AudioRenderer with parameter set 8
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
SUB_AUDIO_RENDERER_Play_audio_090
'
,
0
,
async
function
(
done
)
{
var
AudioStreamInfo
=
{
samplingRate
:
audio
.
AudioSamplingRate
.
SAMPLE_RATE_16000
,
channels
:
audio
.
AudioChannel
.
CHANNEL_2
,
sampleFormat
:
audio
.
AudioSampleFormat
.
SAMPLE_FORMAT_S24LE
,
encodingType
:
audio
.
AudioEncodingType
.
ENCODING_TYPE_RAW
}
var
AudioRendererInfo
=
{
content
:
audio
.
ContentType
.
CONTENT_TYPE_SPEECH
,
usage
:
audio
.
StreamUsage
.
STREAM_USAGE_VOICE_COMMUNICATION
,
rendererFlags
:
1
}
var
AudioRendererOptions
=
{
streamInfo
:
AudioStreamInfo
,
rendererInfo
:
AudioRendererInfo
}
readpath
=
'
StarWars10s-2C-16000-3SW.wav
'
await
getFdRead
(
readpath
,
done
)
var
resultFlag
=
await
playbackCB
(
AudioRendererOptions
,
readpath
);
await
sleep
(
100
);
console
.
info
(
'
AudioFrameworkRenderLog: resultFlag :
'
+
resultFlag
);
expect
(
resultFlag
).
assertTrue
();
await
closeFileDescriptor
(
readpath
);
done
();
})
/* *
* @tc.number : SUB_AUDIO_RENDERER_Play_audio_091
* @tc.name : AudioRenderer-Set9-Media - CALLBACK
* @tc.desc : AudioRenderer with parameter set 9
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
SUB_AUDIO_RENDERER_Play_audio_091
'
,
0
,
async
function
(
done
)
{
var
AudioStreamInfo
=
{
samplingRate
:
audio
.
AudioSamplingRate
.
SAMPLE_RATE_22050
,
channels
:
audio
.
AudioChannel
.
CHANNEL_2
,
sampleFormat
:
audio
.
AudioSampleFormat
.
SAMPLE_FORMAT_S16LE
,
encodingType
:
audio
.
AudioEncodingType
.
ENCODING_TYPE_RAW
}
var
AudioRendererInfo
=
{
content
:
audio
.
ContentType
.
CONTENT_TYPE_SPEECH
,
usage
:
audio
.
StreamUsage
.
STREAM_USAGE_VOICE_COMMUNICATION
,
rendererFlags
:
1
}
var
AudioRendererOptions
=
{
streamInfo
:
AudioStreamInfo
,
rendererInfo
:
AudioRendererInfo
}
readpath
=
'
StarWars10s-2C-22050-2SW.wav
'
await
getFdRead
(
readpath
,
done
)
var
resultFlag
=
await
playbackCB
(
AudioRendererOptions
,
readpath
);
await
sleep
(
100
);
console
.
info
(
'
AudioFrameworkRenderLog: resultFlag :
'
+
resultFlag
);
expect
(
resultFlag
).
assertTrue
();
await
closeFileDescriptor
(
readpath
);
done
();
})
/* *
* @tc.number : SUB_AUDIO_RENDERER_Play_audio_092
* @tc.name : AudioRenderer-Set10-Media - CALLBACK
* @tc.desc : AudioRenderer with parameter set 10
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
SUB_AUDIO_RENDERER_Play_audio_092
'
,
0
,
async
function
(
done
)
{
var
AudioStreamInfo
=
{
samplingRate
:
audio
.
AudioSamplingRate
.
SAMPLE_RATE_24000
,
channels
:
audio
.
AudioChannel
.
CHANNEL_2
,
sampleFormat
:
audio
.
AudioSampleFormat
.
SAMPLE_FORMAT_S24LE
,
encodingType
:
audio
.
AudioEncodingType
.
ENCODING_TYPE_RAW
}
var
AudioRendererInfo
=
{
content
:
audio
.
ContentType
.
CONTENT_TYPE_SPEECH
,
usage
:
audio
.
StreamUsage
.
STREAM_USAGE_VOICE_COMMUNICATION
,
rendererFlags
:
1
}
var
AudioRendererOptions
=
{
streamInfo
:
AudioStreamInfo
,
rendererInfo
:
AudioRendererInfo
}
readpath
=
'
StarWars10s-2C-24000-3SW.wav
'
await
getFdRead
(
readpath
,
done
)
var
resultFlag
=
await
playbackCB
(
AudioRendererOptions
,
readpath
);
await
sleep
(
100
);
console
.
info
(
'
AudioFrameworkRenderLog: resultFlag :
'
+
resultFlag
);
expect
(
resultFlag
).
assertTrue
();
await
closeFileDescriptor
(
readpath
);
done
();
})
})
\ No newline at end of file
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioRendererChangeInfo.test.js
0 → 100644
浏览文件 @
8d3a54e6
此差异已折叠。
点击以展开。
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioVOIP.test.js
浏览文件 @
8d3a54e6
...
...
@@ -24,7 +24,7 @@ import featureAbility from '@ohos.ability.featureAbility'
import
resourceManager
from
'
@ohos.resourceManager
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
;
describe
(
'
audioRenderer
_audio_2
'
,
function
()
{
describe
(
'
audioRenderer
'
,
function
()
{
var
mediaDir
;
let
fdRead
;
let
readpath
;
...
...
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/List.test.js
浏览文件 @
8d3a54e6
...
...
@@ -20,4 +20,6 @@ require('./AudioCall.test.js')
require
(
'
./AudioCapturer.test.js
'
)
require
(
'
./AudioEventManagement.test.js
'
)
require
(
'
./AudioRenderer.test.js
'
)
require
(
'
./AudioRendererChangeInfo.test.js
'
)
require
(
'
./AudioCapturerChangeInfo.test.js
'
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录