Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
946f2e48
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看板
提交
946f2e48
编写于
11月 01, 2022
作者:
L
lwx1121892
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modiy
Signed-off-by:
N
lwx1121892
<
liuxueqi3@huawei.com
>
上级
e6f113ef
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
59 addition
and
35 deletion
+59
-35
multimedia/audio/audio_js_standard/AudioCapturer/src/main/js/test/AudioCapturer.test.js
...dard/AudioCapturer/src/main/js/test/AudioCapturer.test.js
+56
-33
multimedia/audio/audio_js_standard/audioInterrupt/src/main/js/test/AudioInterrupt.test.js
...rd/audioInterrupt/src/main/js/test/AudioInterrupt.test.js
+3
-2
未找到文件。
multimedia/audio/audio_js_standard/AudioCapturer/src/main/js/test/AudioCapturer.test.js
浏览文件 @
946f2e48
...
...
@@ -357,15 +357,26 @@ 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
)}
`
);
}
});
toNextStep
(
audioCap
,
steps
,
done
);
}
catch
(
error
)
{
if
(
error
.
code
==
401
){
markReachState
=
'
invalid_failure
'
;
toNextStep
(
audioCap
,
steps
,
done
);
}
else
{
console
.
info
(
"
err
"
+
error
.
code
);
toNextStep
(
audioCap
,
steps
,
done
);
}
});
toNextStep
(
audioCap
,
steps
,
done
);
}
});
eventEmitter
.
on
(
OFF_MARK_REACH_EVENT
,
(
audioCap
,
steps
,
done
)
=>
{
...
...
@@ -380,15 +391,27 @@ 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
)}
`
);
}
});
toNextStep
(
audioCap
,
steps
,
done
);
}
catch
(
error
)
{
if
(
error
.
code
==
401
){
markReachState
=
'
invalid_failure
'
;
toNextStep
(
audioCap
,
steps
,
done
);
}
else
{
console
.
info
(
"
err
"
+
error
.
code
);
toNextStep
(
audioCap
,
steps
,
done
);
}
}
);
toNextStep
(
audioCap
,
steps
,
done
);
}
});
eventEmitter
.
on
(
OFF_PERIODR_REACH_EVENT
,
(
audioCap
,
steps
,
done
)
=>
{
console
.
log
(
`
${
Tag
}
emit:
${
JSON
.
stringify
(
OFF_PERIODR_REACH_EVENT
)}
`
);
...
...
@@ -421,7 +444,7 @@ describe('audioCapturer', function () {
console
.
info
(
`
${
Tag
}
AudioFrameworkTest: beforeAll: Prerequisites at the test suite level`
);
let
permissionName1
=
'
ohos.permission.MICROPHONE
'
;
let
permissionName2
=
'
ohos.permission.MANAGE_AUDIO_CONFIG
'
;
let
permissionNameList
=
[
permissionName1
,
permissionName2
];
let
permissionNameList
=
[
permissionName1
,
permissionName2
];
let
appName
=
'
ohos.acts.multimedia.audio.audiocapturer
'
;
await
audioTestBase
.
applyPermission
(
appName
,
permissionNameList
);
await
sleep
(
100
);
...
...
@@ -1719,7 +1742,7 @@ describe('audioCapturer', function () {
*@tc.type : Function
*@tc.level : Level 2
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_VOIP_REC_VOICE_CHAT_PROMISE_1300
'
,
2
,
async
function
(
done
)
{
it
(
'
SUB_MULTIMEDIA_AUDIO_VOIP_REC_VOICE_CHAT_PROMISE_1300
'
,
2
,
async
function
(
done
)
{
let
audioStreamInfo64000
=
{
samplingRate
:
audio
.
AudioSamplingRate
.
SAMPLE_RATE_64000
,
channels
:
audio
.
AudioChannel
.
CHANNEL_2
,
...
...
@@ -1998,7 +2021,7 @@ describe('audioCapturer', function () {
console
.
log
(
`
${
Tag
}
start-getAudioTime-getBufferSize-read-getAudioTimein- err:
${
JSON
.
stringify
(
err
)}
`
);
expect
(
false
).
assertTrue
();
}
try
{
try
{
await
audioCapPromise
.
stop
();
let
audioTime2
=
await
audioCapPromise
.
getAudioTime
();
console
.
log
(
`
${
Tag
}
audioTime2:
${
JSON
.
stringify
(
audioTime2
)}
`
);
...
...
@@ -2007,7 +2030,7 @@ describe('audioCapturer', function () {
console
.
log
(
`
${
Tag
}
stop-getAudioTimein- err:
${
JSON
.
stringify
(
err
)}
`
);
expect
(
true
).
assertTrue
();
}
try
{
await
audioCapPromise
.
release
();
}
catch
(
err
)
{
...
...
@@ -2424,7 +2447,7 @@ describe('audioCapturer', function () {
*@tc.type : Function
*@tc.level : Level 2
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_REC_PR_VOICE_CHAT_GET_CAPTURER_StreamId_ENUM_0100
'
,
2
,
async
function
(
done
)
{
it
(
'
SUB_MULTIMEDIA_AUDIO_REC_PR_VOICE_CHAT_GET_CAPTURER_StreamId_ENUM_0100
'
,
2
,
async
function
(
done
)
{
let
audioStreamInfo44100
=
{
samplingRate
:
44100
,
channels
:
1
,
...
...
@@ -2466,15 +2489,15 @@ describe('audioCapturer', function () {
done
();
})
/**
*@tc.number : SUB_MULTIMEDIA_AUDIO_REC_PR_VOICE_CHAT_GET_CAPTURER_StreamId_ENUM_0200
*@tc.name : AudioRec-Set1
*@tc.desc : record audio with parameter set 1
*@tc.size : MEDIUM
*@tc.type : Function
*@tc.level : Level 2
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_REC_PR_VOICE_CHAT_GET_CAPTURER_StreamId_ENUM_0200
'
,
2
,
async
function
(
done
)
{
/**
*@tc.number : SUB_MULTIMEDIA_AUDIO_REC_PR_VOICE_CHAT_GET_CAPTURER_StreamId_ENUM_0200
*@tc.name : AudioRec-Set1
*@tc.desc : record audio with parameter set 1
*@tc.size : MEDIUM
*@tc.type : Function
*@tc.level : Level 2
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_REC_PR_VOICE_CHAT_GET_CAPTURER_StreamId_ENUM_0200
'
,
2
,
async
function
(
done
)
{
let
audioStreamInfo44100
=
{
samplingRate
:
44100
,
channels
:
1
,
...
...
@@ -2899,7 +2922,7 @@ describe('audioCapturer', function () {
let
audioCap
=
null
;
let
markReachParam
=
0
;
markReachState
=
'
invalid_failure
'
;
markReachState
=
'
fail
'
;
let
mySteps
=
[
CREATE_EVENT
,
AudioCapturerOptions
,
MARK_REACH_EVENT
,
markReachParam
,
START_EVENT
,
GET_BUFFERSIZE_EVENT
,
READ_EVENT
,
OFF_MARK_REACH_EVENT
,
RELEASE_EVENT
,
END_EVENT
];
eventEmitter
.
emit
(
mySteps
[
0
],
audioCap
,
mySteps
,
done
);
})
...
...
@@ -2963,7 +2986,7 @@ describe('audioCapturer', function () {
let
audioCap
=
null
;
let
markReachParam
=
-
2
;
markReachState
=
'
invalid_failure
'
;
markReachState
=
'
fail
'
;
let
mySteps
=
[
CREATE_EVENT
,
AudioCapturerOptions
,
MARK_REACH_EVENT
,
markReachParam
,
START_EVENT
,
GET_BUFFERSIZE_EVENT
,
READ_EVENT
,
OFF_MARK_REACH_EVENT
,
RELEASE_EVENT
,
END_EVENT
];
eventEmitter
.
emit
(
mySteps
[
0
],
audioCap
,
mySteps
,
done
);
})
...
...
@@ -3059,7 +3082,7 @@ describe('audioCapturer', function () {
let
audioCap
=
null
;
let
periodReachParam
=
-
2
;
periodReachState
=
'
invalid_failure
'
;
periodReachState
=
'
fail
'
;
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
);
})
...
...
multimedia/audio/audio_js_standard/audioInterrupt/src/main/js/test/AudioInterrupt.test.js
浏览文件 @
946f2e48
...
...
@@ -65,7 +65,7 @@ describe('audioInterrupt', function () {
beforeAll
(
function
()
{
console
.
info
(
'
audioRenderInterrupt: beforeAll: Prerequisites at the test suite level
'
);
getcreateAVSession
();
//
getcreateAVSession();
})
beforeEach
(
async
function
()
{
...
...
@@ -150,7 +150,8 @@ describe('audioInterrupt', function () {
// console.info('activated == false')
// return;
// }
await
audioRen
.
start
().
then
(
async
function
()
{
console
.
info
(
'
AudioFrameworkRenderLog: AudioRenderer : STATE :
'
+
audioRen
.
state
);
await
audioRen
.
start
().
then
(()
=>
{
console
.
info
(
'
AudioFrameworkRenderLog: renderInstant started :SUCCESS
'
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
AudioFrameworkRenderLog: renderInstant start :ERROR :
'
+
err
.
message
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录