Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
c6758f83
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看板
未验证
提交
c6758f83
编写于
3月 31, 2023
作者:
O
openharmony_ci
提交者:
Gitee
3月 31, 2023
浏览文件
操作
浏览文件
下载
差异文件
!8311 输出录制文件名使用时间戳生成 避免用例多次执行时报错(该文件已存在)
Merge pull request !8311 from Nicklaus/master
上级
db1031cf
ef9c5be3
变更
2
展开全部
隐藏空白更改
内联
并排
Showing
2 changed file
with
147 addition
and
171 deletion
+147
-171
multimedia/media/media_js_standard/AVRecorderTestBase.js
multimedia/media/media_js_standard/AVRecorderTestBase.js
+32
-18
multimedia/media/media_js_standard/avRecorder/src/main/js/test/AVRecorderFuncTest.test.js
...rd/avRecorder/src/main/js/test/AVRecorderFuncTest.test.js
+115
-153
未找到文件。
multimedia/media/media_js_standard/AVRecorderTestBase.js
浏览文件 @
c6758f83
...
...
@@ -16,17 +16,24 @@
import
media
from
'
@ohos.multimedia.media
'
import
*
as
mediaTestBase
from
'
./MediaTestBase.js
'
;
async
function
idleCallBack
(
avRecorder
)
{
console
.
info
(
'
case createAVRecorder called
'
);
await
media
.
createAVRecorder
((
error
,
recorder
)
=>
{
export
function
resourceName
(){
let
timestamp
=
Date
.
now
();
let
filename
=
`avRecorder_
${
timestamp
}
.m4a`
;
return
filename
;
}
export
async
function
idleCallback
(
avRecorder
,
avConfig
,
done
)
{
console
.
info
(
'
case idleCallback called
'
);
media
.
createAVRecorder
((
error
,
recorder
)
=>
{
if
(
recorder
!=
null
)
{
avRecorder
=
recorder
;
console
.
info
(
'
createAVRecorder success
'
);
console
.
info
(
'
createAVRecorder idleCallback success
'
);
avRecorder
.
prepare
(
avConfig
)
releaseDone
(
avRecorder
,
done
)
}
else
{
console
.
info
(
`createAVRecorder fail, error:
${
error
}
`
);
console
.
info
(
`createAVRecorder
idleCallback
fail, error:
${
error
}
`
);
}
});
return
avRecorder
;
}
export
async
function
idle
(
avRecorder
)
{
...
...
@@ -1378,6 +1385,10 @@ export async function avRecorderReliabilitTest03(avConfig, avRecorder, recorderT
await
avRecorder
.
prepare
(
avConfig
)
}
export
async
function
avRecorderReliabilitTest001
(
avConfig
,
avRecorder
,
recorderTime
,
done
)
{
idleCallback
(
avRecorder
,
avConfig
,
done
)
}
export
async
function
avRecorderReliabilitTest04
(
avConfig
,
avRecorder
,
recorderTime
,
done
)
{
let
result
=
true
;
avRecorder
=
await
idle
(
avRecorder
);
...
...
@@ -2260,25 +2271,28 @@ export async function createTimeTestCallback(avConfig, avRecorder, recorderTime,
for
(
var
i
=
0
;
i
<
10
;
i
++
){
let
start
=
Date
.
now
();
console
.
info
(
`createTimeTestCallback start time is :
${
start
}
`
)
avRecorder
=
await
idle
CallBack
(
avRecorder
);
avRecorder
=
await
idle
(
avRecorder
);
let
end
=
Date
.
now
()
let
execution
=
parseInt
(
end
-
start
)
console
.
info
(
"
createTimeTestCallback execution time is :
"
+
execution
)
totalTime
=
totalTime
+
execution
;
await
avRecorder
.
release
().
then
(()
=>
{
console
.
info
(
'
createTimeTestCallback avPlayer is release
'
)
console
.
info
(
`createTimeTestCallback avRecorder.state is :
${
avRecorder
.
state
}
`
)
expect
(
avRecorder
.
state
).
assertEqual
(
AV_RECORDER_STATE
.
RELEASED
);
if
(
i
==
9
){
let
avg
=
totalTime
/
10
;
console
.
info
(
"
createTimeTest avg time is :
"
+
avg
)
done
();
}
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
}
let
avg
=
totalTime
/
10
;
console
.
info
(
"
createTimeTest avg time is :
"
+
avg
)
done
();
}
export
async
function
prepareTimeCallback
(
avConfig
,
avRecorder
,
recorderTime
,
done
)
{
let
totalTime
=
0
;
for
(
var
i
=
0
;
i
<
10
;
i
++
){
avRecorder
=
await
idle
CallBack
(
avRecorder
);
avRecorder
=
await
idle
(
avRecorder
);
await
sleep
(
20
)
let
start
=
Date
.
now
();
console
.
info
(
`prepareTimeWithoutCallback start time is :
${
start
}
`
)
...
...
@@ -2310,7 +2324,7 @@ export async function getInputSurfaceTimeTestCallback(avConfig, avRecorder, reco
let
totalTime
=
0
;
let
surfaceID
=
null
;
for
(
var
i
=
0
;
i
<
10
;
i
++
){
avRecorder
=
await
idle
CallBack
(
avRecorder
);
avRecorder
=
await
idle
(
avRecorder
);
await
sleep
(
20
)
let
end
;
await
avRecorder
.
prepare
(
avConfig
).
then
(()
=>
{
...
...
@@ -2346,7 +2360,7 @@ export async function getInputSurfaceTimeTestCallback(avConfig, avRecorder, reco
export
async
function
startTimeTestCallback
(
avConfig
,
avRecorder
,
recorderTime
,
done
)
{
let
totalTime
=
0
;
for
(
var
i
=
0
;
i
<
10
;
i
++
){
avRecorder
=
await
idle
CallBack
(
avRecorder
);
avRecorder
=
await
idle
(
avRecorder
);
await
sleep
(
20
)
let
end
;
await
avRecorder
.
prepare
(
avConfig
).
then
(()
=>
{
...
...
@@ -2380,7 +2394,7 @@ export async function startTimeTestCallback(avConfig, avRecorder, recorderTime,
export
async
function
pauseTimeTestCallback
(
avConfig
,
avRecorder
,
recorderTime
,
done
)
{
let
totalTime
=
0
;
for
(
var
i
=
0
;
i
<
10
;
i
++
){
avRecorder
=
await
idle
CallBack
(
avRecorder
);
avRecorder
=
await
idle
(
avRecorder
);
await
sleep
(
20
)
await
avRecorder
.
prepare
(
avConfig
).
then
(()
=>
{
expect
(
avRecorder
.
state
).
assertEqual
(
AV_RECORDER_STATE
.
PREPARED
);
...
...
@@ -2420,7 +2434,7 @@ export async function pauseTimeTestCallback(avConfig, avRecorder, recorderTime,
export
async
function
resumeTimeTestCallback
(
avConfig
,
avRecorder
,
recorderTime
,
done
)
{
let
totalTime
=
0
;
for
(
var
i
=
0
;
i
<
10
;
i
++
){
avRecorder
=
await
idle
CallBack
(
avRecorder
);
avRecorder
=
await
idle
(
avRecorder
);
await
sleep
(
20
)
await
avRecorder
.
prepare
(
avConfig
).
then
(()
=>
{
expect
(
avRecorder
.
state
).
assertEqual
(
AV_RECORDER_STATE
.
PREPARED
);
...
...
@@ -2467,7 +2481,7 @@ export async function resumeTimeTestCallback(avConfig, avRecorder, recorderTime,
export
async
function
stopTimeTestCallback
(
avConfig
,
avRecorder
,
recorderTime
,
done
)
{
let
totalTime
=
0
;
for
(
var
i
=
0
;
i
<
10
;
i
++
){
avRecorder
=
await
idle
CallBack
(
avRecorder
);
avRecorder
=
await
idle
(
avRecorder
);
await
sleep
(
20
)
await
avRecorder
.
prepare
(
avConfig
).
then
(()
=>
{
expect
(
avRecorder
.
state
).
assertEqual
(
AV_RECORDER_STATE
.
PREPARED
);
...
...
@@ -2507,7 +2521,7 @@ export async function stopTimeTestCallback(avConfig, avRecorder, recorderTime, d
export
async
function
resetTimeTestCallback
(
avConfig
,
avRecorder
,
recorderTime
,
done
)
{
let
totalTime
=
0
;
for
(
var
i
=
0
;
i
<
10
;
i
++
){
avRecorder
=
await
idle
CallBack
(
avRecorder
);
avRecorder
=
await
idle
(
avRecorder
);
await
sleep
(
20
)
await
avRecorder
.
prepare
(
avConfig
).
then
(()
=>
{
expect
(
avRecorder
.
state
).
assertEqual
(
AV_RECORDER_STATE
.
PREPARED
);
...
...
@@ -2547,7 +2561,7 @@ export async function resetTimeTestCallback(avConfig, avRecorder, recorderTime,
export
async
function
releaseTimeTestCallback
(
avConfig
,
avRecorder
,
recorderTime
,
done
)
{
let
totalTime
=
0
;
for
(
var
i
=
0
;
i
<
10
;
i
++
){
avRecorder
=
await
idle
CallBack
(
avRecorder
);
avRecorder
=
await
idle
(
avRecorder
);
await
sleep
(
20
)
await
avRecorder
.
prepare
(
avConfig
).
then
(()
=>
{
expect
(
avRecorder
.
state
).
assertEqual
(
AV_RECORDER_STATE
.
PREPARED
);
...
...
multimedia/media/media_js_standard/avRecorder/src/main/js/test/AVRecorderFuncTest.test.js
浏览文件 @
c6758f83
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录