Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
4b60bf5d
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
4b60bf5d
编写于
11月 10, 2022
作者:
O
openharmony_ci
提交者:
Gitee
11月 10, 2022
浏览文件
操作
浏览文件
下载
差异文件
!6077 xts接口支持异常处理
Merge pull request !6077 from wangtao/master_commit
上级
de2fb4d3
30b34c04
变更
7
展开全部
隐藏空白更改
内联
并排
Showing
7 changed file
with
2401 addition
and
527 deletion
+2401
-527
multimedia/audio/audio_js_standard/AudioCapturer/src/main/js/test/AudioCapturer.test.js
...dard/AudioCapturer/src/main/js/test/AudioCapturer.test.js
+121
-26
multimedia/audio/audio_js_standard/AudioCapturerChangeInfo/src/main/js/test/AudioCapturerChangeInfo.test.js
...angeInfo/src/main/js/test/AudioCapturerChangeInfo.test.js
+2
-15
multimedia/audio/audio_js_standard/AudioRendererChangeInfo/src/main/js/test/AudioRendererChangeInfo.test.js
...angeInfo/src/main/js/test/AudioRendererChangeInfo.test.js
+2
-16
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioFramework.test.js
...dard/audioManager/src/main/js/test/AudioFramework.test.js
+8
-230
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioManagerApi9.test.js
...rd/audioManager/src/main/js/test/AudioManagerApi9.test.js
+1049
-0
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/List.test.js
...io_js_standard/audioManager/src/main/js/test/List.test.js
+1
-0
multimedia/audio/audio_js_standard/audioRenderer/src/main/js/test/AudioRenderer.test.js
...dard/audioRenderer/src/main/js/test/AudioRenderer.test.js
+1218
-240
未找到文件。
multimedia/audio/audio_js_standard/AudioCapturer/src/main/js/test/AudioCapturer.test.js
浏览文件 @
4b60bf5d
...
...
@@ -357,14 +357,19 @@ describe('audioCapturer', function () {
steps
.
shift
();
let
markReachParam
=
steps
[
0
];
steps
.
shift
();
audioCap
.
on
(
'
markReach
'
,
markReachParam
,
(
position
)
=>
{
console
.
log
(
`
${
Tag
}
position:
${
JSON
.
stringify
(
position
)}
`
);
console
.
log
(
`
${
Tag
}
markReachParam:
${
JSON
.
stringify
(
markReachParam
)}
`
);
if
(
position
==
markReachParam
)
{
markReachState
=
'
success
'
console
.
info
(
`
${
Tag
}
AudioRenderLog: mark reached:
${
JSON
.
stringify
(
position
)}
`
);
}
});
try
{
audioCap
.
on
(
'
markReach
'
,
markReachParam
,
(
position
)
=>
{
console
.
log
(
`
${
Tag
}
position:
${
JSON
.
stringify
(
position
)}
`
);
console
.
log
(
`
${
Tag
}
markReachParam:
${
JSON
.
stringify
(
markReachParam
)}
`
);
if
(
position
==
markReachParam
)
{
markReachState
=
'
success
'
console
.
info
(
`
${
Tag
}
AudioRenderLog: mark reached:
${
JSON
.
stringify
(
position
)}
`
);
}
});
}
catch
(
err
){
markReachState
=
'
error
'
console
.
error
(
`
${
Tag
}
AudioRenderLog: mark reached: error: code:
${
err
.
code
}
,message:
${
err
.
message
}
`
);
}
toNextStep
(
audioCap
,
steps
,
done
);
});
...
...
@@ -380,14 +385,19 @@ describe('audioCapturer', function () {
steps
.
shift
();
let
periodReachParam
=
steps
[
0
];
steps
.
shift
();
audioCap
.
on
(
'
periodReach
'
,
periodReachParam
,
(
position
)
=>
{
console
.
log
(
`
${
Tag
}
position:
${
JSON
.
stringify
(
position
)}
`
);
console
.
log
(
`
${
Tag
}
periodReachParam:
${
JSON
.
stringify
(
periodReachParam
)}
`
);
if
(
position
==
periodReachParam
)
{
periodReachState
=
'
success
'
console
.
info
(
`
${
Tag
}
AudioRenderLog: mark reached:
${
JSON
.
stringify
(
position
)}
`
);
}
});
try
{
audioCap
.
on
(
'
periodReach
'
,
periodReachParam
,
(
position
)
=>
{
console
.
log
(
`
${
Tag
}
position:
${
JSON
.
stringify
(
position
)}
`
);
console
.
log
(
`
${
Tag
}
periodReachParam:
${
JSON
.
stringify
(
periodReachParam
)}
`
);
if
(
position
==
periodReachParam
)
{
periodReachState
=
'
success
'
console
.
info
(
`
${
Tag
}
AudioRenderLog: mark reached:
${
JSON
.
stringify
(
position
)}
`
);
}
});
}
catch
(
err
){
periodReachState
=
'
error
'
console
.
error
(
`
${
Tag
}
AudioRenderLog: mark reached: error: code:
${
err
.
code
}
,message:
${
err
.
message
}
`
);
}
toNextStep
(
audioCap
,
steps
,
done
);
});
eventEmitter
.
on
(
OFF_PERIODR_REACH_EVENT
,
(
audioCap
,
steps
,
done
)
=>
{
...
...
@@ -441,9 +451,6 @@ describe('audioCapturer', function () {
console
.
info
(
`
${
Tag
}
AudioFrameworkTest: afterAll: Test suite-level cleanup condition`
);
})
async
function
recPromise
(
AudioCapturerOptions
,
done
)
{
let
audioCap
;
try
{
...
...
@@ -2101,9 +2108,17 @@ describe('audioCapturer', function () {
return
done
();
}
try
{
await
audioCapPromise
.
start
();
console
.
log
(
`
${
Tag
}
start ok`
);
}
catch
(
err
)
{
console
.
log
(
`
${
Tag
}
start err:
${
JSON
.
stringify
(
err
)}
`
);
expect
(
false
).
assertTrue
();
}
try
{
await
audioCapPromise
.
stop
();
console
.
log
(
`
${
Tag
}
stop ok`
);
expect
(
true
).
assertTrue
();
}
catch
(
err
)
{
console
.
log
(
`
${
Tag
}
stop err:
${
JSON
.
stringify
(
err
)}
`
);
expect
(
false
).
assertTrue
();
...
...
@@ -2440,13 +2455,8 @@ describe('audioCapturer', function () {
capturerInfo
:
audioCapturerInfo44100
,
}
await
audio
.
createAudioCapturer
(
AudioCapturerOptionsInvalid
).
then
(
function
(
data
)
{
if
(
data
==
undefined
)
{
console
.
info
(
`
${
Tag
}
AudioFrameworkRecLog: AudioCapturer Created : Unsuccess :
${
JSON
.
stringify
(
data
)}
`
);
expect
(
true
).
assertTrue
();
}
else
{
console
.
info
(
`
${
Tag
}
AudioFrameworkRecLog: AudioCapturer Created : Success:
${
JSON
.
stringify
(
data
)}
`
);
expect
(
false
).
assertTrue
();
}
console
.
info
(
`
${
Tag
}
AudioFrameworkRecLog: AudioCapturer Created : Success:
${
JSON
.
stringify
(
data
)}
`
);
expect
(
false
).
assertTrue
();
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
Tag
}
AudioFrameworkRecLog: AudioCapturer Created : ERROR :
${
JSON
.
stringify
(
err
.
message
)}
`
);
expect
(
true
).
assertTrue
();
...
...
@@ -2993,4 +3003,89 @@ describe('audioCapturer', function () {
let
mySteps
=
[
CREATE_EVENT
,
AudioCapturerOptions
,
PERIODR_REACH_EVENT
,
periodReachParam
,
START_EVENT
,
GET_BUFFERSIZE_EVENT
,
READ_EVENT
,
OFF_PERIODR_REACH_EVENT
,
RELEASE_EVENT
,
END_EVENT
];
eventEmitter
.
emit
(
mySteps
[
0
],
audioCap
,
mySteps
,
done
);
})
/**
*@tc.number : SUB_MULTIMEDIA_AUDIO_CAPTURER_GET_AUDIO_STREAM_ID_0100
*@tc.name : AudioCapturer - getAudioStreamId
*@tc.desc : AudioCapturer - getAudioStreamId
*@tc.size : MEDIUM
*@tc.type : Function
*@tc.level : Level 0
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_CAPTURER_GET_AUDIO_STREAM_ID_0100
'
,
0
,
async
function
(
done
)
{
let
AudioStreamInfo
=
{
samplingRate
:
audio
.
AudioSamplingRate
.
SAMPLE_RATE_44100
,
channels
:
audio
.
AudioChannel
.
CHANNEL_2
,
sampleFormat
:
audio
.
AudioSampleFormat
.
SAMPLE_FORMAT_S16LE
,
encodingType
:
audio
.
AudioEncodingType
.
ENCODING_TYPE_RAW
}
let
AudioCapturerInfo
=
{
source
:
audio
.
SourceType
.
SOURCE_TYPE_MIC
,
capturerFlags
:
0
}
let
AudioCapturerOptions
=
{
streamInfo
:
AudioStreamInfo
,
capturerInfo
:
AudioCapturerInfo
}
let
audioCapPromise
;
try
{
audioCapPromise
=
await
audio
.
createAudioCapturer
(
AudioCapturerOptions
);
await
audioCapPromise
.
getAudioStreamId
((
err
,
data
)
=>
{
if
(
err
)
{
console
.
info
(
`
${
Tag
}
: getAudioStreamId : ERROR : code:
${
err
.
code
}
, mesage:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
}
else
{
expect
(
true
).
assertTrue
();
console
.
info
(
`
${
Tag
}
: getAudioStreamId : Converted:
${
data
}
`
);
}
});
await
audioCapPromise
.
release
();
}
catch
(
err
)
{
console
.
log
(
`
${
Tag
}
err:
${
JSON
.
stringify
(
err
)}
`
);
expect
(
false
).
assertTrue
();
}
done
();
})
/**
*@tc.number : SUB_MULTIMEDIA_AUDIO_CAPTURER_GET_AUDIO_STREAM_ID_0200
*@tc.name : AudioCapturer - getAudioStreamId
*@tc.desc : AudioCapturer - getAudioStreamId
*@tc.size : MEDIUM
*@tc.type : Function
*@tc.level : Level 0
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_CAPTURER_GET_AUDIO_STREAM_ID_0200
'
,
0
,
async
function
(
done
)
{
let
AudioStreamInfo
=
{
samplingRate
:
audio
.
AudioSamplingRate
.
SAMPLE_RATE_44100
,
channels
:
audio
.
AudioChannel
.
CHANNEL_1
,
sampleFormat
:
audio
.
AudioSampleFormat
.
SAMPLE_FORMAT_S16LE
,
encodingType
:
audio
.
AudioEncodingType
.
ENCODING_TYPE_RAW
}
let
AudioCapturerInfo
=
{
source
:
audio
.
SourceType
.
SOURCE_TYPE_MIC
,
capturerFlags
:
0
}
let
AudioCapturerOptions
=
{
streamInfo
:
AudioStreamInfo
,
capturerInfo
:
AudioCapturerInfo
}
try
{
let
audioCapPromise
=
await
audio
.
createAudioCapturer
(
AudioCapturerOptions
);
await
audioCapPromise
.
getAudioStreamId
().
then
((
data
)
=>
{
expect
(
true
).
assertTrue
();
console
.
info
(
`
${
Tag
}
: getAudioStreamId : Converted:
${
data
}
`
);
}).
catch
((
err
)
=>
{
expect
(
true
).
assertTrue
();
console
.
error
(
`
${
Tag
}
: getAudioStreamId : ERROR :
${
err
}
`
);
});
await
audioCapPromise
.
release
();
}
catch
(
err
)
{
console
.
log
(
`
${
Tag
}
error code:
${
err
.
code
}
,message:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
}
done
();
})
})
multimedia/audio/audio_js_standard/AudioCapturerChangeInfo/src/main/js/test/AudioCapturerChangeInfo.test.js
浏览文件 @
4b60bf5d
...
...
@@ -35,22 +35,9 @@ describe('audioCapturerChange', function () {
await
sleep
(
100
);
console
.
info
(
`AudioFrameworkTest: beforeAll: END`
);
await
sleep
(
100
);
await
audioManager
.
getStreamManager
().
then
((
data
)
=>
{
audioStreamManager
=
data
;
console
.
info
(
`
${
Tag
}
: Get AudioStream Manager : Success `
);
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
Tag
}
: Get AudioStream Manager : ERROR :
${
err
.
message
}
`
);
});
audioManager
.
getStreamManager
((
err
,
data
)
=>
{
if
(
err
)
{
console
.
error
(
`
${
Tag
}
: Get AudioStream Manager : ERROR :
${
err
.
message
}
`
);
}
else
{
audioStreamManagerCB
=
data
;
console
.
info
(
`
${
Tag
}
: Get AudioStream Manager : Success `
);
}
});
audioStreamManager
=
audioManager
.
getStreamManager
();
audioStreamManagerCB
=
audioManager
.
getStreamManager
();
await
sleep
(
1000
);
console
.
info
(
`
${
Tag
}
: beforeAll: END`
);
})
...
...
multimedia/audio/audio_js_standard/AudioRendererChangeInfo/src/main/js/test/AudioRendererChangeInfo.test.js
浏览文件 @
4b60bf5d
...
...
@@ -25,24 +25,10 @@ describe('audioRendererChange', function () {
console
.
info
(
`
${
Tag
}
: Create AudioManger Object JS Framework`
);
beforeAll
(
async
function
()
{
await
AUDIOMANAGER
.
getStreamManager
().
then
(
function
(
data
)
{
audioStreamManager
=
data
;
console
.
info
(
`
${
Tag
}
: Get AudioStream Manager : Success `
);
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
Tag
}
: Get AudioStream Manager : ERROR :
${
err
.
message
}
`
);
});
AUDIOMANAGER
.
getStreamManager
((
err
,
data
)
=>
{
if
(
err
)
{
console
.
error
(
`
${
Tag
}
: Get AudioStream Manager : ERROR :
${
err
.
message
}
`
);
}
else
{
audioStreamManagerCB
=
data
;
console
.
info
(
`
${
Tag
}
: Get AudioStream Manager : Success `
);
}
});
audioStreamManager
=
AUDIOMANAGER
.
getStreamManager
();
audioStreamManagerCB
=
AUDIOMANAGER
.
getStreamManager
();
await
sleep
(
1000
);
console
.
info
(
`
${
Tag
}
: beforeAll: Prerequisites at the test suite level`
);
})
...
...
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioFramework.test.js
浏览文件 @
4b60bf5d
...
...
@@ -46,6 +46,7 @@ describe('audioFramework', function () {
console
.
info
(
`
${
TagFrmwk
}
: getAudioManger : FAIL`
);
}
}
function
sleep
(
ms
)
{
return
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
ms
));
}
...
...
@@ -4903,7 +4904,7 @@ describe('audioFramework', function () {
*@tc.level : Level 2
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0100
'
,
2
,
async
function
(
done
)
{
let
AudioRoutingManager
=
a
wait
a
udioManager
.
getRoutingManager
();
let
AudioRoutingManager
=
audioManager
.
getRoutingManager
();
AudioRoutingManager
.
getDevices
(
1
,
(
err
,
value
)
=>
{
// Getting all Output devices Enumb 1 = OUTPUT_DEVICES_FLAG
console
.
info
(
`
${
TagFrmwk
}
: Callback: getDevices OUTPUT_DEVICES_FLAG`
);
...
...
@@ -4937,7 +4938,7 @@ describe('audioFramework', function () {
*@tc.level : Level 2
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0200
'
,
2
,
async
function
(
done
)
{
let
AudioRoutingManager
=
a
wait
a
udioManager
.
getRoutingManager
();
let
AudioRoutingManager
=
audioManager
.
getRoutingManager
();
AudioRoutingManager
.
getDevices
(
2
,
(
err
,
value
)
=>
{
// Getting all Input Devices ENUM 2 = INPUT_DEVICES_FLAG
console
.
info
(
`
${
TagFrmwk
}
: Callback: getDevices INPUT_DEVICES_FLAG`
);
...
...
@@ -4970,7 +4971,7 @@ describe('audioFramework', function () {
*@tc.level : Level 2
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0300
'
,
2
,
async
function
(
done
)
{
let
AudioRoutingManager
=
a
wait
a
udioManager
.
getRoutingManager
();
let
AudioRoutingManager
=
audioManager
.
getRoutingManager
();
AudioRoutingManager
.
getDevices
(
3
,
(
err
,
value
)
=>
{
// Getting all devies connected 3 = ALL_DEVICES_FLAG
console
.
info
(
`
${
TagFrmwk
}
: Callback: getDevices ALL_DEVICES_FLAG`
);
...
...
@@ -5003,7 +5004,7 @@ describe('audioFramework', function () {
*@tc.level : Level 2
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0400
'
,
2
,
async
function
(
done
)
{
let
AudioRoutingManager
=
a
wait
a
udioManager
.
getRoutingManager
();
let
AudioRoutingManager
=
audioManager
.
getRoutingManager
();
AudioRoutingManager
.
getDevices
(
audio
.
DeviceFlag
.
OUTPUT_DEVICES_FLAG
,
(
err
,
value
)
=>
{
console
.
info
(
`
${
TagFrmwk
}
: Callback: getDevices OUTPUT_DEVICES_FLAG`
);
if
(
err
)
{
...
...
@@ -5035,7 +5036,7 @@ describe('audioFramework', function () {
*@tc.level : Level 2
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0500
'
,
2
,
async
function
(
done
)
{
let
AudioRoutingManager
=
a
wait
a
udioManager
.
getRoutingManager
();
let
AudioRoutingManager
=
audioManager
.
getRoutingManager
();
AudioRoutingManager
.
getDevices
(
audio
.
DeviceFlag
.
INPUT_DEVICES_FLAG
,
(
err
,
value
)
=>
{
console
.
info
(
`
${
TagFrmwk
}
: Callback: getDevices INPUT_DEVICES_FLAG`
);
if
(
err
)
{
...
...
@@ -5066,7 +5067,7 @@ describe('audioFramework', function () {
*@tc.level : Level 2
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0600
'
,
2
,
async
function
(
done
)
{
let
AudioRoutingManager
=
a
wait
a
udioManager
.
getRoutingManager
();
let
AudioRoutingManager
=
audioManager
.
getRoutingManager
();
AudioRoutingManager
.
getDevices
(
audio
.
DeviceFlag
.
ALL_DEVICES_FLAG
,
(
err
,
value
)
=>
{
console
.
info
(
`
${
TagFrmwk
}
: Callback: getDevices ALL_DEVICES_FLAG`
);
if
(
err
)
{
...
...
@@ -5097,7 +5098,7 @@ describe('audioFramework', function () {
*@tc.level : Level 2
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0700
'
,
2
,
async
function
(
done
)
{
let
AudioRoutingManager
=
a
wait
a
udioManager
.
getRoutingManager
();
let
AudioRoutingManager
=
audioManager
.
getRoutingManager
();
let
value
=
await
AudioRoutingManager
.
getDevices
(
audio
.
DeviceFlag
.
OUTPUT_DEVICES_FLAG
);
console
.
info
(
`
${
TagFrmwk
}
: Promise: getDevices OUTPUT_DEVICES_FLAG`
);
value
.
forEach
(
displayDeviceProp
);
...
...
@@ -5112,229 +5113,6 @@ describe('audioFramework', function () {
done
();
})
/**
*@tc.number : SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0800
*@tc.name : getDevices - INPUT device - Promise - ENAME
*@tc.desc : getDevices - INPUT device
*@tc.size : MEDIUM
*@tc.type : Function
*@tc.level : Level 2
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0800
'
,
2
,
function
(
done
)
{
audioManager
.
getRoutingManager
(
async
(
err
,
AudioRoutingManager
)
=>
{
if
(
err
)
{
console
.
error
(
`
${
TagFrmwk
}
: Callback: failed to get RoutingManager
${
err
.
message
}
`
);
expect
().
assertFail
();
}
else
{
let
value
=
await
AudioRoutingManager
.
getDevices
(
audio
.
DeviceFlag
.
INPUT_DEVICES_FLAG
)
console
.
info
(
`
${
TagFrmwk
}
: Promise: getDevices INPUT_DEVICES_FLAG`
);
value
.
forEach
(
displayDeviceProp
);
if
(
dTValue
!=
null
&&
dRValue
!=
null
&&
devId
>
0
&&
sRate
!=
null
&&
cCount
!=
null
&&
cMask
!=
null
)
{
console
.
info
(
`
${
TagFrmwk
}
: Promise: getDevices : INPUT_DEVICES_FLAG : PASS`
);
expect
(
true
).
assertTrue
();
}
else
{
console
.
info
(
`
${
TagFrmwk
}
: Promise: getDevices : INPUT_DEVICES_FLAG : FAIL`
);
expect
(
false
).
assertTrue
();
}
}
done
();
});
})
/**
*@tc.number : SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0900
*@tc.name : getDevices - ALL device - Promise - ENAME
*@tc.desc : getDevices - ALL device
*@tc.size : MEDIUM
*@tc.type : Function
*@tc.level : Level 2
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0900
'
,
2
,
function
(
done
)
{
audioManager
.
getRoutingManager
(
async
(
err
,
AudioRoutingManager
)
=>
{
if
(
err
)
{
console
.
error
(
`
${
TagFrmwk
}
:Callback:failed to get RoutingManager
${
err
.
message
}
`
);
expect
().
assertFail
();
}
else
{
let
value
=
await
AudioRoutingManager
.
getDevices
(
audio
.
DeviceFlag
.
ALL_DEVICES_FLAG
)
console
.
info
(
`
${
TagFrmwk
}
: Promise: getDevices ALL_DEVICES_FLAG`
);
value
.
forEach
(
displayDeviceProp
);
if
(
dTValue
!=
null
&&
dRValue
!=
null
&&
devId
>
0
&&
sRate
!=
null
&&
cCount
!=
null
&&
cMask
!=
null
)
{
console
.
info
(
`
${
TagFrmwk
}
: Promise: getDevices : ALL_DEVICES_FLAG : PASS`
);
expect
(
true
).
assertTrue
();
}
else
{
console
.
info
(
`
${
TagFrmwk
}
: Promise: getDevices : ALL_DEVICES_FLAG : FAIL`
);
expect
(
false
).
assertTrue
();
}
}
done
();
});
})
/**
*@tc.number : SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0100
*@tc.name : SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0100
*@tc.desc : micStateChange
*@tc.size : MEDIUM
*@tc.type : Function
*@tc.level : Level 2
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0100
'
,
2
,
async
function
(
done
)
{
try
{
var
routingManager
=
await
audioManager
.
getRoutingManager
();
}
catch
(
err
)
{
console
.
error
(
`
${
TagFrmwk
}
:Callback:failed to get RoutingManager
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
}
let
count
=
0
;
console
.
info
(
'
getRoutingManager Callback START.
'
);
routingManager
.
on
(
'
micStateChange
'
,
async
(
micStateChange
)
=>
{
count
++
;
})
try
{
let
data
=
await
audioManager
.
isMicrophoneMute
();
console
.
info
(
'
Promise isMicrophoneMute PASS:
'
+
data
);
await
audioManager
.
setMicrophoneMute
(
data
);
console
.
info
(
'
Promise setMicrophoneMute PASS.
'
);
let
data1
=
await
audioManager
.
isMicrophoneMute
();
console
.
info
(
'
Promise isMicrophoneMute PASS.
'
+
data1
);
}
catch
(
err
)
{
console
.
log
(
'
ERROR:
'
+
JSON
.
stringify
(
err
))
expect
(
false
).
assertTrue
();
done
();
}
await
sleep
(
2000
);
expect
(
count
).
assertEqual
(
0
);
done
();
})
/**
*@tc.number : SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0200
*@tc.name : SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0200
*@tc.desc : micStateChange
*@tc.size : MEDIUM
*@tc.type : Function
*@tc.level : Level 2
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0200
'
,
2
,
async
function
(
done
)
{
try
{
var
routingManager
=
await
audioManager
.
getRoutingManager
();
}
catch
(
err
)
{
console
.
error
(
`
${
TagFrmwk
}
:Callback:failed to get RoutingManager
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
}
console
.
info
(
'
getRoutingManager Callback START.
'
);
let
count
=
0
;
routingManager
.
on
(
'
micStateChange
'
,
async
(
micStateChange
)
=>
{
console
.
info
(
"
Updated micState:
"
+
JSON
.
stringify
(
micStateChange
));
count
++
;
})
try
{
let
data
=
await
audioManager
.
isMicrophoneMute
();
console
.
info
(
'
Promise isMicrophoneMute PASS:
'
+
data
);
let
micStatus
=
!
data
;
await
audioManager
.
setMicrophoneMute
(
micStatus
);
console
.
info
(
'
Promise setMicrophoneMute PASS:
'
+
micStatus
);
}
catch
(
err
)
{
console
.
log
(
'
ERROR:
'
+
JSON
.
stringify
(
err
))
expect
(
false
).
assertTrue
();
done
();
}
await
sleep
(
2000
);
expect
(
count
).
assertEqual
(
1
);
done
();
})
/**
*@tc.number : SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0300
*@tc.name : SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0300
*@tc.desc : micStateChange
*@tc.size : MEDIUM
*@tc.type : Function
*@tc.level : Level 2
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0300
'
,
2
,
async
function
(
done
)
{
try
{
var
routingManager
=
await
audioManager
.
getRoutingManager
();
}
catch
(
err
)
{
console
.
error
(
`
${
TagFrmwk
}
:Callback:failed to get RoutingManager
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
}
console
.
info
(
'
getRoutingManager Callback START.
'
);
let
count
=
0
;
routingManager
.
on
(
'
micStateChange
'
,
async
(
micStateChange
)
=>
{
console
.
info
(
"
Updated micState:
"
+
JSON
.
stringify
(
micStateChange
));
count
++
;
})
try
{
let
data
=
await
audioManager
.
isMicrophoneMute
();
console
.
info
(
'
Promise isMicrophoneMute PASS:
'
+
data
);
let
micStatus
=
!
data
;
await
audioManager
.
setMicrophoneMute
(
micStatus
);
console
.
info
(
'
Promise setMicrophoneMute PASS:
'
+
micStatus
);
await
audioManager
.
setMicrophoneMute
(
!
micStatus
);
console
.
info
(
'
Promise setMicrophoneMute PASS:
'
+
(
!
micStatus
));
}
catch
(
err
)
{
console
.
log
(
'
ERROR:
'
+
JSON
.
stringify
(
err
))
expect
(
false
).
assertTrue
();
done
();
}
await
sleep
(
2000
);
expect
(
count
).
assertEqual
(
2
);
done
();
})
/**
*@tc.number : SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0400
*@tc.name : SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0400
*@tc.desc : micStateChange
*@tc.size : MEDIUM
*@tc.type : Function
*@tc.level : Level 2
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0400
'
,
2
,
async
function
(
done
)
{
try
{
var
routingManager
=
await
audioManager
.
getRoutingManager
();
}
catch
(
err
)
{
console
.
error
(
`
${
TagFrmwk
}
:Callback:failed to get RoutingManager
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
}
let
count
=
0
;
try
{
console
.
info
(
"
enter SUB_AUDIO_MANAGER_micStateChange_004
"
);
routingManager
.
on
(
'
micStateChange
'
,
async
(
micStateChange1
)
=>
{
console
.
info
(
"
Updated micState--001:
"
+
JSON
.
stringify
(
micStateChange1
));
routingManager
.
on
(
'
micStateChange
'
,
async
(
micStateChange
)
=>
{
console
.
info
(
"
Updated micState--002:
"
+
JSON
.
stringify
(
micStateChange
));
count
++
})
let
data
=
await
audioManager
.
isMicrophoneMute
();
console
.
info
(
'
Second Promise isMicrophoneMute PASS:
'
+
data
);
await
audioManager
.
setMicrophoneMute
(
!
data
);
console
.
info
(
'
Second:Promise setMicrophoneMute PASS:
'
+
(
!
data
));
})
let
data
=
await
audioManager
.
isMicrophoneMute
();
console
.
info
(
'
First Promise isMicrophoneMute PASS:
'
+
data
);
await
audioManager
.
setMicrophoneMute
(
!
data
);
console
.
info
(
'
First:Promise setMicrophoneMute PASS:
'
+
(
!
data
));
}
catch
(
err
)
{
console
.
log
(
'
ERROR:
'
+
JSON
.
stringify
(
err
))
expect
(
false
).
assertTrue
();
done
();
}
await
sleep
(
2000
);
expect
(
count
).
assertEqual
(
1
);
done
();
})
/**
*@tc.number : SUB_MULTIMEDIA_AUDIO_DEVICEFALG_0100
*@tc.name : NONE_DEVICES_FLAG
...
...
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioManagerApi9.test.js
0 → 100755
浏览文件 @
4b60bf5d
此差异已折叠。
点击以展开。
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/List.test.js
浏览文件 @
4b60bf5d
...
...
@@ -14,4 +14,5 @@
*/
require
(
'
./AudioFramework.test.js
'
)
require
(
'
./AudioManagerApi9.test.js
'
)
multimedia/audio/audio_js_standard/audioRenderer/src/main/js/test/AudioRenderer.test.js
浏览文件 @
4b60bf5d
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录