Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
55712074
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看板
提交
55712074
编写于
7月 15, 2022
作者:
F
fulizhong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify testcases Signed-off-by: FULIZHONG<fulizhong1@huawei.com>
Signed-off-by:
N
fulizhong
<
fulizhong@huawei.com
>
上级
2667715f
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
54 addition
and
28 deletion
+54
-28
multimedia/media/media_js_standard/MediaTestBase.js
multimedia/media/media_js_standard/MediaTestBase.js
+25
-0
multimedia/media/media_js_standard/audioRecorder/Test.json
multimedia/media/media_js_standard/audioRecorder/Test.json
+2
-1
multimedia/media/media_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioFUNC.test.js
...order/src/main/js/test/RecorderLocalTestAudioFUNC.test.js
+23
-23
multimedia/media/media_js_standard/recorderFormat/Test.json
multimedia/media/media_js_standard/recorderFormat/Test.json
+1
-1
multimedia/media/media_js_standard/recorderFormat/src/main/js/test/AudioRecorderFormatCompatibilityTest.test.js
...main/js/test/AudioRecorderFormatCompatibilityTest.test.js
+3
-3
未找到文件。
multimedia/media/media_js_standard/MediaTestBase.js
浏览文件 @
55712074
...
...
@@ -169,6 +169,31 @@ export async function getFd(pathName) {
return
fdObject
;
}
export
async
function
getAudioFd
(
pathName
)
{
let
fdObject
=
{
fileAsset
:
null
,
fdNumber
:
null
}
let
displayName
=
pathName
;
const
mediaTest
=
mediaLibrary
.
getMediaLibrary
();
let
fileKeyObj
=
mediaLibrary
.
FileKey
;
let
mediaType
=
mediaLibrary
.
MediaType
.
AUDIO
;
let
publicPath
=
await
mediaTest
.
getPublicDirectory
(
mediaLibrary
.
DirectoryType
.
DIR_AUDIO
);
let
dataUri
=
await
mediaTest
.
createAsset
(
mediaType
,
displayName
,
publicPath
);
if
(
dataUri
!=
undefined
)
{
let
args
=
dataUri
.
id
.
toString
();
let
fetchOp
=
{
selections
:
fileKeyObj
.
ID
+
"
=?
"
,
selectionArgs
:
[
args
],
}
let
fetchFileResult
=
await
mediaTest
.
getFileAssets
(
fetchOp
);
fdObject
.
fileAsset
=
await
fetchFileResult
.
getAllObject
();
fdObject
.
fdNumber
=
await
fdObject
.
fileAsset
[
0
].
open
(
'
rw
'
);
console
.
info
(
'
case getFd number is:
'
+
fdObject
.
fdNumber
);
}
return
fdObject
;
}
export
async
function
closeFd
(
fileAsset
,
fdNumber
)
{
if
(
fileAsset
!=
null
)
{
await
fileAsset
[
0
].
close
(
fdNumber
).
then
(()
=>
{
...
...
multimedia/media/media_js_standard/audioRecorder/Test.json
浏览文件 @
55712074
...
...
@@ -10,7 +10,8 @@
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"rm -rf /storage/media/100/local/files/Videos/audio_*"
"rm -rf /storage/media/100/local/files/Videos/audio_*"
,
"rm -rf /storage/media/100/local/files/Audios/audio_*"
],
"teardown-command"
:[
]
...
...
multimedia/media/media_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioFUNC.test.js
浏览文件 @
55712074
...
...
@@ -30,7 +30,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
const
RELEASE_STATE
=
7
;
const
ERROR_STATE
=
8
;
const
CHECK_STATE
=
9
;
const
RECORDER_TIME
=
1
000
;
const
RECORDER_TIME
=
3
000
;
const
CHANNEL_ONE
=
1
;
const
CHANNEL_TWO
=
2
;
const
FORMAT_MP4
=
media
.
AudioOutputFormat
.
MPEG_4
;
...
...
@@ -193,7 +193,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_RECORDER_CODEC_AAC_0100
'
,
0
,
async
function
(
done
)
{
fdObject
=
await
mediaTestBase
.
getFd
(
'
audio_01.m4a
'
);
fdObject
=
await
mediaTestBase
.
get
Audio
Fd
(
'
audio_01.m4a
'
);
fdPath
=
"
fd://
"
+
fdObject
.
fdNumber
.
toString
();
audioConfig
.
uri
=
fdPath
;
let
trackArray
=
videoRecorderBase
.
getTrackArray
(
ONLYAUDIO_TYPE
,
audioConfig
);
...
...
@@ -213,7 +213,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_RECORDER_CODEC_AAC_0210
'
,
0
,
async
function
(
done
)
{
fdObject
=
await
mediaTestBase
.
getFd
(
'
audio_02.m4a
'
);
fdObject
=
await
mediaTestBase
.
get
Audio
Fd
(
'
audio_02.m4a
'
);
fdPath
=
"
fd://
"
+
fdObject
.
fdNumber
.
toString
();
audioConfig
.
uri
=
fdPath
;
audioConfig
.
numberOfChannels
=
CHANNEL_ONE
;
...
...
@@ -234,7 +234,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_RECORDER_CODEC_AAC_0220
'
,
0
,
async
function
(
done
)
{
fdObject
=
await
mediaTestBase
.
getFd
(
'
audio_03.m4a
'
);
fdObject
=
await
mediaTestBase
.
get
Audio
Fd
(
'
audio_03.m4a
'
);
fdPath
=
"
fd://
"
+
fdObject
.
fdNumber
.
toString
();
audioConfig
.
uri
=
fdPath
;
audioConfig
.
numberOfChannels
=
CHANNEL_TWO
;
...
...
@@ -255,7 +255,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_RECORDER_CODEC_AAC_0310
'
,
0
,
async
function
(
done
)
{
fdObject
=
await
mediaTestBase
.
getFd
(
'
audio_04.m4a
'
);
fdObject
=
await
mediaTestBase
.
get
Audio
Fd
(
'
audio_04.m4a
'
);
fdPath
=
"
fd://
"
+
fdObject
.
fdNumber
.
toString
();
audioConfig
.
uri
=
fdPath
;
audioConfig
.
audioSampleRate
=
8000
;
// samplerate 8000
...
...
@@ -277,7 +277,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_RECORDER_CODEC_AAC_0320
'
,
0
,
async
function
(
done
)
{
fdObject
=
await
mediaTestBase
.
getFd
(
'
audio_05.m4a
'
);
fdObject
=
await
mediaTestBase
.
get
Audio
Fd
(
'
audio_05.m4a
'
);
fdPath
=
"
fd://
"
+
fdObject
.
fdNumber
.
toString
();
audioConfig
.
uri
=
fdPath
;
audioConfig
.
audioSampleRate
=
32000
;
// samplerate 32000
...
...
@@ -300,7 +300,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_RECORDER_CODEC_AAC_0330
'
,
0
,
async
function
(
done
)
{
fdObject
=
await
mediaTestBase
.
getFd
(
'
audio_06.m4a
'
);
fdObject
=
await
mediaTestBase
.
get
Audio
Fd
(
'
audio_06.m4a
'
);
fdPath
=
"
fd://
"
+
fdObject
.
fdNumber
.
toString
();
audioConfig
.
uri
=
fdPath
;
audioConfig
.
audioSampleRate
=
44100
;
// samplerate 44100
...
...
@@ -323,7 +323,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_RECORDER_CODEC_AAC_0340
'
,
0
,
async
function
(
done
)
{
fdObject
=
await
mediaTestBase
.
getFd
(
'
audio_07.m4a
'
);
fdObject
=
await
mediaTestBase
.
get
Audio
Fd
(
'
audio_07.m4a
'
);
fdPath
=
"
fd://
"
+
fdObject
.
fdNumber
.
toString
();
audioConfig
.
uri
=
fdPath
;
audioConfig
.
audioSampleRate
=
64000
;
// samplerate 64000
...
...
@@ -346,7 +346,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_RECORDER_CODEC_AAC_0340
'
,
0
,
async
function
(
done
)
{
fdObject
=
await
mediaTestBase
.
getFd
(
'
audio_08.m4a
'
);
fdObject
=
await
mediaTestBase
.
get
Audio
Fd
(
'
audio_08.m4a
'
);
fdPath
=
"
fd://
"
+
fdObject
.
fdNumber
.
toString
();
audioConfig
.
uri
=
fdPath
;
audioConfig
.
audioSampleRate
=
96000
;
// samplerate 96000
...
...
@@ -417,7 +417,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_RECORDER_CODEC_AAC_0430
'
,
0
,
async
function
(
done
)
{
fdObject
=
await
mediaTestBase
.
getFd
(
'
audio_11.m4a
'
);
fdObject
=
await
mediaTestBase
.
get
Audio
Fd
(
'
audio_11.m4a
'
);
fdPath
=
"
fd://
"
+
fdObject
.
fdNumber
.
toString
();
audioConfig
.
uri
=
fdPath
;
audioConfig
.
audioSampleRate
=
44100
;
// samplerate 44100
...
...
@@ -441,7 +441,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_RECORDER_CODEC_AAC_0440
'
,
0
,
async
function
(
done
)
{
fdObject
=
await
mediaTestBase
.
getFd
(
'
audio_12.m4a
'
);
fdObject
=
await
mediaTestBase
.
get
Audio
Fd
(
'
audio_12.m4a
'
);
fdPath
=
"
fd://
"
+
fdObject
.
fdNumber
.
toString
();
audioConfig
.
uri
=
fdPath
;
audioConfig
.
audioSampleRate
=
44100
;
// samplerate 44100
...
...
@@ -465,7 +465,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_RECORDER_CODEC_AAC_0450
'
,
0
,
async
function
(
done
)
{
fdObject
=
await
mediaTestBase
.
getFd
(
'
audio_13.m4a
'
);
fdObject
=
await
mediaTestBase
.
get
Audio
Fd
(
'
audio_13.m4a
'
);
fdPath
=
"
fd://
"
+
fdObject
.
fdNumber
.
toString
();
audioConfig
.
uri
=
fdPath
;
audioConfig
.
audioSampleRate
=
44100
;
// samplerate 44100
...
...
@@ -513,7 +513,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_RECORDER_FORMAT_MP4_0200
'
,
0
,
async
function
(
done
)
{
fdObject
=
await
mediaTestBase
.
getFd
(
'
audio_15.m4a
'
);
fdObject
=
await
mediaTestBase
.
get
Audio
Fd
(
'
audio_15.m4a
'
);
fdPath
=
"
fd://
"
+
fdObject
.
fdNumber
.
toString
();
audioConfig
.
uri
=
fdPath
;
audioConfig
.
audioEncodeBitRate
=
22050
;
// samplerate 22050
...
...
@@ -537,7 +537,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_RECORDER_AUDIO_FUNCTION_06_0100
'
,
0
,
async
function
(
done
)
{
fdObject
=
await
mediaTestBase
.
getFd
(
'
audio_16.m4a
'
);
fdObject
=
await
mediaTestBase
.
get
Audio
Fd
(
'
audio_16.m4a
'
);
fdPath
=
"
fd://
"
+
fdObject
.
fdNumber
.
toString
();
audioConfig
.
uri
=
fdPath
;
audioConfig
.
format
=
FORMAT_M4A
;
...
...
@@ -558,7 +558,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_RECORDER_AUDIO_FUNCTION_06_0200
'
,
0
,
async
function
(
done
)
{
fdObject
=
await
mediaTestBase
.
getFd
(
'
audio_17.m4a
'
);
fdObject
=
await
mediaTestBase
.
get
Audio
Fd
(
'
audio_17.m4a
'
);
fdPath
=
"
fd://
"
+
fdObject
.
fdNumber
.
toString
();
audioConfig
.
uri
=
fdPath
;
audioConfig
.
format
=
FORMAT_M4A
;
...
...
@@ -579,7 +579,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_RECORDER_AUDIO_FUNCTION_06_0300
'
,
0
,
async
function
(
done
)
{
fdObject
=
await
mediaTestBase
.
getFd
(
'
audio_18.m4a
'
);
fdObject
=
await
mediaTestBase
.
get
Audio
Fd
(
'
audio_18.m4a
'
);
fdPath
=
"
fd://
"
+
fdObject
.
fdNumber
.
toString
();
audioConfig
.
uri
=
fdPath
;
audioConfig
.
format
=
FORMAT_M4A
;
...
...
@@ -600,7 +600,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_RECORDER_AUDIO_FUNCTION_06_0500
'
,
0
,
async
function
(
done
)
{
fdObject
=
await
mediaTestBase
.
getFd
(
'
audio_19.m4a
'
);
fdObject
=
await
mediaTestBase
.
get
Audio
Fd
(
'
audio_19.m4a
'
);
fdPath
=
"
fd://
"
+
fdObject
.
fdNumber
.
toString
();
audioConfig
.
uri
=
fdPath
;
audioConfig
.
format
=
FORMAT_M4A
;
...
...
@@ -621,7 +621,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_RECORDER_AUDIO_FUNCTION_06_0600
'
,
0
,
async
function
(
done
)
{
fdObject
=
await
mediaTestBase
.
getFd
(
'
audio_20.m4a
'
);
fdObject
=
await
mediaTestBase
.
get
Audio
Fd
(
'
audio_20.m4a
'
);
fdPath
=
"
fd://
"
+
fdObject
.
fdNumber
.
toString
();
audioConfig
.
uri
=
fdPath
;
audioConfig
.
format
=
FORMAT_M4A
;
...
...
@@ -642,7 +642,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_RECORDER_AUDIO_FUNCTION_06_0700
'
,
0
,
async
function
(
done
)
{
fdObject
=
await
mediaTestBase
.
getFd
(
'
audio_21.m4a
'
);
fdObject
=
await
mediaTestBase
.
get
Audio
Fd
(
'
audio_21.m4a
'
);
fdPath
=
"
fd://
"
+
fdObject
.
fdNumber
.
toString
();
audioConfig
.
uri
=
fdPath
;
audioConfig
.
format
=
FORMAT_M4A
;
...
...
@@ -663,7 +663,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_RECORDER_AUDIO_FUNCTION_06_0800
'
,
0
,
async
function
(
done
)
{
fdObject
=
await
mediaTestBase
.
getFd
(
'
audio_22.m4a
'
);
fdObject
=
await
mediaTestBase
.
get
Audio
Fd
(
'
audio_22.m4a
'
);
fdPath
=
"
fd://
"
+
fdObject
.
fdNumber
.
toString
();
audioConfig
.
uri
=
fdPath
;
audioConfig
.
format
=
FORMAT_M4A
;
...
...
@@ -684,7 +684,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_RECORDER_AUDIO_FUNCTION_06_0900
'
,
0
,
async
function
(
done
)
{
fdObject
=
await
mediaTestBase
.
getFd
(
'
audio_23.m4a
'
);
fdObject
=
await
mediaTestBase
.
get
Audio
Fd
(
'
audio_23.m4a
'
);
fdPath
=
"
fd://
"
+
fdObject
.
fdNumber
.
toString
();
audioConfig
.
uri
=
fdPath
;
audioConfig
.
format
=
FORMAT_M4A
;
...
...
@@ -706,7 +706,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_RECORDER_AUDIO_FUNCTION_06_1000
'
,
0
,
async
function
(
done
)
{
fdObject
=
await
mediaTestBase
.
getFd
(
'
audio_24.m4a
'
);
fdObject
=
await
mediaTestBase
.
get
Audio
Fd
(
'
audio_24.m4a
'
);
fdPath
=
"
fd://
"
+
fdObject
.
fdNumber
.
toString
();
audioConfig
.
uri
=
fdPath
;
audioConfig
.
format
=
FORMAT_M4A
;
...
...
@@ -822,7 +822,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_RECORDER_AUDIO_FUNCTION_06_1500
'
,
0
,
async
function
(
done
)
{
fdObject
=
await
mediaTestBase
.
getFd
(
'
audio_29.m4a
'
);
fdObject
=
await
mediaTestBase
.
get
Audio
Fd
(
'
audio_29.m4a
'
);
fdPath
=
"
fd://
"
+
fdObject
.
fdNumber
.
toString
();
let
newAudioConfig
=
{
audioEncodeBitRate
:
22050
,
...
...
multimedia/media/media_js_standard/recorderFormat/Test.json
浏览文件 @
55712074
...
...
@@ -10,7 +10,7 @@
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"rm -rf /storage/media/100/local/files/
Vide
os/COMPATIBILITY*"
"rm -rf /storage/media/100/local/files/
Audi
os/COMPATIBILITY*"
],
"teardown-command"
:[
]
...
...
multimedia/media/media_js_standard/recorderFormat/src/main/js/test/AudioRecorderFormatCompatibilityTest.test.js
浏览文件 @
55712074
...
...
@@ -41,7 +41,7 @@ describe('AudioRecorderFormatCompatibilityTest', function () {
audioSampleRate
:
22050
,
numberOfChannels
:
2
,
format
:
media
.
AudioOutputFormat
.
AAC_ADTS
,
uri
:
'
f
ile:///data/accounts/account_0/appdata/appdata/recorder/test.m4a
'
,
uri
:
'
f
d://
'
,
location
:
{
latitude
:
1
,
longitude
:
1
},
}
...
...
@@ -114,8 +114,8 @@ describe('AudioRecorderFormatCompatibilityTest', function () {
let
displayName
=
pathName
;
const
mediaTest
=
mediaLibrary
.
getMediaLibrary
();
let
fileKeyObj
=
mediaLibrary
.
FileKey
;
let
mediaType
=
mediaLibrary
.
MediaType
.
VIDE
O
;
let
publicPath
=
await
mediaTest
.
getPublicDirectory
(
mediaLibrary
.
DirectoryType
.
DIR_
VIDE
O
);
let
mediaType
=
mediaLibrary
.
MediaType
.
AUDI
O
;
let
publicPath
=
await
mediaTest
.
getPublicDirectory
(
mediaLibrary
.
DirectoryType
.
DIR_
AUDI
O
);
let
dataUri
=
await
mediaTest
.
createAsset
(
mediaType
,
displayName
,
publicPath
);
if
(
dataUri
!=
undefined
)
{
let
args
=
dataUri
.
id
.
toString
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录