Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
f26830d2
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看板
提交
f26830d2
编写于
2月 17, 2022
作者:
Z
zhangchang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add MediaLibrary XTS testcases
Signed-off-by:
N
zhangchang
<
zhangchang725@huawei.com
>
上级
00a27a58
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
212 addition
and
0 deletion
+212
-0
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderEnumTest.test.js
...udioDecoder/src/main/js/test/AudioDecoderEnumTest.test.js
+211
-0
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/List.test.js
...ia_js_standard/audioDecoder/src/main/js/test/List.test.js
+1
-0
未找到文件。
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderEnumTest.test.js
0 → 100644
浏览文件 @
f26830d2
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
media
from
'
@ohos.multimedia.media
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
describe
(
'
AudioDecoderEnum
'
,
function
()
{
beforeAll
(
function
()
{
console
.
info
(
'
beforeAll case
'
);
})
beforeEach
(
function
()
{
console
.
info
(
'
beforeEach case
'
);
})
afterEach
(
function
()
{
console
.
info
(
'
afterEach case
'
);
wait
(
2000
);
})
afterAll
(
function
()
{
console
.
info
(
'
afterAll case
'
);
})
let
failCallback
=
function
(
err
)
{
console
.
info
(
'
case callback err :
'
+
err
);
expect
(
err
).
assertUndefined
();
}
let
failCatch
=
function
(
err
)
{
console
.
info
(
'
case catch err :
'
+
err
);
expect
(
err
).
assertUndefined
();
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_DECODER_ENUM_AACProfile_0100
* @tc.name : 001.AACProfile
* @tc.desc : Test Enumerate AACProfile
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_AUDIO_DECODER_ENUM_AACProfile_0100
'
,
0
,
async
function
(
done
)
{
expect
(
media
.
AACProfile
.
AAC_PROFILE_LC
).
assertEqual
(
0
);
expect
(
media
.
AACProfile
.
AAC_PROFILE_ELD
).
assertEqual
(
1
);
expect
(
media
.
AACProfile
.
AAC_PROFILE_ERLC
).
assertEqual
(
2
);
expect
(
media
.
AACProfile
.
AAC_PROFILE_HE
).
assertEqual
(
3
);
expect
(
media
.
AACProfile
.
AAC_PROFILE_HE_V2
).
assertEqual
(
4
);
expect
(
media
.
AACProfile
.
AAC_PROFILE_LD
).
assertEqual
(
5
);
expect
(
media
.
AACProfile
.
AAC_PROFILE_MAIN
).
assertEqual
(
6
);
done
();
})
/* *
* @tc.number : SUB_MEDIA_AUDIO_DECODER_ENUM_AudioCaps_0100
* @tc.name : 002.AudioCaps
* @tc.desc : Test Interface AudioCaps
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_AUDIO_DECODER_ENUM_AudioCaps_0100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
case test Test Interface AudioCaps
"
);
await
media
.
getMediaCapability
().
then
((
mediaCaps
)
=>
{
console
.
info
(
'
getMediaCapability success
'
);
if
(
typeof
(
mediaCaps
)
!=
'
undefined
'
)
{
mediaCaps
.
getAudioDecoderCaps
().
then
((
audioCapsArray
)
=>
{
console
.
info
(
'
getAudioDecoderCaps success
'
);
if
(
typeof
(
audioCapsArray
)
!==
'
undefined
'
)
{
console
.
info
(
'
audioCapsArray is not null
'
);
// check AudioCaps
let
audioCaps
=
audioCapsArray
[
0
];
expect
(
audioCaps
.
codecInfo
!==
undefined
).
assertTrue
();
// check AudioCaps.AVCodecInfo
let
avCodecInfo
=
audioCaps
.
codecInfo
;
expect
(
avCodecInfo
.
name
!==
undefined
).
assertTrue
();
console
.
info
(
'
avCodecInfo.name:
'
+
avCodecInfo
.
name
);
expect
(
avCodecInfo
.
type
!==
undefined
).
assertTrue
();
console
.
info
(
'
avCodecInfo.type:
'
+
avCodecInfo
.
type
);
expect
(
avCodecInfo
.
mimeType
!==
undefined
).
assertTrue
();
console
.
info
(
'
avCodecInfo.mimeType:
'
+
avCodecInfo
.
mimeType
);
expect
(
avCodecInfo
.
isHardwareAccelerated
!==
undefined
).
assertTrue
();
console
.
info
(
'
avCodecInfo.isHardwareAccelerated:
'
+
avCodecInfo
.
isHardwareAccelerated
);
expect
(
avCodecInfo
.
isSoftwareOnly
!==
undefined
).
assertTrue
();
console
.
info
(
'
avCodecInfo.isSoftwareOnly:
'
+
avCodecInfo
.
isSoftwareOnly
);
expect
(
avCodecInfo
.
isVendor
!==
undefined
).
assertTrue
();
console
.
info
(
'
avCodecInfo.isVendor:
'
+
avCodecInfo
.
isVendor
);
// check AudioCaps.supportedBitrate
expect
(
audioCaps
.
supportedBitrate
!==
undefined
).
assertTrue
();
console
.
info
(
'
supportedBitrate.min:
'
+
audioCaps
.
supportedBitrate
.
min
);
console
.
info
(
'
supportedBitrate.max:
'
+
audioCaps
.
supportedBitrate
.
max
);
// check AudioCaps.supportedChannel
expect
(
audioCaps
.
supportedChannel
!==
undefined
).
assertTrue
();
console
.
info
(
'
supportedChannel.min:
'
+
audioCaps
.
supportedChannel
.
min
);
console
.
info
(
'
supportedChannel.max:
'
+
audioCaps
.
supportedChannel
.
max
);
// check AudioCaps.supportedFormats
expect
(
audioCaps
.
supportedFormats
!==
undefined
).
assertTrue
();
console
.
info
(
'
audioCaps.supportedFormats:
'
+
audioCaps
.
supportedFormats
);
// check AudioCaps.supportedSampleRates
expect
(
audioCaps
.
supportedSampleRates
!==
undefined
).
assertTrue
();
console
.
info
(
'
audioCaps.supportedSampleRates:
'
+
audioCaps
.
supportedSampleRates
);
// check AudioCaps.supportedProfiles
expect
(
audioCaps
.
supportedProfiles
!==
undefined
).
assertTrue
();
console
.
info
(
'
audioCaps.supportedProfiles:
'
+
audioCaps
.
supportedProfiles
);
// check AudioCaps.supportedLevels
expect
(
audioCaps
.
supportedLevels
!==
undefined
).
assertTrue
();
console
.
info
(
'
audioCaps.supportedLevels:
'
+
audioCaps
.
supportedLevels
);
// check AudioCaps.supportedComplexity
expect
(
audioCaps
.
supportedComplexity
!==
undefined
).
assertTrue
();
console
.
info
(
'
supportedComplexity.min:
'
+
audioCaps
.
supportedComplexity
.
min
);
console
.
info
(
'
supportedComplexity.max:
'
+
audioCaps
.
supportedComplexity
.
max
);
}
else
{
console
.
info
(
'
audioCapsArray is not defined
'
);
expect
().
assertFail
();
done
();
}
},
failCallback
).
catch
(
failCatch
);
}
else
{
console
.
info
(
'
mediaCaps is not defined
'
);
expect
().
assertFail
();
done
();
}
},
failCallback
).
catch
(
failCatch
);
done
();
})
/* *
* @tc.number : SUB_MEDIA_AUDIO_DECODER_ENUM_AudioRawFormat_0100
* @tc.name : 003.AudioRawFormat
* @tc.desc : Test Enumerate AudioRawFormat
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_AUDIO_DECODER_ENUM_AudioRawFormat_0100
'
,
0
,
async
function
(
done
)
{
expect
(
media
.
AudioRawFormat
.
AUDIO_PCM_S8
).
assertEqual
(
1
);
expect
(
media
.
AudioRawFormat
.
AUDIO_PCM_8
).
assertEqual
(
2
);
expect
(
media
.
AudioRawFormat
.
AUDIO_PCM_S16_BE
).
assertEqual
(
3
);
expect
(
media
.
AudioRawFormat
.
AUDIO_PCM_S16_LE
).
assertEqual
(
4
);
expect
(
media
.
AudioRawFormat
.
AUDIO_PCM_16_BE
).
assertEqual
(
5
);
expect
(
media
.
AudioRawFormat
.
AUDIO_PCM_16_LE
).
assertEqual
(
6
);
expect
(
media
.
AudioRawFormat
.
AUDIO_PCM_S24_BE
).
assertEqual
(
7
);
expect
(
media
.
AudioRawFormat
.
AUDIO_PCM_S24_LE
).
assertEqual
(
8
);
expect
(
media
.
AudioRawFormat
.
AUDIO_PCM_24_BE
).
assertEqual
(
9
);
expect
(
media
.
AudioRawFormat
.
AUDIO_PCM_24_LE
).
assertEqual
(
10
);
expect
(
media
.
AudioRawFormat
.
AUDIO_PCM_S32_BE
).
assertEqual
(
11
);
expect
(
media
.
AudioRawFormat
.
AUDIO_PCM_S32_LE
).
assertEqual
(
12
);
expect
(
media
.
AudioRawFormat
.
AUDIO_PCM_32_BE
).
assertEqual
(
13
);
expect
(
media
.
AudioRawFormat
.
AUDIO_PCM_32_LE
).
assertEqual
(
14
);
expect
(
media
.
AudioRawFormat
.
AUDIO_PCM_F32_BE
).
assertEqual
(
15
);
expect
(
media
.
AudioRawFormat
.
AUDIO_PCM_F32_LE
).
assertEqual
(
16
);
done
();
})
/* *
* @tc.number : SUB_MEDIA_AUDIO_DECODER_ENUM_AVCodecType_0100
* @tc.name : 004.AVCodecType
* @tc.desc : Test Enumerate AVCodecType
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_AUDIO_DECODER_ENUM_AVCodecType_0100
'
,
0
,
async
function
(
done
)
{
expect
(
media
.
AVCodecType
.
AVCODEC_TYPE_VIDEO_ENCODER
).
assertEqual
(
0
);
expect
(
media
.
AVCodecType
.
AVCODEC_TYPE_VIDEO_DECODER
).
assertEqual
(
1
);
expect
(
media
.
AVCodecType
.
AVCODEC_TYPE_AUDIO_ENCODER
).
assertEqual
(
2
);
expect
(
media
.
AVCodecType
.
AVCODEC_TYPE_AUDIO_DECODER
).
assertEqual
(
3
);
done
();
})
/* *
* @tc.number : SUB_MEDIA_AUDIO_DECODER_ENUM_CodecMimeType_0100
* @tc.name : 005.CodecMimeType
* @tc.desc : Test Enumerate CodecMimeType
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_AUDIO_DECODER_ENUM_CodecMimeType_0100
'
,
0
,
async
function
(
done
)
{
expect
(
media
.
CodecMimeType
.
AUDIO_AMR_NB
).
assertEqual
(
'
audio/3gpp
'
);
expect
(
media
.
CodecMimeType
.
AUDIO_AMR_WB
).
assertEqual
(
'
audio/amr-wb
'
);
expect
(
media
.
CodecMimeType
.
AUDIO_MPEG
).
assertEqual
(
'
audio/mpeg
'
);
expect
(
media
.
CodecMimeType
.
AUDIO_AAC
).
assertEqual
(
'
audio/mp4a-latm
'
);
expect
(
media
.
CodecMimeType
.
AUDIO_VORBIS
).
assertEqual
(
'
audio/vorbis
'
);
expect
(
media
.
CodecMimeType
.
AUDIO_OPUS
).
assertEqual
(
'
audio/opus
'
);
expect
(
media
.
CodecMimeType
.
AUDIO_FLAC
).
assertEqual
(
'
audio/flac
'
);
expect
(
media
.
CodecMimeType
.
AUDIO_RAW
).
assertEqual
(
'
audio/raw
'
);
done
();
})
})
\ No newline at end of file
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/List.test.js
浏览文件 @
f26830d2
...
...
@@ -21,4 +21,5 @@ require('./AudioDecoderFormatCallbackTest.test.js')
require
(
'
./AudioDecoderReliabilityPromiseTest.test.js
'
)
require
(
'
./AudioDecoderReliabilityCallbackTest.test.js
'
)
require
(
'
./AudioDecoderMultiInstancesTest.test.js
'
)
require
(
'
./AudioDecoderEnumTest.test.js
'
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录