Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
be811a21
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看板
未验证
提交
be811a21
编写于
12月 10, 2021
作者:
F
FULIZHONG
提交者:
Gitee
12月 10, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
open recorder js testcase in master
Signed-off-by: FULIZHONG<fulizhong@huawei.com>
上级
91e406dd
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
32 addition
and
8 deletion
+32
-8
multimedia/BUILD.gn
multimedia/BUILD.gn
+1
-0
multimedia/audio/audio_js_standard/audioRecorder/Test.json
multimedia/audio/audio_js_standard/audioRecorder/Test.json
+21
-0
multimedia/audio/audio_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioAPI.test.js
...corder/src/main/js/test/RecorderLocalTestAudioAPI.test.js
+8
-4
multimedia/audio/audio_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioFUNC.test.js
...order/src/main/js/test/RecorderLocalTestAudioFUNC.test.js
+2
-4
未找到文件。
multimedia/BUILD.gn
浏览文件 @
be811a21
...
...
@@ -20,6 +20,7 @@ group("multimedia") {
"audio/audio_js_standard/audioManager:audio_manager_js_hap",
"audio/audio_js_standard/audioPlayer:audio_player_js_hap",
"audio/audio_js_standard/audioPlayer_API:audio_player_api_js_hap",
"audio/audio_js_standard/audioRecorder:audio_recorder_js_hap",
"media/media_cpp_test_standard:ActsMediaCppStandardTest",
]
} else {
...
...
multimedia/audio/audio_js_standard/audioRecorder/Test.json
浏览文件 @
be811a21
...
...
@@ -10,6 +10,27 @@
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"mkdir -p /data/accounts/account_0/appdata/recorder"
,
"touch /data/accounts/account_0/appdata/recorder/test1.m4a"
,
"touch /data/accounts/account_0/appdata/recorder/test2.m4a"
,
"touch /data/accounts/account_0/appdata/recorder/test3.m4a"
,
"touch /data/accounts/account_0/appdata/recorder/test4.m4a"
,
"touch /data/accounts/account_0/appdata/recorder/test5.mp4"
,
"touch /data/accounts/account_0/appdata/recorder/test6.mp4"
,
"touch /data/accounts/account_0/appdata/recorder/test7.m4a"
,
"touch /data/accounts/account_0/appdata/recorder/test8.m4a"
,
"touch /data/accounts/account_0/appdata/recorder/test9.mp4"
,
"touch /data/accounts/account_0/appdata/recorder/test10.mp4"
,
"touch /data/accounts/account_0/appdata/recorder/test11.m4a"
,
"touch /data/accounts/account_0/appdata/recorder/test12.m4a"
,
"touch /data/accounts/account_0/appdata/recorder/test13.m4a"
,
"touch /data/accounts/account_0/appdata/recorder/test14.mp4"
,
"touch /data/accounts/account_0/appdata/recorder/test15.m4a"
,
"touch /data/accounts/account_0/appdata/recorder/test16.m4a"
,
"touch /data/accounts/account_0/appdata/recorder/test17.m4a"
,
"touch /data/accounts/account_0/appdata/recorder/test18.mp4"
,
"touch /data/accounts/account_0/appdata/recorder/test19.m4a"
,
"touch /data/accounts/account_0/appdata/recorder/testAPI.m4a"
,
"chmod -R 777 /data/accounts/account_0/appdata/recorder/*"
,
"setenforce 0"
],
...
...
multimedia/audio/audio_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioAPI.test.js
浏览文件 @
be811a21
...
...
@@ -18,7 +18,6 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
describe
(
'
RecorderLocalTestAudioAPI
'
,
function
()
{
let
audioRecorder
=
media
.
createAudioRecorder
();
let
isTimeOut
=
false
;
const
END_STATE
=
0
;
const
PRE_STATE
=
1
;
const
START_STATE
=
2
;
...
...
@@ -28,11 +27,11 @@ describe('RecorderLocalTestAudioAPI', function () {
const
RESET_STATE
=
6
;
const
RELEASE_STATE
=
7
;
const
ERROR_STATE
=
8
;
const
TIME_OUT
=
15000
;
// 15s
const
FORMAT_M4A
=
6
;
const
SOURCE_TYPE
=
1
;
const
ENCORDER_AACLC
=
3
;
const
CHANNEL_TWO
=
2
;
const
RECORDER_TIME
=
1000
;
let
audioConfig
=
{
audioSourceType
:
SOURCE_TYPE
,
audioEncoder
:
ENCORDER_AACLC
,
...
...
@@ -44,6 +43,10 @@ describe('RecorderLocalTestAudioAPI', function () {
location
:
{
latitude
:
1
,
longitude
:
1
},
}
function
sleep
(
time
)
{
for
(
let
t
=
Date
.
now
();
Date
.
now
()
-
t
<=
time
;);
};
function
initAudioRecorder
()
{
if
(
typeof
(
audioRecorder
)
!=
'
undefined
'
)
{
audioRecorder
.
release
();
...
...
@@ -86,6 +89,7 @@ describe('RecorderLocalTestAudioAPI', function () {
case
RELEASE_STATE
:
console
.
info
(
'
case to release
'
);
audioRecorder
.
release
();
audioRecorder
=
undefined
;
break
;
case
ERROR_STATE
:
console
.
info
(
'
case to wait error callback
'
);
...
...
@@ -103,7 +107,7 @@ describe('RecorderLocalTestAudioAPI', function () {
});
audioRecorder
.
on
(
'
start
'
,
()
=>
{
console
.
info
(
'
setCallback start() case callback is called
'
);
console
.
info
(
'
setCallback start() case callback is called
111
'
);
sleep
(
RECORDER_TIME
);
mySteps
.
shift
();
nextStep
(
mySteps
,
done
);
...
...
@@ -154,7 +158,6 @@ describe('RecorderLocalTestAudioAPI', function () {
})
beforeEach
(
function
()
{
isTimeOut
=
false
;
console
.
info
(
'
beforeEach case
'
);
})
...
...
@@ -586,6 +589,7 @@ describe('RecorderLocalTestAudioAPI', function () {
let
mySteps
=
new
Array
(
RELEASE_STATE
,
END_STATE
);
setCallback
(
mySteps
,
done
);
audioRecorder
.
release
();
audioRecorder
=
undefined
;
})
/* *
...
...
multimedia/audio/audio_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioFUNC.test.js
浏览文件 @
be811a21
...
...
@@ -18,7 +18,6 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
describe
(
'
RecorderLocalTestAudioFUNC
'
,
function
()
{
let
audioRecorder
=
media
.
createAudioRecorder
();
let
isTimeOut
=
false
;
const
BASIC_PATH
=
'
file:///data/accounts/account_0/appdata/recorder/
'
const
END_STATE
=
0
;
const
PRE_STATE
=
1
;
...
...
@@ -29,8 +28,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
const
RESET_STATE
=
6
;
const
RELEASE_STATE
=
7
;
const
ERROR_STATE
=
8
;
const
RECORDER_TIME
=
5000
;
const
TIME_OUT
=
20000
;
// 20s
const
RECORDER_TIME
=
1000
;
const
CHANNEL_ONE
=
1
;
const
CHANNEL_TWO
=
2
;
const
FORMAT_MP4
=
2
;
...
...
@@ -65,7 +63,6 @@ describe('RecorderLocalTestAudioFUNC', function () {
})
beforeEach
(
function
()
{
isTimeOut
=
false
;
console
.
info
(
'
beforeEach case
'
);
})
...
...
@@ -111,6 +108,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
case
RELEASE_STATE
:
console
.
info
(
'
case to release
'
);
audioRecorder
.
release
();
audioRecorder
=
undefined
;
break
;
case
ERROR_STATE
:
console
.
info
(
'
case to wait error callback
'
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录