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,6 +357,7 @@ describe('audioCapturer', function () {
...
@@ -357,6 +357,7 @@ describe('audioCapturer', function () {
steps
.
shift
();
steps
.
shift
();
let
markReachParam
=
steps
[
0
];
let
markReachParam
=
steps
[
0
];
steps
.
shift
();
steps
.
shift
();
try
{
audioCap
.
on
(
'
markReach
'
,
markReachParam
,
(
position
)
=>
{
audioCap
.
on
(
'
markReach
'
,
markReachParam
,
(
position
)
=>
{
console
.
log
(
`
${
Tag
}
position:
${
JSON
.
stringify
(
position
)}
`
);
console
.
log
(
`
${
Tag
}
position:
${
JSON
.
stringify
(
position
)}
`
);
console
.
log
(
`
${
Tag
}
markReachParam:
${
JSON
.
stringify
(
markReachParam
)}
`
);
console
.
log
(
`
${
Tag
}
markReachParam:
${
JSON
.
stringify
(
markReachParam
)}
`
);
...
@@ -366,6 +367,16 @@ describe('audioCapturer', function () {
...
@@ -366,6 +367,16 @@ describe('audioCapturer', function () {
}
}
});
});
toNextStep
(
audioCap
,
steps
,
done
);
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
);
}
}
});
});
eventEmitter
.
on
(
OFF_MARK_REACH_EVENT
,
(
audioCap
,
steps
,
done
)
=>
{
eventEmitter
.
on
(
OFF_MARK_REACH_EVENT
,
(
audioCap
,
steps
,
done
)
=>
{
...
@@ -380,6 +391,7 @@ describe('audioCapturer', function () {
...
@@ -380,6 +391,7 @@ describe('audioCapturer', function () {
steps
.
shift
();
steps
.
shift
();
let
periodReachParam
=
steps
[
0
];
let
periodReachParam
=
steps
[
0
];
steps
.
shift
();
steps
.
shift
();
try
{
audioCap
.
on
(
'
periodReach
'
,
periodReachParam
,
(
position
)
=>
{
audioCap
.
on
(
'
periodReach
'
,
periodReachParam
,
(
position
)
=>
{
console
.
log
(
`
${
Tag
}
position:
${
JSON
.
stringify
(
position
)}
`
);
console
.
log
(
`
${
Tag
}
position:
${
JSON
.
stringify
(
position
)}
`
);
console
.
log
(
`
${
Tag
}
periodReachParam:
${
JSON
.
stringify
(
periodReachParam
)}
`
);
console
.
log
(
`
${
Tag
}
periodReachParam:
${
JSON
.
stringify
(
periodReachParam
)}
`
);
...
@@ -389,6 +401,17 @@ describe('audioCapturer', function () {
...
@@ -389,6 +401,17 @@ describe('audioCapturer', function () {
}
}
});
});
toNextStep
(
audioCap
,
steps
,
done
);
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
);
}
}
});
});
eventEmitter
.
on
(
OFF_PERIODR_REACH_EVENT
,
(
audioCap
,
steps
,
done
)
=>
{
eventEmitter
.
on
(
OFF_PERIODR_REACH_EVENT
,
(
audioCap
,
steps
,
done
)
=>
{
console
.
log
(
`
${
Tag
}
emit:
${
JSON
.
stringify
(
OFF_PERIODR_REACH_EVENT
)}
`
);
console
.
log
(
`
${
Tag
}
emit:
${
JSON
.
stringify
(
OFF_PERIODR_REACH_EVENT
)}
`
);
...
@@ -421,7 +444,7 @@ describe('audioCapturer', function () {
...
@@ -421,7 +444,7 @@ describe('audioCapturer', function () {
console
.
info
(
`
${
Tag
}
AudioFrameworkTest: beforeAll: Prerequisites at the test suite level`
);
console
.
info
(
`
${
Tag
}
AudioFrameworkTest: beforeAll: Prerequisites at the test suite level`
);
let
permissionName1
=
'
ohos.permission.MICROPHONE
'
;
let
permissionName1
=
'
ohos.permission.MICROPHONE
'
;
let
permissionName2
=
'
ohos.permission.MANAGE_AUDIO_CONFIG
'
;
let
permissionName2
=
'
ohos.permission.MANAGE_AUDIO_CONFIG
'
;
let
permissionNameList
=
[
permissionName1
,
permissionName2
];
let
permissionNameList
=
[
permissionName1
,
permissionName2
];
let
appName
=
'
ohos.acts.multimedia.audio.audiocapturer
'
;
let
appName
=
'
ohos.acts.multimedia.audio.audiocapturer
'
;
await
audioTestBase
.
applyPermission
(
appName
,
permissionNameList
);
await
audioTestBase
.
applyPermission
(
appName
,
permissionNameList
);
await
sleep
(
100
);
await
sleep
(
100
);
...
@@ -1998,7 +2021,7 @@ describe('audioCapturer', function () {
...
@@ -1998,7 +2021,7 @@ describe('audioCapturer', function () {
console
.
log
(
`
${
Tag
}
start-getAudioTime-getBufferSize-read-getAudioTimein- err:
${
JSON
.
stringify
(
err
)}
`
);
console
.
log
(
`
${
Tag
}
start-getAudioTime-getBufferSize-read-getAudioTimein- err:
${
JSON
.
stringify
(
err
)}
`
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
}
}
try
{
try
{
await
audioCapPromise
.
stop
();
await
audioCapPromise
.
stop
();
let
audioTime2
=
await
audioCapPromise
.
getAudioTime
();
let
audioTime2
=
await
audioCapPromise
.
getAudioTime
();
console
.
log
(
`
${
Tag
}
audioTime2:
${
JSON
.
stringify
(
audioTime2
)}
`
);
console
.
log
(
`
${
Tag
}
audioTime2:
${
JSON
.
stringify
(
audioTime2
)}
`
);
...
@@ -2899,7 +2922,7 @@ describe('audioCapturer', function () {
...
@@ -2899,7 +2922,7 @@ describe('audioCapturer', function () {
let
audioCap
=
null
;
let
audioCap
=
null
;
let
markReachParam
=
0
;
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
];
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
);
eventEmitter
.
emit
(
mySteps
[
0
],
audioCap
,
mySteps
,
done
);
})
})
...
@@ -2963,7 +2986,7 @@ describe('audioCapturer', function () {
...
@@ -2963,7 +2986,7 @@ describe('audioCapturer', function () {
let
audioCap
=
null
;
let
audioCap
=
null
;
let
markReachParam
=
-
2
;
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
];
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
);
eventEmitter
.
emit
(
mySteps
[
0
],
audioCap
,
mySteps
,
done
);
})
})
...
@@ -3059,7 +3082,7 @@ describe('audioCapturer', function () {
...
@@ -3059,7 +3082,7 @@ describe('audioCapturer', function () {
let
audioCap
=
null
;
let
audioCap
=
null
;
let
periodReachParam
=
-
2
;
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
];
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
);
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 () {
...
@@ -65,7 +65,7 @@ describe('audioInterrupt', function () {
beforeAll
(
function
()
{
beforeAll
(
function
()
{
console
.
info
(
'
audioRenderInterrupt: beforeAll: Prerequisites at the test suite level
'
);
console
.
info
(
'
audioRenderInterrupt: beforeAll: Prerequisites at the test suite level
'
);
getcreateAVSession
();
//
getcreateAVSession();
})
})
beforeEach
(
async
function
()
{
beforeEach
(
async
function
()
{
...
@@ -150,7 +150,8 @@ describe('audioInterrupt', function () {
...
@@ -150,7 +150,8 @@ describe('audioInterrupt', function () {
// console.info('activated == false')
// console.info('activated == false')
// return;
// return;
// }
// }
await
audioRen
.
start
().
then
(
async
function
()
{
console
.
info
(
'
AudioFrameworkRenderLog: AudioRenderer : STATE :
'
+
audioRen
.
state
);
await
audioRen
.
start
().
then
(()
=>
{
console
.
info
(
'
AudioFrameworkRenderLog: renderInstant started :SUCCESS
'
);
console
.
info
(
'
AudioFrameworkRenderLog: renderInstant started :SUCCESS
'
);
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
info
(
'
AudioFrameworkRenderLog: renderInstant start :ERROR :
'
+
err
.
message
);
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录