未验证 提交 e3dcb010 编写于 作者: O openharmony_ci 提交者: Gitee

!6875 修改媒体子系统xts用例签名权限

Merge pull request !6875 from FULIZHONG/monthly_20221018
......@@ -16,14 +16,35 @@
import resourceManager from '@ohos.resourceManager';
import {expect} from 'deccjsunit/index'
import router from '@system.router'
import abilityAccessCtrl from '@ohos.abilityAccessCtrl'
import bundle from '@ohos.bundle'
import mediaLibrary from '@ohos.multimedia.mediaLibrary'
import fileio from '@ohos.fileio'
import featureAbility from '@ohos.ability.featureAbility'
import { UiDriver, BY, PointerMatrix } from '@ohos.uitest'
const context = featureAbility.getContext();
export async function getPermission(permissionNames) {
featureAbility.getContext().requestPermissionsFromUser(permissionNames, 0, async (data) => {
console.info("case request success" + JSON.stringify(data));
})
}
export async function driveFn(num) {
console.info(`case come in driveFn 111`)
let driver = await UiDriver.create()
console.info(`case come in driveFn 222`)
console.info(`driver is ${JSON.stringify(driver)}`)
await msleepAsync(2000)
console.info(`UiDriver start`)
for (let i = 0; i < num; i++) {
let button = await driver.findComponent(BY.text('允许'))
console.info(`button is ${JSON.stringify(button)}`)
await msleepAsync(2000)
await button.click()
}
await msleepAsync(2000)
}
// File operation
export async function getFileDescriptor(fileName) {
let fileDescriptor = undefined;
......@@ -205,22 +226,3 @@ export async function closeFd(fileAsset, fdNumber) {
console.info('[mediaLibrary] case fileAsset is null');
}
}
// apply permission for test hap
export async function applyPermission(applictionName, permissionNames) {
let appInfo = await bundle.getApplicationInfo(applictionName, 0, 100);
let atManager = abilityAccessCtrl.createAtManager();
if (atManager != null) {
let tokenID = appInfo.accessTokenId;
console.info('[permission] case accessTokenID is ' + tokenID);
for (let i = 0; i < permissionNames.length; i++) {
await atManager.grantUserGrantedPermission(tokenID, permissionNames[i], 1).then((result) => {
console.info('[permission] case grantUserGrantedPermission success :' + result);
}).catch((err) => {
console.info('[permission] case grantUserGrantedPermission failed :' + err);
});
}
} else {
console.info('[permission] case apply permission failed, createAtManager failed');
}
}
\ No newline at end of file
......@@ -25,7 +25,9 @@ ohos_js_hap_suite("audio_recorder_js_hap") {
part_name = "multimedia_player_framework"
}
ohos_js_assets("audio_recorder_js_assets") {
source_dir = "./src/main/js/default"
js2abc = true
hap_profile = "./src/main/config.json"
source_dir = "./src/main/js"
}
ohos_resources("audio_recorder_resources") {
sources = [ "./src/main/resources" ]
......
{
"description": "Configuration for audioRecorder Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "1000000",
"package": "ohos.acts.multimedia.audio.audiorecorder",
"shell-timeout": "60000"
},
"kits": [
{
"type": "ShellKit",
"run-command": [
"rm -rf /storage/media/100/local/files/Audios/audio_*",
"power-shell setmode 602"
],
"teardown-command":[
"power-shell setmode 600"
]
},
{
"test-file-name": [
"ActsAudioRecorderJsTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
{
"description": "Configuration for audioRecorder Tests",
"driver": {
"type": "OHJSUnitTest",
"test-timeout": "1000000",
"shell-timeout": "1000000",
"testcase-timeout": 60000,
"bundle-name": "ohos.acts.multimedia.audio.audiorecorder",
"package-name": "ohos.acts.multimedia.audio.audiorecorder"
},
"kits": [
{
"type": "ShellKit",
"run-command": [
"rm -rf /storage/media/100/local/files/Audios/audio_*",
"rm -rf /storage/media/100/local/files/Videos/audio_*",
"param set persist.ace.testmode.enabled 1",
"power-shell setmode 602"
],
"teardown-command":[
"power-shell setmode 600"
]
},
{
"test-file-name": [
"ActsAudioRecorderJsTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
\ No newline at end of file
{
"app": {
"apiVersion": {
"compatible": 6,
"releaseType": "Beta1",
"target": 7
},
"vendor": "acts",
"bundleName": "ohos.acts.multimedia.audio.audiorecorder",
"version": {
"code": 1000000,
"name": "1.0.0"
}
},
"deviceConfig": {
"default": {
"debug": true
}
},
"module": {
"abilities": [
{
"iconId": 16777218,
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"descriptionId": 16777217,
"visible": true,
"labelId": 16777216,
"icon": "$media:icon",
"name": "ohos.acts.multimedia.audio.audiorecorder.MainAbility",
"description": "$string:mainability_description",
"label": "$string:entry_MainAbility",
"type": "page",
"homeAbility": true,
"launchType": "standard"
}
],
"deviceType": [
"tablet",
"default",
"default",
"tablet",
"tv",
"wearable"
],
"reqPermissions": [
{
"name" : "ohos.permission.GRANT_SENSITIVE_PERMISSIONS",
"reason" : "use ohos.permission.GRANT_SENSITIVE_PERMISSIONS"
},
{
"name" : "ohos.permission.REVOKE_SENSITIVE_PERMISSIONS",
"reason" : "use ohos.permission.REVOKE_SENSITIVE_PERMISSIONS"
},
{
"name" : "ohos.permission.MICROPHONE",
"reason" : "use ohos.permission.MICROPHONE"
},
{
"name" : "ohos.permission.MEDIA_LOCATION",
"reason" : "use ohos.permission.MEDIA_LOCATION"
},
{
"name" : "ohos.permission.READ_MEDIA",
"reason" : "use ohos.permission.READ_MEDIA"
},
{
"name" : "ohos.permission.WRITE_MEDIA",
"reason" : "use ohos.permission.WRITE_MEDIA"
}
],
"mainAbility": "ohos.acts.multimedia.audio.audiorecorder.MainAbility",
"distro": {
"moduleType": "entry",
"installationFree": false,
"deliveryWithInstall": true,
"moduleName": "entry"
},
"package": "ohos.acts.multimedia.audio.audiorecorder",
"name": ".MyApplication",
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": true
}
}
]
}
{
"app": {
"apiVersion": {
"compatible": 6,
"releaseType": "Beta1",
"target": 7
},
"vendor": "acts",
"bundleName": "ohos.acts.multimedia.audio.audiorecorder",
"version": {
"code": 1000000,
"name": "1.0.0"
}
},
"deviceConfig": {
"default": {
"debug": true
}
},
"module": {
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"orientation": "unspecified",
"formsEnabled": false,
"name": ".MainAbility",
"srcLanguage": "js",
"srcPath": "MainAbility",
"icon": "$media:icon",
"description": "$string:MainAbility_desc",
"label": "$string:MainAbility_label",
"type": "page",
"visible": true,
"launchType": "standard"
},
{
"orientation": "unspecified",
"formsEnabled": false,
"name": ".TestAbility",
"srcLanguage": "js",
"srcPath": "TestAbility",
"icon": "$media:icon",
"description": "$string:TestAbility_desc",
"label": "$string:TestAbility_label",
"type": "page",
"visible": true,
"launchType": "standard"
}
],
"deviceType": [
"tablet",
"default",
"default",
"tablet",
"tv",
"wearable"
],
"reqPermissions": [
{
"name": "ohos.permission.GRANT_SENSITIVE_PERMISSIONS",
"reason": "use ohos.permission.GRANT_SENSITIVE_PERMISSIONS"
},
{
"name": "ohos.permission.MICROPHONE",
"reason": "use ohos.permission.MICROPHONE"
},
{
"name": "ohos.permission.MEDIA_LOCATION",
"reason": "use ohos.permission.MEDIA_LOCATION"
},
{
"name": "ohos.permission.READ_MEDIA",
"reason": "use ohos.permission.READ_MEDIA"
},
{
"name": "ohos.permission.WRITE_MEDIA",
"reason": "use ohos.permission.WRITE_MEDIA"
}
],
"mainAbility": ".MainAbility",
"distro": {
"moduleType": "entry",
"installationFree": false,
"deliveryWithInstall": true,
"moduleName": "entry"
},
"package": "ohos.acts.multimedia.audio.audiorecorder",
"name": ".entry",
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": true
}
},
{
"pages": [
"pages/index/index"
],
"name": ".TestAbility",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
],
"testRunner": {
"name": "OpenHarmonyTestRunner",
"srcPath": "TestRunner"
},
"srcPath": ""
}
}
\ No newline at end of file
/*
* Copyright (C) 2022 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.
*/
export default {
onCreate() {
console.info('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
}
};
/*
* Copyright (C) 2022 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.
*/
export default {
onCreate() {
console.info('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
}
};
{
"strings": {
"hello": "您好",
"world": "世界"
}
{
"strings": {
"hello": "您好",
"world": "世界"
}
}
\ No newline at end of file
/*
* Copyright (C) 2022 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.
*/
.container {
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
}
.title {
font-size: 40px;
color: #000000;
opacity: 0.9;
}
@media screen and (device-type: tablet) and (orientation: landscape) {
.title {
font-size: 100px;
}
}
@media screen and (device-type: wearable) {
.title {
font-size: 28px;
color: #FFFFFF;
}
}
@media screen and (device-type: tv) {
.container {
background-image: url("/common/images/Wallpaper.png");
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
.title {
font-size: 100px;
color: #FFFFFF;
}
}
@media screen and (device-type: phone) and (orientation: landscape) {
.title {
font-size: 60px;
}
}
/*
* Copyright (C) 2022 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.
*/
.container {
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
}
.title {
font-size: 40px;
color: #000000;
opacity: 0.9;
}
@media screen and (device-type: tablet) and (orientation: landscape) {
.title {
font-size: 100px;
}
}
@media screen and (device-type: wearable) {
.title {
font-size: 28px;
color: #FFFFFF;
}
}
@media screen and (device-type: tv) {
.container {
background-image: url("/common/images/Wallpaper.png");
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
.title {
font-size: 100px;
color: #FFFFFF;
}
}
@media screen and (device-type: phone) and (orientation: landscape) {
.title {
font-size: 60px;
}
}
<!--
Copyright (c) 2022 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.
-->
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
<!--
Copyright (c) 2022 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.
-->
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
/*
* Copyright (C) 2022 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.
*/
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
console.info('onShow finish')
},
onReady() {
},
}
\ No newline at end of file
/*
* Copyright (c) 2022 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 AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from '../test/List.test'
export default {
onCreate() {
console.info('TestApplication onCreate')
var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
},
onDestroy() {
console.info("TestApplication onDestroy");
}
};
{
"strings": {
"hello": "Hello",
"world": "World"
},
"Files": {
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
},
"Files": {
}
}
\ No newline at end of file
.container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
}
.title {
font-size: 60px;
text-align: center;
width: 100%;
height: 40%;
margin: 10px;
}
@media screen and (device-type: phone) and (orientation: landscape) {
.title {
font-size: 60px;
}
}
@media screen and (device-type: tablet) and (orientation: landscape) {
.title {
font-size: 100px;
}
}
\ No newline at end of file
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
/*
* Copyright (c) 2022 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.
*/
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
}
}
/*
* Copyright (c) 2022 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 AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
function translateParamsToString(parameters) {
const keySet = new Set([
'-s class', '-s notClass', '-s suite', '-s itName',
'-s level', '-s testType', '-s size', '-s timeout',
'-s package', '-s dryRun'
])
let targetParams = '';
for (const key in parameters) {
if (keySet.has(key)) {
targetParams += ' ' + key + ' ' + parameters[key]
}
}
return targetParams.trim()
}
export default {
onPrepare() {
console.info('OpenHarmonyTestRunner OnPrepare')
},
onRun() {
console.log('OpenHarmonyTestRunner onRun run')
var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility'
var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName
cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters)
var debug = abilityDelegatorArguments.parameters["-D"]
console.info('debug value : '+debug)
if (debug == 'true')
{
cmd += ' -D'
}
console.info('cmd : '+cmd)
abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.info('executeShellCommand : err : ' + JSON.stringify(err));
console.info('executeShellCommand : data : ' + data.stdResult);
console.info('executeShellCommand : data : ' + data.exitCode);
})
}
};
/*
* Copyright (C) 2022 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 * as mediaTestBase from '../../../../../../../MediaTestBase.js';
import {Core, ExpectExtend} from 'deccjsunit/index'
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
},
async onShow() {
console.info('onShow finish')
let applictionName = 'ohos.acts.multimedia.audio.audiorecorder';
let permissionName1 = 'ohos.permission.MICROPHONE';
let permissionName2 = 'ohos.permission.MEDIA_LOCATION';
let permissionName3 = 'ohos.permission.READ_MEDIA';
let permissionName4 = 'ohos.permission.WRITE_MEDIA';
let permissionNames = new Array(permissionName1, permissionName2, permissionName3,
permissionName4);
await mediaTestBase.applyPermission(applictionName, permissionNames);
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
this.timeout = 60000
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
},
onReady() {
},
}
\ No newline at end of file
......@@ -16,69 +16,72 @@
import media from '@ohos.multimedia.media'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
describe('AudioRecorderEnumTest', function () {
beforeAll(function() {
console.info('beforeAll case');
export default function AudioRecorderEnumTest() {
describe('AudioRecorderEnumTest', function () {
beforeAll(function() {
console.info('beforeAll case');
})
beforeEach(function() {
console.info('beforeEach case');
})
afterEach(function() {
console.info('afterEach case');
})
afterAll(function() {
console.info('afterAll case');
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_ENUM_AUDIO_OUTPUT_FORMAT_0100
* @tc.name : AudioOutputFormat
* @tc.desc : AudioOutputFormat Enumeration test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_ENUM_AUDIO_OUTPUT_FORMAT_0100', 0, async function (done) {
expect(media.AudioOutputFormat.DEFAULT).assertEqual(0);
expect(media.AudioOutputFormat.MPEG_4).assertEqual(2);
expect(media.AudioOutputFormat.AMR_NB).assertEqual(3);
expect(media.AudioOutputFormat.AMR_WB).assertEqual(4);
expect(media.AudioOutputFormat.AAC_ADTS).assertEqual(6);
done();
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_ENUM_AUDIO_ENCODER_0100
* @tc.name : AudioOutputFormat
* @tc.desc : AudioOutputFormat Enumeration test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_ENUM_AUDIO_ENCODER_0100', 0, async function (done) {
expect(media.AudioEncoder.DEFAULT).assertEqual(0);
expect(media.AudioEncoder.AMR_NB).assertEqual(1);
expect(media.AudioEncoder.AMR_WB).assertEqual(2);
expect(media.AudioEncoder.AAC_LC).assertEqual(3);
expect(media.AudioEncoder.HE_AAC).assertEqual(4);
done();
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_ENUM_CODECMIMETYPE_0100
* @tc.name : CodecMimeType
* @tc.desc : Test Enumerate CodecMimeType
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_ENUM_CODECMIMETYPE_0100', 0, async function (done) {
expect(media.CodecMimeType.AUDIO_AAC).assertEqual('audio/mp4a-latm');
expect(media.CodecMimeType.AUDIO_VORBIS).assertEqual('audio/vorbis');
expect(media.CodecMimeType.AUDIO_FLAC).assertEqual('audio/flac');
done();
})
})
}
beforeEach(function() {
console.info('beforeEach case');
})
afterEach(function() {
console.info('afterEach case');
})
afterAll(function() {
console.info('afterAll case');
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_ENUM_AUDIO_OUTPUT_FORMAT_0100
* @tc.name : AudioOutputFormat
* @tc.desc : AudioOutputFormat Enumeration test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_ENUM_AUDIO_OUTPUT_FORMAT_0100', 0, async function (done) {
expect(media.AudioOutputFormat.DEFAULT).assertEqual(0);
expect(media.AudioOutputFormat.MPEG_4).assertEqual(2);
expect(media.AudioOutputFormat.AMR_NB).assertEqual(3);
expect(media.AudioOutputFormat.AMR_WB).assertEqual(4);
expect(media.AudioOutputFormat.AAC_ADTS).assertEqual(6);
done();
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_ENUM_AUDIO_ENCODER_0100
* @tc.name : AudioOutputFormat
* @tc.desc : AudioOutputFormat Enumeration test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_ENUM_AUDIO_ENCODER_0100', 0, async function (done) {
expect(media.AudioEncoder.DEFAULT).assertEqual(0);
expect(media.AudioEncoder.AMR_NB).assertEqual(1);
expect(media.AudioEncoder.AMR_WB).assertEqual(2);
expect(media.AudioEncoder.AAC_LC).assertEqual(3);
expect(media.AudioEncoder.HE_AAC).assertEqual(4);
done();
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_ENUM_CODECMIMETYPE_0100
* @tc.name : CodecMimeType
* @tc.desc : Test Enumerate CodecMimeType
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_DECODER_ENUM_CODECMIMETYPE_0100', 0, async function (done) {
expect(media.CodecMimeType.AUDIO_AAC).assertEqual('audio/mp4a-latm');
expect(media.CodecMimeType.AUDIO_VORBIS).assertEqual('audio/vorbis');
expect(media.CodecMimeType.AUDIO_FLAC).assertEqual('audio/flac');
done();
})
})
\ No newline at end of file
/*
* Copyright (C) 2022 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.
*/
require('./RecorderLocalTestAudioFUNC.test.js')
require('./RecorderLocalTestAudioAPI.test.js')
require('./AudioRecorderEnumTest.test.js')
\ No newline at end of file
/*
* Copyright (C) 2022 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 RecorderLocalTestAudioFUNC from './RecorderLocalTestAudioFUNC.test.js'
import RecorderLocalTestAudioAPI from './RecorderLocalTestAudioAPI.test.js'
import AudioRecorderEnumTest from './AudioRecorderEnumTest.test.js'
export default function testsuite() {
RecorderLocalTestAudioFUNC()
RecorderLocalTestAudioAPI()
AudioRecorderEnumTest()
}
......@@ -16,1048 +16,1049 @@
import media from '@ohos.multimedia.media'
import * as mediaTestBase from '../../../../../MediaTestBase.js';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
describe('RecorderLocalTestAudioAPI', function () {
let audioRecorder = null;
const END_STATE = 0;
const PRE_STATE = 1;
const START_STATE = 2;
const PAUSE_STATE = 3;
const RESUME_STATE = 4;
const STOP_STATE = 5;
const RESET_STATE = 6;
const RELEASE_STATE = 7;
const ERROR_STATE = 8;
const CHANNEL_TWO = 2;
const RECORDER_TIME = 1000;
let fdPath;
let fdObject;
let audioConfig = {
audioEncodeBitRate : 48000,
audioSampleRate : 48000,
numberOfChannels : CHANNEL_TWO,
uri : 'fd://',
location : { latitude : 30, longitude : 30 },
audioEncoderMime : media.CodecMimeType.AUDIO_AAC,
fileFormat : media.ContainerFormatType.CFT_MPEG_4A,
}
function initAudioRecorder() {
if (audioRecorder != null) {
audioRecorder.release();
audioRecorder = null;
}
audioRecorder = media.createAudioRecorder();
}
function nextStep(mySteps,done) {
if (mySteps[0] == END_STATE) {
done();
console.info('case to done');
return;
export default function RecorderLocalTestAudioAPI() {
describe('RecorderLocalTestAudioAPI', function () {
let audioRecorder = null;
const END_STATE = 0;
const PRE_STATE = 1;
const START_STATE = 2;
const PAUSE_STATE = 3;
const RESUME_STATE = 4;
const STOP_STATE = 5;
const RESET_STATE = 6;
const RELEASE_STATE = 7;
const ERROR_STATE = 8;
const CHANNEL_TWO = 2;
const RECORDER_TIME = 1000;
let fdPath;
let fdObject;
let audioConfig = {
audioEncodeBitRate : 48000,
audioSampleRate : 48000,
numberOfChannels : CHANNEL_TWO,
uri : 'fd://',
location : { latitude : 30, longitude : 30 },
audioEncoderMime : media.CodecMimeType.AUDIO_AAC,
fileFormat : media.ContainerFormatType.CFT_MPEG_4A,
}
switch (mySteps[0]) {
case PRE_STATE:
console.info('case to prepare');
audioRecorder.prepare(audioConfig);
break;
case START_STATE:
console.info('case to start');
audioRecorder.start();
break;
case PAUSE_STATE:
console.info('case to pause');
audioRecorder.pause();
break;
case RESUME_STATE:
console.info('case to resume');
audioRecorder.resume();
break;
case STOP_STATE:
console.info('case to stop');
audioRecorder.stop();
break;
case RESET_STATE:
console.info('case to reset');
audioRecorder.reset();
break;
case RELEASE_STATE:
console.info('case to release');
function initAudioRecorder() {
if (audioRecorder != null) {
audioRecorder.release();
audioRecorder = null;
break;
case ERROR_STATE:
console.info('case to wait error callback');
break;
default:
break;
}
audioRecorder = media.createAudioRecorder();
}
}
function setCallback(mySteps, done) {
audioRecorder.on('prepare', () => {
console.info('setCallback prepare() case callback is called');
mySteps.shift();
nextStep(mySteps,done);
});
audioRecorder.on('start', () => {
console.info('setCallback start() case callback is called');
mediaTestBase.msleep(RECORDER_TIME);
mySteps.shift();
nextStep(mySteps,done);
});
audioRecorder.on('pause', () => {
console.info('setCallback pause() case callback is called');
mySteps.shift();
nextStep(mySteps,done);
});
audioRecorder.on('resume', () => {
console.info('setCallback resume() case callback is called');
mediaTestBase.msleep(RECORDER_TIME);
mySteps.shift();
nextStep(mySteps,done);
});
audioRecorder.on('stop', () => {
console.info('setCallback stop() case callback is called');
mySteps.shift();
nextStep(mySteps,done);
});
audioRecorder.on('reset', () => {
console.info('setCallback reset() case callback is called');
mySteps.shift();
nextStep(mySteps,done);
});
audioRecorder.on('release', () => {
console.info('setCallback release() case callback is called');
mySteps.shift();
nextStep(mySteps,done);
});
audioRecorder.on('error', (err) => {
console.info(`case error called,errCode is ${err.code}`);
mySteps.shift();
expect(mySteps[0]).assertEqual(ERROR_STATE);
mySteps.shift();
nextStep(mySteps,done);
});
}
beforeAll(async function () {
fdObject = await mediaTestBase.getFd('audio_api.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
console.info('beforeAll case');
})
beforeEach(function () {
console.info('beforeEach case');
})
afterEach(function () {
console.info('afterEach case');
})
afterAll(async function () {
await mediaTestBase.closeFd(fdObject.fileAsset, fdObject.fdNumber);
console.info('afterAll case');
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_0200
* @tc.name : 02.start->prepare
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_0200', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(START_STATE, ERROR_STATE, PRE_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.start();
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_0300
* @tc.name : 03.pause->prepare
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_0300', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE,
PRE_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_0400
* @tc.name : 04.resume->prepare
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_0400', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, RESUME_STATE,
PRE_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_0500
* @tc.name : 05.stop->prepare
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_0500', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RESET_STATE, PRE_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_0600
* @tc.name : 06.reset->prepare
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_0600', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, PRE_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_0800
* @tc.name : 08.all steps->prepare
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_0800', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PRE_STATE, ERROR_STATE, STOP_STATE,
PRE_STATE, RESET_STATE, PRE_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_0900
* @tc.name : 09.prepare called three times
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_0900', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, PRE_STATE, ERROR_STATE, PRE_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_1000
* @tc.name : 10.channel:-1
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_1000', 0, async function (done) {
audioConfig.numberOfChannels = -1;
audioConfig.audioSampleRate = 22050;
audioConfig.audioEncodeBitRate = 22050;
initAudioRecorder();
let mySteps = new Array(PRE_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_1100
* @tc.name : 11.channel:-1
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_1100', 0, async function (done) {
audioConfig.numberOfChannels = CHANNEL_TWO;
audioConfig.audioSampleRate = -1;
audioConfig.audioEncodeBitRate = 22050;
initAudioRecorder();
let mySteps = new Array(PRE_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_1200
* @tc.name : 12.channel:-1
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_1200', 0, async function (done) {
audioConfig.numberOfChannels = CHANNEL_TWO;
audioConfig.audioSampleRate = 22050;
audioConfig.audioEncodeBitRate = -1;
initAudioRecorder();
let mySteps = new Array(PRE_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0100
* @tc.name : 01.creatAudioRecorder->start
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0100', 0, async function (done) {
audioConfig.numberOfChannels = CHANNEL_TWO;
audioConfig.audioSampleRate = 22050;
audioConfig.audioEncodeBitRate = 22050;
initAudioRecorder();
let mySteps = new Array(START_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.start();
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0200
* @tc.name : 02.prepare->start
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0200', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0300
* @tc.name : 03.pause->start
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0300', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, START_STATE,
ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0400
* @tc.name : 04.resume->start
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0400', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, RESUME_STATE, START_STATE, ERROR_STATE,
RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0500
* @tc.name : 05.stop->start
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0500', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, START_STATE, ERROR_STATE,
RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0600
* @tc.name : 06.reset->start
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0600', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, START_STATE, ERROR_STATE,
RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0800
* @tc.name : 08.all steps->start
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0800', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, START_STATE, ERROR_STATE,
PRE_STATE, START_STATE, RESET_STATE, START_STATE, ERROR_STATE, PRE_STATE, START_STATE,
RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0900
* @tc.name : 09.start called three times
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0900', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, START_STATE, ERROR_STATE,
START_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0100
* @tc.name : 01.creatAudioRecorder->pause
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0100', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PAUSE_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.pause();
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0200
* @tc.name : 02.prepare->pause
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0200', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, PAUSE_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0300
* @tc.name : 03.start->pause
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0300', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0400
* @tc.name : 04.resume->pause
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0400', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, RESUME_STATE, PAUSE_STATE,
RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0500
* @tc.name : 05.stop->pause
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0500', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, PAUSE_STATE, ERROR_STATE,
RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0600
* @tc.name : 06.reset->pause
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0600', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, PAUSE_STATE, ERROR_STATE,
RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0800
* @tc.name : 08.all step->pause
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0800', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, RESUME_STATE, PAUSE_STATE,
STOP_STATE, PAUSE_STATE, ERROR_STATE, RESET_STATE, PAUSE_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0900
* @tc.name : 09.pause three times
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0900', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, PAUSE_STATE, ERROR_STATE,
PAUSE_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0100
* @tc.name : 01.creatAudioRecorder->resume
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0100', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(RESUME_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.resume();
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0200
* @tc.name : 02.prepare->resume
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0200', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, RESUME_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0300
* @tc.name : 03.start->resume
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0300', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, RESUME_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0400
* @tc.name : 04.pause->resume
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0400', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, RESUME_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0500
* @tc.name : 05.stop->resume
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0500', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RESUME_STATE, ERROR_STATE,
RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0600
* @tc.name : 06.reset->resume
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0600', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, RESUME_STATE, ERROR_STATE,
RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0800
* @tc.name : 08.all->resume
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0800', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, RESUME_STATE, ERROR_STATE,
PAUSE_STATE, RESUME_STATE, STOP_STATE, RESUME_STATE, ERROR_STATE,
RESET_STATE, RESUME_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0900
* @tc.name : 09.resume threee times
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0900', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE,
RESUME_STATE, RESUME_STATE, ERROR_STATE, RESUME_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0100
* @tc.name : 01.creatAudioRecorder->stop
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0100', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(STOP_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.stop();
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0200
* @tc.name : 02.prepare->stop
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0200', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, STOP_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0300
* @tc.name : 03.start->stop
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0300', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0400
* @tc.name : 04.pause->stop
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0400', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, STOP_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0500
* @tc.name : 05.resume->stop
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0500', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, RESUME_STATE, STOP_STATE,
RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0600
* @tc.name : 06.reset->stop
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0600', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, STOP_STATE, ERROR_STATE,
RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0800
* @tc.name : 08.all steps->stop
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0800', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, STOP_STATE, ERROR_STATE, RESET_STATE, PRE_STATE, START_STATE, STOP_STATE,
RESET_STATE, PRE_STATE, RESET_STATE, STOP_STATE, ERROR_STATE, PRE_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0900
* @tc.name : 09.stop called three times
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0900', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, STOP_STATE, ERROR_STATE,
STOP_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0100
* @tc.name : 01.creatAudioRecorder->reset
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0100', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(RESET_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.reset();
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0200
* @tc.name : 02.prepare->reset
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0200', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, RESET_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0300
* @tc.name : 03.start->reset
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0300', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0400
* @tc.name : 04.pause->reset
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0400', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, RESET_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0500
* @tc.name : 05.resume->reset
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0500', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, RESUME_STATE, RESET_STATE,
RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0600
* @tc.name : 06.stop->reset
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0600', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RESET_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0800
* @tc.name : 08.all steps->reset
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0800', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, RESET_STATE, PRE_STATE, START_STATE, RESET_STATE, PRE_STATE, START_STATE,
STOP_STATE, RESET_STATE, PRE_STATE, START_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0900
* @tc.name : 09.reset callend three times
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0900', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE,
RESET_STATE, RESET_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RELEASE_API_0100
* @tc.name : 01.creatAudioRecorder->release
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RELEASE_API_0100', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.release();
audioRecorder = null;
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RELEASE_API_0200
* @tc.name : 02.prepare->release
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RELEASE_API_0200', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RELEASE_API_0300
* @tc.name : 03.start->release
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RELEASE_API_0300', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RELEASE_API_0400
* @tc.name : 04.pause->release
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RELEASE_API_0400', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RELEASE_API_0500
* @tc.name : 05.resume->release
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RELEASE_API_0500', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, RESUME_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RELEASE_API_0600
* @tc.name : 06.stop->release
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RELEASE_API_0600', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RELEASE_API_0700
* @tc.name : 07.reset->release
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RELEASE_API_0700', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
function nextStep(mySteps,done) {
if (mySteps[0] == END_STATE) {
done();
console.info('case to done');
return;
}
switch (mySteps[0]) {
case PRE_STATE:
console.info('case to prepare');
audioRecorder.prepare(audioConfig);
break;
case START_STATE:
console.info('case to start');
audioRecorder.start();
break;
case PAUSE_STATE:
console.info('case to pause');
audioRecorder.pause();
break;
case RESUME_STATE:
console.info('case to resume');
audioRecorder.resume();
break;
case STOP_STATE:
console.info('case to stop');
audioRecorder.stop();
break;
case RESET_STATE:
console.info('case to reset');
audioRecorder.reset();
break;
case RELEASE_STATE:
console.info('case to release');
audioRecorder.release();
audioRecorder = null;
break;
case ERROR_STATE:
console.info('case to wait error callback');
break;
default:
break;
}
}
function setCallback(mySteps, done) {
audioRecorder.on('prepare', () => {
console.info('setCallback prepare() case callback is called');
mySteps.shift();
nextStep(mySteps,done);
});
audioRecorder.on('start', () => {
console.info('setCallback start() case callback is called');
mediaTestBase.msleep(RECORDER_TIME);
mySteps.shift();
nextStep(mySteps,done);
});
audioRecorder.on('pause', () => {
console.info('setCallback pause() case callback is called');
mySteps.shift();
nextStep(mySteps,done);
});
audioRecorder.on('resume', () => {
console.info('setCallback resume() case callback is called');
mediaTestBase.msleep(RECORDER_TIME);
mySteps.shift();
nextStep(mySteps,done);
});
audioRecorder.on('stop', () => {
console.info('setCallback stop() case callback is called');
mySteps.shift();
nextStep(mySteps,done);
});
audioRecorder.on('reset', () => {
console.info('setCallback reset() case callback is called');
mySteps.shift();
nextStep(mySteps,done);
});
audioRecorder.on('release', () => {
console.info('setCallback release() case callback is called');
mySteps.shift();
nextStep(mySteps,done);
});
audioRecorder.on('error', (err) => {
console.info(`case error called,errCode is ${err.code}`);
mySteps.shift();
expect(mySteps[0]).assertEqual(ERROR_STATE);
mySteps.shift();
nextStep(mySteps,done);
});
}
beforeAll(async function () {
fdObject = await mediaTestBase.getFd('audio_api.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
console.info('beforeAll case');
})
beforeEach(function () {
console.info('beforeEach case');
})
afterEach(function () {
console.info('afterEach case');
})
afterAll(async function () {
await mediaTestBase.closeFd(fdObject.fileAsset, fdObject.fdNumber);
console.info('afterAll case');
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_0200
* @tc.name : 02.start->prepare
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_0200', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(START_STATE, ERROR_STATE, PRE_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.start();
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_0300
* @tc.name : 03.pause->prepare
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_0300', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE,
PRE_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_0400
* @tc.name : 04.resume->prepare
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_0400', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, RESUME_STATE,
PRE_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_0500
* @tc.name : 05.stop->prepare
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_0500', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RESET_STATE, PRE_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_0600
* @tc.name : 06.reset->prepare
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_0600', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, PRE_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_0800
* @tc.name : 08.all steps->prepare
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_0800', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PRE_STATE, ERROR_STATE, STOP_STATE,
PRE_STATE, RESET_STATE, PRE_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_0900
* @tc.name : 09.prepare called three times
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_0900', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, PRE_STATE, ERROR_STATE, PRE_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_1000
* @tc.name : 10.channel:-1
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_1000', 0, async function (done) {
audioConfig.numberOfChannels = -1;
audioConfig.audioSampleRate = 22050;
audioConfig.audioEncodeBitRate = 22050;
initAudioRecorder();
let mySteps = new Array(PRE_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_1100
* @tc.name : 11.channel:-1
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_1100', 0, async function (done) {
audioConfig.numberOfChannels = CHANNEL_TWO;
audioConfig.audioSampleRate = -1;
audioConfig.audioEncodeBitRate = 22050;
initAudioRecorder();
let mySteps = new Array(PRE_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_1200
* @tc.name : 12.channel:-1
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PREPARE_API_1200', 0, async function (done) {
audioConfig.numberOfChannels = CHANNEL_TWO;
audioConfig.audioSampleRate = 22050;
audioConfig.audioEncodeBitRate = -1;
initAudioRecorder();
let mySteps = new Array(PRE_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0100
* @tc.name : 01.creatAudioRecorder->start
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0100', 0, async function (done) {
audioConfig.numberOfChannels = CHANNEL_TWO;
audioConfig.audioSampleRate = 22050;
audioConfig.audioEncodeBitRate = 22050;
initAudioRecorder();
let mySteps = new Array(START_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.start();
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0200
* @tc.name : 02.prepare->start
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0200', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0300
* @tc.name : 03.pause->start
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0300', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, START_STATE,
ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0400
* @tc.name : 04.resume->start
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0400', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, RESUME_STATE, START_STATE, ERROR_STATE,
RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0500
* @tc.name : 05.stop->start
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0500', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, START_STATE, ERROR_STATE,
RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0600
* @tc.name : 06.reset->start
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0600', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, START_STATE, ERROR_STATE,
RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0800
* @tc.name : 08.all steps->start
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0800', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, START_STATE, ERROR_STATE,
PRE_STATE, START_STATE, RESET_STATE, START_STATE, ERROR_STATE, PRE_STATE, START_STATE,
RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0900
* @tc.name : 09.start called three times
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_START_API_0900', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, START_STATE, ERROR_STATE,
START_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0100
* @tc.name : 01.creatAudioRecorder->pause
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0100', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PAUSE_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.pause();
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0200
* @tc.name : 02.prepare->pause
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0200', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, PAUSE_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0300
* @tc.name : 03.start->pause
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0300', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0400
* @tc.name : 04.resume->pause
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0400', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, RESUME_STATE, PAUSE_STATE,
RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0500
* @tc.name : 05.stop->pause
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0500', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, PAUSE_STATE, ERROR_STATE,
RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0600
* @tc.name : 06.reset->pause
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0600', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, PAUSE_STATE, ERROR_STATE,
RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0800
* @tc.name : 08.all step->pause
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0800', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, RESUME_STATE, PAUSE_STATE,
STOP_STATE, PAUSE_STATE, ERROR_STATE, RESET_STATE, PAUSE_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0900
* @tc.name : 09.pause three times
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_PAUSE_API_0900', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, PAUSE_STATE, ERROR_STATE,
PAUSE_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0100
* @tc.name : 01.creatAudioRecorder->resume
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0100', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(RESUME_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.resume();
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0200
* @tc.name : 02.prepare->resume
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0200', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, RESUME_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0300
* @tc.name : 03.start->resume
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0300', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, RESUME_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0400
* @tc.name : 04.pause->resume
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0400', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, RESUME_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0500
* @tc.name : 05.stop->resume
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0500', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RESUME_STATE, ERROR_STATE,
RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0600
* @tc.name : 06.reset->resume
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0600', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, RESUME_STATE, ERROR_STATE,
RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0800
* @tc.name : 08.all->resume
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0800', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, RESUME_STATE, ERROR_STATE,
PAUSE_STATE, RESUME_STATE, STOP_STATE, RESUME_STATE, ERROR_STATE,
RESET_STATE, RESUME_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0900
* @tc.name : 09.resume threee times
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESUME_API_0900', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE,
RESUME_STATE, RESUME_STATE, ERROR_STATE, RESUME_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0100
* @tc.name : 01.creatAudioRecorder->stop
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0100', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(STOP_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.stop();
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0200
* @tc.name : 02.prepare->stop
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0200', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, STOP_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0300
* @tc.name : 03.start->stop
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0300', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0400
* @tc.name : 04.pause->stop
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0400', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, STOP_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0500
* @tc.name : 05.resume->stop
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0500', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, RESUME_STATE, STOP_STATE,
RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0600
* @tc.name : 06.reset->stop
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0600', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, STOP_STATE, ERROR_STATE,
RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0800
* @tc.name : 08.all steps->stop
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0800', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, STOP_STATE, ERROR_STATE, RESET_STATE, PRE_STATE, START_STATE, STOP_STATE,
RESET_STATE, PRE_STATE, RESET_STATE, STOP_STATE, ERROR_STATE, PRE_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0900
* @tc.name : 09.stop called three times
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_STOP_API_0900', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, STOP_STATE, ERROR_STATE,
STOP_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0100
* @tc.name : 01.creatAudioRecorder->reset
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0100', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(RESET_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.reset();
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0200
* @tc.name : 02.prepare->reset
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0200', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, RESET_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0300
* @tc.name : 03.start->reset
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0300', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0400
* @tc.name : 04.pause->reset
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0400', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, RESET_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0500
* @tc.name : 05.resume->reset
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0500', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, RESUME_STATE, RESET_STATE,
RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0600
* @tc.name : 06.stop->reset
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0600', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RESET_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0800
* @tc.name : 08.all steps->reset
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0800', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, RESET_STATE, PRE_STATE, START_STATE, RESET_STATE, PRE_STATE, START_STATE,
STOP_STATE, RESET_STATE, PRE_STATE, START_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0900
* @tc.name : 09.reset callend three times
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RESET_API_0900', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE,
RESET_STATE, RESET_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RELEASE_API_0100
* @tc.name : 01.creatAudioRecorder->release
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RELEASE_API_0100', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.release();
audioRecorder = null;
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RELEASE_API_0200
* @tc.name : 02.prepare->release
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RELEASE_API_0200', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RELEASE_API_0300
* @tc.name : 03.start->release
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RELEASE_API_0300', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RELEASE_API_0400
* @tc.name : 04.pause->release
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RELEASE_API_0400', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RELEASE_API_0500
* @tc.name : 05.resume->release
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RELEASE_API_0500', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, RESUME_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RELEASE_API_0600
* @tc.name : 06.stop->release
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RELEASE_API_0600', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RELEASE_API_0700
* @tc.name : 07.reset->release
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_RELEASE_API_0700', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
})
})
\ No newline at end of file
}
......@@ -18,825 +18,837 @@ import * as mediaTestBase from '../../../../../MediaTestBase.js';
import * as videoRecorderBase from '../../../../../VideoRecorderTestBase.js';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
describe('RecorderLocalTestAudioFUNC', function () {
let audioRecorder = null;
const END_STATE = 0;
const PRE_STATE = 1;
const START_STATE = 2;
const PAUSE_STATE = 3;
const RESUME_STATE = 4;
const STOP_STATE = 5;
const RESET_STATE = 6;
const RELEASE_STATE = 7;
const ERROR_STATE = 8;
const CHECK_STATE = 9;
const RECORDER_TIME = 3000;
const CHANNEL_ONE = 1;
const CHANNEL_TWO = 2;
const FORMAT_MP4 = media.AudioOutputFormat.MPEG_4;
const FORMAT_M4A = media.AudioOutputFormat.AAC_ADTS;
const ENCORDER_AACLC = media.AudioEncoder.AAC_LC;
const ONLYAUDIO_TYPE = 'only_audio';
let trackArray;
let recorderTime;
let fdPath;
let fdObject;
let audioConfig = {
audioEncoder : ENCORDER_AACLC,
audioEncodeBitRate : 48000,
audioSampleRate : 48000,
numberOfChannels : CHANNEL_TWO,
format : FORMAT_M4A,
uri : 'fd://',
location : { latitude : 30, longitude : 30 },
}
function initAudioRecorder() {
if (audioRecorder != null) {
audioRecorder.release();
audioRecorder = null;
}
audioRecorder = media.createAudioRecorder();
}
beforeAll(function () {
console.info('beforeAll case');
})
beforeEach(function () {
console.info('beforeEach case');
})
afterEach(async function () {
await mediaTestBase.closeFd(fdObject.fileAsset, fdObject.fdNumber);
console.info('afterEach case');
})
afterAll(function () {
console.info('afterAll case');
})
async function nextStep(mySteps,done) {
if (mySteps[0] == END_STATE) {
done();
console.info('case to done');
return;
export default function RecorderLocalTestAudioFUNC() {
describe('RecorderLocalTestAudioFUNC', function () {
let audioRecorder = null;
const END_STATE = 0;
const PRE_STATE = 1;
const START_STATE = 2;
const PAUSE_STATE = 3;
const RESUME_STATE = 4;
const STOP_STATE = 5;
const RESET_STATE = 6;
const RELEASE_STATE = 7;
const ERROR_STATE = 8;
const CHECK_STATE = 9;
const RECORDER_TIME = 3000;
const CHANNEL_ONE = 1;
const CHANNEL_TWO = 2;
const FORMAT_MP4 = media.AudioOutputFormat.MPEG_4;
const FORMAT_M4A = media.AudioOutputFormat.AAC_ADTS;
const ENCORDER_AACLC = media.AudioEncoder.AAC_LC;
const ONLYAUDIO_TYPE = 'only_audio';
let trackArray;
let recorderTime;
let fdPath;
let fdObject;
let audioConfig = {
audioEncoder : ENCORDER_AACLC,
audioEncodeBitRate : 48000,
audioSampleRate : 48000,
numberOfChannels : CHANNEL_TWO,
format : FORMAT_M4A,
uri : 'fd://',
location : { latitude : 30, longitude : 30 },
}
switch (mySteps[0]) {
case PRE_STATE:
console.info('case to prepare');
audioRecorder.prepare(audioConfig);
break;
case START_STATE:
console.info('case to start');
audioRecorder.start();
break;
case PAUSE_STATE:
console.info('case to pause');
audioRecorder.pause();
break;
case RESUME_STATE:
console.info('case to resume');
audioRecorder.resume();
break;
case STOP_STATE:
console.info('case to stop');
audioRecorder.stop();
break;
case RESET_STATE:
console.info('case to reset');
audioRecorder.reset();
break;
case RELEASE_STATE:
console.info('case to release');
function initAudioRecorder() {
if (audioRecorder != null) {
audioRecorder.release();
audioRecorder = null;
break;
case CHECK_STATE:
}
audioRecorder = media.createAudioRecorder();
}
beforeAll(async function () {
let permissionName1 = 'ohos.permission.MICROPHONE';
let permissionName2 = 'ohos.permission.MEDIA_LOCATION';
let permissionName3 = 'ohos.permission.READ_MEDIA';
let permissionName4 = 'ohos.permission.WRITE_MEDIA';
let permissionNames = [permissionName1, permissionName2, permissionName3, permissionName4];
await mediaTestBase.getPermission(permissionNames);
await mediaTestBase.msleepAsync(2000);
await mediaTestBase.driveFn(2);
console.info('beforeAll case');
})
beforeEach(function () {
console.info('beforeEach case');
})
afterEach(async function () {
await mediaTestBase.closeFd(fdObject.fileAsset, fdObject.fdNumber);
console.info('afterEach case');
})
afterAll(function () {
console.info('afterAll case');
})
async function nextStep(mySteps,done) {
if (mySteps[0] == END_STATE) {
done();
console.info('case to done');
return;
}
switch (mySteps[0]) {
case PRE_STATE:
console.info('case to prepare');
audioRecorder.prepare(audioConfig);
break;
case START_STATE:
console.info('case to start');
audioRecorder.start();
break;
case PAUSE_STATE:
console.info('case to pause');
audioRecorder.pause();
break;
case RESUME_STATE:
console.info('case to resume');
audioRecorder.resume();
break;
case STOP_STATE:
console.info('case to stop');
audioRecorder.stop();
break;
case RESET_STATE:
console.info('case to reset');
audioRecorder.reset();
break;
case RELEASE_STATE:
console.info('case to release');
audioRecorder.release();
audioRecorder = null;
break;
case CHECK_STATE:
mySteps.shift();
trackArray = mySteps[0];
recorderTime = mySteps[1];
mySteps.shift();
mySteps.shift();
await videoRecorderBase.checkVideos(fdPath, recorderTime, trackArray, null);
nextStep(mySteps, done);
break;
case ERROR_STATE:
console.info('case to wait error callback');
break;
default:
break;
}
}
function setCallback(mySteps, done) {
audioRecorder.on('prepare', () => {
console.info('setCallback prepare() case callback is called');
mySteps.shift();
trackArray = mySteps[0];
recorderTime = mySteps[1];
nextStep(mySteps, done);
});
audioRecorder.on('start', () => {
console.info('setCallback start() case callback is called');
mediaTestBase.msleep(RECORDER_TIME);
mySteps.shift();
nextStep(mySteps, done);
});
audioRecorder.on('pause', () => {
console.info('setCallback pause() case callback is called');
mySteps.shift();
await videoRecorderBase.checkVideos(fdPath, recorderTime, trackArray, null);
nextStep(mySteps, done);
break;
case ERROR_STATE:
console.info('case to wait error callback');
break;
default:
break;
}
}
function setCallback(mySteps, done) {
audioRecorder.on('prepare', () => {
console.info('setCallback prepare() case callback is called');
mySteps.shift();
nextStep(mySteps, done);
});
audioRecorder.on('start', () => {
console.info('setCallback start() case callback is called');
mediaTestBase.msleep(RECORDER_TIME);
mySteps.shift();
nextStep(mySteps, done);
});
audioRecorder.on('pause', () => {
console.info('setCallback pause() case callback is called');
mySteps.shift();
nextStep(mySteps, done);
});
audioRecorder.on('resume', () => {
console.info('setCallback resume() case callback is called');
mediaTestBase.msleep(RECORDER_TIME);
mySteps.shift();
nextStep(mySteps, done);
});
audioRecorder.on('stop', () => {
console.info('setCallback stop() case callback is called');
mySteps.shift();
nextStep(mySteps, done);
});
audioRecorder.on('reset', () => {
console.info('setCallback reset() case callback is called');
mySteps.shift();
nextStep(mySteps, done);
});
audioRecorder.on('release', () => {
console.info('setCallback release() case callback is called');
mySteps.shift();
nextStep(mySteps, done);
});
audioRecorder.on('error', (err) => {
console.info(`case error called,errCode is ${err.code}`);
mySteps.shift();
expect(mySteps[0]).assertEqual(ERROR_STATE);
mySteps.shift();
nextStep(mySteps, done);
});
}
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_0100
* @tc.name : 01.AAC
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_0100', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_01.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE,
CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_0200
* @tc.name : 02.AAC_Different Channels 1
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_0200', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_02.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.numberOfChannels = CHANNEL_ONE;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE,
CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_0300
* @tc.name : 02.AAC_Different Channels 2
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_0300', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_03.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.numberOfChannels = CHANNEL_TWO;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE,
CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_0400
* @tc.name : 03.AAC_DifferentSampleRate 8000
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_0400', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_04.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.audioSampleRate = 8000; // samplerate 8000
audioConfig.numberOfChannels = CHANNEL_TWO;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE,
CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_0500
* @tc.name : 03.AAC_DifferentSampleRate 32000
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_0500', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_05.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.audioSampleRate = 32000; // samplerate 32000
audioConfig.numberOfChannels = CHANNEL_ONE;
audioConfig.format = FORMAT_MP4;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE,
CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_0600
* @tc.name : 03.AAC_DifferentSampleRate 44100
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_0600', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_06.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.audioSampleRate = 44100; // samplerate 44100
audioConfig.numberOfChannels = CHANNEL_TWO;
audioConfig.format = FORMAT_MP4;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE,
CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_0700
* @tc.name : 03.AAC_DifferentSampleRate 64000
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_0700', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_07.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.audioSampleRate = 64000; // samplerate 64000
audioConfig.numberOfChannels = CHANNEL_ONE;
audioConfig.format = FORMAT_M4A;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE,
CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_0800
* @tc.name : 03.AAC_DifferentSampleRate 96000
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_0800', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_08.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.audioSampleRate = 96000; // samplerate 96000
audioConfig.numberOfChannels = CHANNEL_TWO;
audioConfig.format = FORMAT_M4A;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE,
CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_0900
* @tc.name : 04.AAC_DifferentBitrate 8000
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_0900', 0, async function (done) {
fdObject = await mediaTestBase.getFd('audio_09.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.audioSampleRate = 22050; // samplerate 22050
audioConfig.audioEncodeBitRate = 8000; // encodeBitrate 8000
audioConfig.numberOfChannels = CHANNEL_TWO;
audioConfig.format = FORMAT_MP4;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE,
CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_1000
* @tc.name : 04.AAC_DifferentBitrate 16000
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_1000', 0, async function (done) {
fdObject = await mediaTestBase.getFd('audio_10.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.audioSampleRate = 44100; // samplerate 44100
audioConfig.audioEncodeBitRate = 16000; // encodeBitrate 16000
audioConfig.numberOfChannels = CHANNEL_ONE;
audioConfig.format = FORMAT_MP4;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE,
CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_1100
* @tc.name : 04.AAC_DifferentBitrate 32000
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_1100', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_11.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.audioSampleRate = 44100; // samplerate 44100
audioConfig.audioEncodeBitRate = 32000; // encodeBitrate 32000
audioConfig.numberOfChannels = CHANNEL_ONE;
audioConfig.format = FORMAT_M4A;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE,
CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_1200
* @tc.name : 04.AAC_DifferentBitrate 64000
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_1200', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_12.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.audioSampleRate = 44100; // samplerate 44100
audioConfig.audioEncodeBitRate = 64000; // encodeBitrate 64000
audioConfig.numberOfChannels = CHANNEL_TWO;
audioConfig.format = FORMAT_M4A;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE,
CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_1300
* @tc.name : 04.AAC_DifferentBitrate 112000
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_1300', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_13.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.audioSampleRate = 44100; // samplerate 44100
audioConfig.audioEncodeBitRate = 112000; // encodeBitrate 112000
audioConfig.numberOfChannels = CHANNEL_TWO;
audioConfig.format = FORMAT_M4A;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE,
CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FORMAT_MP4_0100
* @tc.name : 02.AAC,mp4
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FORMAT_MP4_0100', 0, async function (done) {
fdObject = await mediaTestBase.getFd('audio_14.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.audioEncodeBitRate = 22050; // samplerate 22050
audioConfig.audioSampleRate = 22050; // encodeBitrate 22050
audioConfig.format = FORMAT_MP4;
audioConfig.numberOfChannels = CHANNEL_TWO;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE,
CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FORMAT_M4A_0100
* @tc.name : 02.AAC,mp4
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FORMAT_M4A_0100', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_15.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.audioEncodeBitRate = 22050; // samplerate 22050
audioConfig.audioSampleRate = 22050; // encodeBitrate 22050
audioConfig.format = FORMAT_M4A;
audioConfig.numberOfChannels = CHANNEL_TWO;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE,
CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_0100
* @tc.name : 001.start
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_0100', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_16.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.format = FORMAT_M4A;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE,
CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_0200
* @tc.name : 002.pause
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_0200', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_17.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.format = FORMAT_M4A;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, STOP_STATE,
RELEASE_STATE, CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_0300
* @tc.name : 003.pause->resume
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_0300', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_18.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.format = FORMAT_M4A;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, RESUME_STATE,
STOP_STATE, RELEASE_STATE, CHECK_STATE, trackArray, RECORDER_TIME * 2, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_0400
* @tc.name : 005.reset
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_0400', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_19.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.format = FORMAT_M4A;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, RELEASE_STATE,
CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_0500
* @tc.name : 006.pause->resume->pause
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_0500', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_20.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.format = FORMAT_M4A;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, RESUME_STATE, PAUSE_STATE,
STOP_STATE, RELEASE_STATE, CHECK_STATE, trackArray, RECORDER_TIME * 2, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_0600
* @tc.name : 007.pause->stop->reset
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_0600', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_21.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.format = FORMAT_M4A;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, STOP_STATE,
RESET_STATE, RELEASE_STATE, CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_0700
* @tc.name : 008.pause->resume->stop->reset
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_0700', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_22.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.format = FORMAT_M4A;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, RESUME_STATE, STOP_STATE,
RESET_STATE, RELEASE_STATE, CHECK_STATE, trackArray, RECORDER_TIME * 2, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_0800
* @tc.name : 009.stop->reset->pause->resume->stop->reset
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_0800', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_23.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.format = FORMAT_M4A;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, PRE_STATE, START_STATE,
PAUSE_STATE, RESUME_STATE, STOP_STATE, RESET_STATE, RELEASE_STATE,
CHECK_STATE, trackArray, RECORDER_TIME * 2, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_0900
* @tc.name : 010.stop->reset->pause->stop->reset
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_0900', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_24.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.format = FORMAT_M4A;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, PRE_STATE, START_STATE,
PAUSE_STATE, STOP_STATE, RESET_STATE, RELEASE_STATE,
CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_1000
* @tc.name : 011.start->reset->start->stop
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_1000', 0, async function (done) {
fdObject = await mediaTestBase.getFd('audio_25.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.format = FORMAT_MP4;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, PRE_STATE,
START_STATE, STOP_STATE, RELEASE_STATE, CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_1100
* @tc.name : 012.start->pause->start(error)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_1100', 0, async function (done) {
fdObject = await mediaTestBase.getFd('audio_26.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.format = FORMAT_MP4;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, START_STATE, ERROR_STATE,
STOP_STATE, RELEASE_STATE, CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_1200
* @tc.name : 013.start->stop->pause(error)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_1200', 0, async function (done) {
fdObject = await mediaTestBase.getFd('audio_27.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.format = FORMAT_MP4;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, PAUSE_STATE, ERROR_STATE,
RELEASE_STATE, CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_1300
* @tc.name : 014. API8 audioEncoderMime: audio/mp4a-latm,
* fileFormat:mp4
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_1300', 0, async function (done) {
fdObject = await mediaTestBase.getFd('audio_28.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
let newAudioConfig = {
audioEncodeBitRate : 22050,
audioSampleRate : 22050,
numberOfChannels : CHANNEL_TWO,
uri : 'fd://',
location : { latitude : 1, longitude : 1 },
audioEncoderMime : media.CodecMimeType.AUDIO_AAC,
fileFormat : media.ContainerFormatType.CFT_MPEG_4,
});
audioRecorder.on('resume', () => {
console.info('setCallback resume() case callback is called');
mediaTestBase.msleep(RECORDER_TIME);
mySteps.shift();
nextStep(mySteps, done);
});
audioRecorder.on('stop', () => {
console.info('setCallback stop() case callback is called');
mySteps.shift();
nextStep(mySteps, done);
});
audioRecorder.on('reset', () => {
console.info('setCallback reset() case callback is called');
mySteps.shift();
nextStep(mySteps, done);
});
audioRecorder.on('release', () => {
console.info('setCallback release() case callback is called');
mySteps.shift();
nextStep(mySteps, done);
});
audioRecorder.on('error', (err) => {
console.info(`case error called,errCode is ${err.code}`);
mySteps.shift();
expect(mySteps[0]).assertEqual(ERROR_STATE);
mySteps.shift();
nextStep(mySteps, done);
});
}
newAudioConfig.uri = fdPath;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, newAudioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE,
CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(newAudioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_0100
* @tc.name : 01.AAC
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_0100', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_01.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE,
CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_0200
* @tc.name : 02.AAC_Different Channels 1
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_0200', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_02.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.numberOfChannels = CHANNEL_ONE;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE,
CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_0300
* @tc.name : 02.AAC_Different Channels 2
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_0300', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_03.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.numberOfChannels = CHANNEL_TWO;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE,
CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_0400
* @tc.name : 03.AAC_DifferentSampleRate 8000
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_0400', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_04.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.audioSampleRate = 8000; // samplerate 8000
audioConfig.numberOfChannels = CHANNEL_TWO;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE,
CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_0500
* @tc.name : 03.AAC_DifferentSampleRate 32000
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_0500', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_05.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.audioSampleRate = 32000; // samplerate 32000
audioConfig.numberOfChannels = CHANNEL_ONE;
audioConfig.format = FORMAT_MP4;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE,
CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_0600
* @tc.name : 03.AAC_DifferentSampleRate 44100
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_0600', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_06.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.audioSampleRate = 44100; // samplerate 44100
audioConfig.numberOfChannels = CHANNEL_TWO;
audioConfig.format = FORMAT_MP4;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE,
CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_0700
* @tc.name : 03.AAC_DifferentSampleRate 64000
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_0700', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_07.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.audioSampleRate = 64000; // samplerate 64000
audioConfig.numberOfChannels = CHANNEL_ONE;
audioConfig.format = FORMAT_M4A;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE,
CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_0800
* @tc.name : 03.AAC_DifferentSampleRate 96000
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_0800', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_08.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.audioSampleRate = 96000; // samplerate 96000
audioConfig.numberOfChannels = CHANNEL_TWO;
audioConfig.format = FORMAT_M4A;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE,
CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_0900
* @tc.name : 04.AAC_DifferentBitrate 8000
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_0900', 0, async function (done) {
fdObject = await mediaTestBase.getFd('audio_09.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.audioSampleRate = 22050; // samplerate 22050
audioConfig.audioEncodeBitRate = 8000; // encodeBitrate 8000
audioConfig.numberOfChannels = CHANNEL_TWO;
audioConfig.format = FORMAT_MP4;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE,
CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_1000
* @tc.name : 04.AAC_DifferentBitrate 16000
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_1000', 0, async function (done) {
fdObject = await mediaTestBase.getFd('audio_10.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.audioSampleRate = 44100; // samplerate 44100
audioConfig.audioEncodeBitRate = 16000; // encodeBitrate 16000
audioConfig.numberOfChannels = CHANNEL_ONE;
audioConfig.format = FORMAT_MP4;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE,
CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_1100
* @tc.name : 04.AAC_DifferentBitrate 32000
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_1100', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_11.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.audioSampleRate = 44100; // samplerate 44100
audioConfig.audioEncodeBitRate = 32000; // encodeBitrate 32000
audioConfig.numberOfChannels = CHANNEL_ONE;
audioConfig.format = FORMAT_M4A;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE,
CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_1200
* @tc.name : 04.AAC_DifferentBitrate 64000
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_1200', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_12.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.audioSampleRate = 44100; // samplerate 44100
audioConfig.audioEncodeBitRate = 64000; // encodeBitrate 64000
audioConfig.numberOfChannels = CHANNEL_TWO;
audioConfig.format = FORMAT_M4A;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE,
CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_1300
* @tc.name : 04.AAC_DifferentBitrate 112000
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_CODEC_AAC_1300', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_13.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.audioSampleRate = 44100; // samplerate 44100
audioConfig.audioEncodeBitRate = 112000; // encodeBitrate 112000
audioConfig.numberOfChannels = CHANNEL_TWO;
audioConfig.format = FORMAT_M4A;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE,
CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FORMAT_MP4_0100
* @tc.name : 02.AAC,mp4
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FORMAT_MP4_0100', 0, async function (done) {
fdObject = await mediaTestBase.getFd('audio_14.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.audioEncodeBitRate = 22050; // samplerate 22050
audioConfig.audioSampleRate = 22050; // encodeBitrate 22050
audioConfig.format = FORMAT_MP4;
audioConfig.numberOfChannels = CHANNEL_TWO;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE,
CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FORMAT_M4A_0100
* @tc.name : 02.AAC,mp4
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FORMAT_M4A_0100', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_15.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.audioEncodeBitRate = 22050; // samplerate 22050
audioConfig.audioSampleRate = 22050; // encodeBitrate 22050
audioConfig.format = FORMAT_M4A;
audioConfig.numberOfChannels = CHANNEL_TWO;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE,
CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_0100
* @tc.name : 001.start
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_0100', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_16.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.format = FORMAT_M4A;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE,
CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_0200
* @tc.name : 002.pause
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_0200', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_17.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.format = FORMAT_M4A;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, STOP_STATE,
RELEASE_STATE, CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_0300
* @tc.name : 003.pause->resume
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_0300', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_18.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.format = FORMAT_M4A;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, RESUME_STATE,
STOP_STATE, RELEASE_STATE, CHECK_STATE, trackArray, RECORDER_TIME * 2, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_0400
* @tc.name : 005.reset
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_0400', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_19.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.format = FORMAT_M4A;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, RELEASE_STATE,
CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_0500
* @tc.name : 006.pause->resume->pause
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_0500', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_20.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.format = FORMAT_M4A;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, RESUME_STATE, PAUSE_STATE,
STOP_STATE, RELEASE_STATE, CHECK_STATE, trackArray, RECORDER_TIME * 2, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_0600
* @tc.name : 007.pause->stop->reset
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_0600', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_21.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.format = FORMAT_M4A;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, STOP_STATE,
RESET_STATE, RELEASE_STATE, CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_0700
* @tc.name : 008.pause->resume->stop->reset
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_0700', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_22.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.format = FORMAT_M4A;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, RESUME_STATE, STOP_STATE,
RESET_STATE, RELEASE_STATE, CHECK_STATE, trackArray, RECORDER_TIME * 2, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_0800
* @tc.name : 009.stop->reset->pause->resume->stop->reset
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_0800', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_23.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.format = FORMAT_M4A;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, PRE_STATE, START_STATE,
PAUSE_STATE, RESUME_STATE, STOP_STATE, RESET_STATE, RELEASE_STATE,
CHECK_STATE, trackArray, RECORDER_TIME * 2, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_0900
* @tc.name : 010.stop->reset->pause->stop->reset
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_0900', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_24.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.format = FORMAT_M4A;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, PRE_STATE, START_STATE,
PAUSE_STATE, STOP_STATE, RESET_STATE, RELEASE_STATE,
CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_1000
* @tc.name : 011.start->reset->start->stop
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_1000', 0, async function (done) {
fdObject = await mediaTestBase.getFd('audio_25.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.format = FORMAT_MP4;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, PRE_STATE,
START_STATE, STOP_STATE, RELEASE_STATE, CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_1100
* @tc.name : 012.start->pause->start(error)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_1100', 0, async function (done) {
fdObject = await mediaTestBase.getFd('audio_26.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.format = FORMAT_MP4;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, START_STATE, ERROR_STATE,
STOP_STATE, RELEASE_STATE, CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_1200
* @tc.name : 013.start->stop->pause(error)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_1200', 0, async function (done) {
fdObject = await mediaTestBase.getFd('audio_27.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath;
audioConfig.format = FORMAT_MP4;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, audioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, PAUSE_STATE, ERROR_STATE,
RELEASE_STATE, CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_1300
* @tc.name : 014. API8 audioEncoderMime: audio/mp4a-latm,
* fileFormat:mp4
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_1300', 0, async function (done) {
fdObject = await mediaTestBase.getFd('audio_28.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
let newAudioConfig = {
audioEncodeBitRate : 22050,
audioSampleRate : 22050,
numberOfChannels : CHANNEL_TWO,
uri : 'fd://',
location : { latitude : 1, longitude : 1 },
audioEncoderMime : media.CodecMimeType.AUDIO_AAC,
fileFormat : media.ContainerFormatType.CFT_MPEG_4,
}
newAudioConfig.uri = fdPath;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, newAudioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE,
CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(newAudioConfig);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_1400
* @tc.name : 014. API8 audioEncoderMime: audio/mp4a-latm,
* fileFormat:m4a
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_1400', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_29.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString();
let newAudioConfig = {
audioEncodeBitRate : 22050,
audioSampleRate : 22050,
numberOfChannels : CHANNEL_TWO,
uri : 'fd://',
location : { latitude : 1, longitude : 1 },
audioEncoderMime : media.CodecMimeType.AUDIO_AAC,
fileFormat : media.ContainerFormatType.CFT_MPEG_4A,
}
newAudioConfig.uri = fdPath;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, newAudioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE,
CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(newAudioConfig);
})
})
}
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_1400
* @tc.name : 014. API8 audioEncoderMime: audio/mp4a-latm,
* fileFormat:m4a
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_FUNCTION_1400', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_29.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString();
let newAudioConfig = {
audioEncodeBitRate : 22050,
audioSampleRate : 22050,
numberOfChannels : CHANNEL_TWO,
uri : 'fd://',
location : { latitude : 1, longitude : 1 },
audioEncoderMime : media.CodecMimeType.AUDIO_AAC,
fileFormat : media.ContainerFormatType.CFT_MPEG_4A,
}
newAudioConfig.uri = fdPath;
let trackArray = videoRecorderBase.getTrackArray(ONLYAUDIO_TYPE, newAudioConfig);
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE,
CHECK_STATE, trackArray, RECORDER_TIME, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(newAudioConfig);
})
})
{
"string": [
{
"name": "entry_MainAbility",
"value": "entry_MainAbility"
},
{
"name": "mainability_description",
"value": "JS_Empty Ability"
}
]
{
"string": [
{
"name": "entry_MainAbility",
"value": "entry_MainAbility"
},
{
"name": "mainability_description",
"value": "JS_Empty Ability"
},
{
"name": "MainAbility_desc",
"value": "description"
},
{
"name": "MainAbility_label",
"value": "label"
},
{
"name": "TestAbility_desc",
"value": "description"
},
{
"name": "TestAbility_label",
"value": "label"
}
]
}
\ No newline at end of file
......@@ -12,9 +12,13 @@
{
"type": "ShellKit",
"run-command": [
"rm -rf /storage/media/100/local/files/Videos/COMPATIBILITY*"
"rm -rf /storage/media/100/local/files/Audios/COMPATIBILITY*",
"param set persist.ace.testmode.enabled 1",
"power-shell setmode 602"
],
"teardown-command": []
"teardown-command": [
"power-shell setmode 600"
]
},
{
"test-file-name": [
......
......@@ -57,8 +57,8 @@
}
],
"deviceType": [
"tablet",
"default",
"tablet",
"default",
"default",
"tablet",
"tv",
......@@ -69,10 +69,6 @@
"name": "ohos.permission.GRANT_SENSITIVE_PERMISSIONS",
"reason": "use ohos.permission.GRANT_SENSITIVE_PERMISSIONS"
},
{
"name": "ohos.permission.REVOKE_SENSITIVE_PERMISSIONS",
"reason": "use ohos.permission.REVOKE_SENSITIVE_PERMISSIONS"
},
{
"name": "ohos.permission.MICROPHONE",
"reason": "use ohos.permission.MICROPHONE"
......
......@@ -17,6 +17,7 @@ import media from '@ohos.multimedia.media'
import abilityAccessCtrl from '@ohos.abilityAccessCtrl'
import bundle from '@ohos.bundle'
import mediaLibrary from '@ohos.multimedia.mediaLibrary'
import * as mediaTestBase from '../../../../../MediaTestBase.js';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium'
export default function AudioRecorderFormatCompatibilityTest() {
......@@ -59,7 +60,14 @@ describe('AudioRecorderFormatCompatibilityTest', function () {
}
beforeAll(async function () {
await applyPermission();
let permissionName1 = 'ohos.permission.MICROPHONE';
let permissionName2 = 'ohos.permission.MEDIA_LOCATION';
let permissionName3 = 'ohos.permission.READ_MEDIA';
let permissionName4 = 'ohos.permission.WRITE_MEDIA';
let permissionNames = [permissionName1, permissionName2, permissionName3, permissionName4];
await mediaTestBase.getPermission(permissionNames);
await mediaTestBase.msleepAsync(2000);
await mediaTestBase.driveFn(2);
console.info('beforeAll case');
})
......@@ -76,41 +84,6 @@ describe('AudioRecorderFormatCompatibilityTest', function () {
console.info('afterAll case');
})
async function applyPermission() {
let appInfo = await bundle.getApplicationInfo('ohos.acts.multimedia.audio.recorderformat', 0, 100);
let atManager = abilityAccessCtrl.createAtManager();
if (atManager != null) {
let tokenID = appInfo.accessTokenId;
console.info('[permission] case accessTokenID is ' + tokenID);
let permissionName1 = 'ohos.permission.MICROPHONE';
let permissionName2 = 'ohos.permission.MEDIA_LOCATION';
let permissionName3 = 'ohos.permission.READ_MEDIA';
let permissionName4 = 'ohos.permission.WRITE_MEDIA';
await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => {
console.info('[permission] case grantUserGrantedPermission success :' + result);
}).catch((err) => {
console.error('[permission] case grantUserGrantedPermission failed :' + err);
});
await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => {
console.info('[permission] case grantUserGrantedPermission success :' + result);
}).catch((err) => {
console.error('[permission] case grantUserGrantedPermission failed :' + err);
});
await atManager.grantUserGrantedPermission(tokenID, permissionName3, 1).then((result) => {
console.info('[permission] case grantUserGrantedPermission success :' + result);
}).catch((err) => {
console.error('[permission] case grantUserGrantedPermission failed :' + err);
});
await atManager.grantUserGrantedPermission(tokenID, permissionName4, 1).then((result) => {
console.info('[permission] case grantUserGrantedPermission success :' + result);
}).catch((err) => {
console.error('[permission] case grantUserGrantedPermission failed :' + err);
});
} else {
console.error('[permission] case apply permission failed, createAtManager failed');
}
}
async function getFd(pathName) {
let displayName = pathName;
const mediaTest = mediaLibrary.getMediaLibrary();
......
......@@ -57,8 +57,8 @@
}
],
"deviceType": [
"tablet",
"default",
"tablet",
"default",
"default",
"tablet",
"tv",
......
......@@ -12,8 +12,10 @@
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("video_recorder_js_hap") {
hap_profile = "./src/main/config.json"
js2abc = true
deps = [
":video_recorder_js_assets",
":video_recorder_resources",
......@@ -32,7 +34,9 @@ ohos_js_hap_suite("video_recorder_js_hap") {
# subsystem_name = "xts"
}
ohos_js_assets("video_recorder_js_assets") {
source_dir = "./src/main/js/default"
js2abc = true
hap_profile = "./src/main/config.json"
source_dir = "./src/main/js"
}
ohos_resources("video_recorder_resources") {
sources = [ "./src/main/resources" ]
......
{
"description": "Configuration for videoRecorder Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "2000000",
"package": "ohos.acts.multimedia.video.videorecorder",
"shell-timeout": "60000"
},
"kits": [
{
"type": "ShellKit",
"run-command": [
"rm -rf /storage/media/100/local/files/Videos/*",
"power-shell setmode 602"
],
"teardown-command":[
"power-shell setmode 600"
]
},
{
"test-file-name": [
"ActsVideoRecorderJsTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
{
"description": "Configuration for videoRecorder Tests",
"driver": {
"type": "OHJSUnitTest",
"test-timeout": "1000000",
"shell-timeout": "1000000",
"testcase-timeout": 60000,
"bundle-name": "ohos.acts.multimedia.video.videorecorder",
"package-name": "ohos.acts.multimedia.video.videorecorder"
},
"kits": [
{
"test-file-name": [
"ActsVideoRecorderJsTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
},
{
"type": "ShellKit",
"run-command": [
"rm -rf /storage/media/100/local/files/Videos/*",
"param set persist.ace.testmode.enabled 1",
"power-shell setmode 602"
],
"teardown-command":[
"power-shell setmode 600"
],
"cleanup-apps": true
}
]
}
\ No newline at end of file
{
"app": {
"apiVersion": {
"compatible": 6,
"releaseType": "Beta1",
"target": 7
},
"vendor": "acts",
"bundleName": "ohos.acts.multimedia.video.videorecorder",
"version": {
"code": 1000000,
"name": "1.0.0"
}
},
"deviceConfig": {
"default": {
"debug": true
}
},
"module": {
"abilities": [
{
"iconId": 16777218,
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"descriptionId": 16777217,
"visible": true,
"labelId": 16777216,
"icon": "$media:icon",
"name": "ohos.acts.multimedia.video.videorecorder.MainAbility",
"description": "$string:mainability_description",
"label": "$string:entry_MainAbility",
"type": "page",
"homeAbility": true,
"launchType": "singleton"
}
],
"deviceType": [
"tablet",
"default",
"default",
"tablet",
"tv",
"wearable"
],
"reqPermissions": [
{
"name" : "ohos.permission.GRANT_SENSITIVE_PERMISSIONS",
"reason" : "use ohos.permission.GRANT_SENSITIVE_PERMISSIONS"
},
{
"name" : "ohos.permission.REVOKE_SENSITIVE_PERMISSIONS",
"reason" : "use ohos.permission.REVOKE_SENSITIVE_PERMISSIONS"
},
{
"name" : "ohos.permission.CAMERA",
"reason" : "use ohos.permission.CAMERA"
},
{
"name" : "ohos.permission.MICROPHONE",
"reason" : "use ohos.permission.MICROPHONE"
},
{
"name" : "ohos.permission.MEDIA_LOCATION",
"reason" : "use ohos.permission.MEDIA_LOCATION"
},
{
"name" : "ohos.permission.READ_MEDIA",
"reason" : "use ohos.permission.READ_MEDIA"
},
{
"name" : "ohos.permission.WRITE_MEDIA",
"reason" : "use ohos.permission.WRITE_MEDIA"
}
],
"mainAbility": "ohos.acts.multimedia.video.videorecorder.MainAbility",
"distro": {
"moduleType": "entry",
"installationFree": false,
"deliveryWithInstall": true,
"moduleName": "entry"
},
"package": "ohos.acts.multimedia.video.videorecorder",
"name": ".MyApplication",
"js": [
{
"pages": [
"pages/index/index",
"pages/surfaceTest/surfaceTest",
"pages/surfaceTest2/surfaceTest2"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": true
}
}
]
}
{
"app": {
"apiVersion": {
"compatible": 6,
"releaseType": "Beta1",
"target": 7
},
"vendor": "acts",
"bundleName": "ohos.acts.multimedia.video.videorecorder",
"version": {
"code": 1000000,
"name": "1.0.0"
}
},
"deviceConfig": {
"default": {
"debug": true
}
},
"module": {
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"orientation": "unspecified",
"formsEnabled": false,
"name": ".MainAbility",
"srcLanguage": "js",
"srcPath": "MainAbility",
"icon": "$media:icon",
"description": "$string:MainAbility_desc",
"label": "$string:MainAbility_label",
"type": "page",
"visible": true,
"launchType": "standard"
},
{
"orientation": "unspecified",
"formsEnabled": false,
"name": ".TestAbility",
"srcLanguage": "js",
"srcPath": "TestAbility",
"icon": "$media:icon",
"description": "$string:TestAbility_desc",
"label": "$string:TestAbility_label",
"type": "page",
"visible": true,
"launchType": "standard"
}
],
"deviceType": [
"tablet",
"default",
"default",
"tablet",
"tv",
"wearable"
],
"mainAbility": ".MainAbility",
"distro": {
"moduleType": "entry",
"installationFree": false,
"deliveryWithInstall": true,
"moduleName": "entry"
},
"reqPermissions": [
{
"name": "ohos.permission.GRANT_SENSITIVE_PERMISSIONS",
"reason": "use ohos.permission.GRANT_SENSITIVE_PERMISSIONS"
},
{
"name" : "ohos.permission.CAMERA",
"reason" : "use ohos.permission.CAMERA"
},
{
"name" : "ohos.permission.MICROPHONE",
"reason" : "use ohos.permission.MICROPHONE"
},
{
"name" : "ohos.permission.MEDIA_LOCATION",
"reason" : "use ohos.permission.MEDIA_LOCATION"
},
{
"name" : "ohos.permission.READ_MEDIA",
"reason" : "use ohos.permission.READ_MEDIA"
},
{
"name" : "ohos.permission.WRITE_MEDIA",
"reason" : "use ohos.permission.WRITE_MEDIA"
}
],
"package": "ohos.acts.multimedia.video.videorecorder",
"name": ".entry",
"js": [
{
"pages": [
"pages/index/index",
"pages/surfaceTest/surfaceTest",
"pages/surfaceTest2/surfaceTest2"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": true
}
},
{
"pages": [
"pages/index/index"
],
"name": ".TestAbility",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
],
"testRunner": {
"name": "OpenHarmonyTestRunner",
"srcPath": "TestRunner"
},
"srcPath": ""
}
}
\ No newline at end of file
/*
* Copyright (C) 2022 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 AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from '../test/List.test'
export default {
onCreate() {
console.info('TestApplication onCreate')
setTimeout(()=>{
var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
},100)
},
onDestroy() {
console.info("TestApplication onDestroy");
}
};
{
"strings": {
"hello": "您好",
"world": "世界"
}
{
"strings": {
"hello": "您好",
"world": "世界"
}
}
\ No newline at end of file
/*
* Copyright (C) 2022 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.
*/
.container {
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
}
.title {
font-size: 40px;
color: #000000;
opacity: 0.9;
}
@media screen and (device-type: tablet) and (orientation: landscape) {
.title {
font-size: 100px;
}
}
@media screen and (device-type: wearable) {
.title {
font-size: 28px;
color: #FFFFFF;
}
}
@media screen and (device-type: tv) {
.container {
background-image: url("/common/images/Wallpaper.png");
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
.title {
font-size: 100px;
color: #FFFFFF;
}
}
@media screen and (device-type: phone) and (orientation: landscape) {
.title {
font-size: 60px;
}
}
/*
* Copyright (C) 2022 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.
*/
.container {
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
}
.title {
font-size: 40px;
color: #000000;
opacity: 0.9;
}
@media screen and (device-type: tablet) and (orientation: landscape) {
.title {
font-size: 100px;
}
}
@media screen and (device-type: wearable) {
.title {
font-size: 28px;
color: #FFFFFF;
}
}
@media screen and (device-type: tv) {
.container {
background-image: url("/common/images/Wallpaper.png");
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
.title {
font-size: 100px;
color: #FFFFFF;
}
}
@media screen and (device-type: phone) and (orientation: landscape) {
.title {
font-size: 60px;
}
}
<!--
Copyright (c) 2022 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.
-->
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
<!--
Copyright (c) 2022 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.
-->
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
/*
* Copyright (C) 2022 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.
*/
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
console.info('onShow finish')
},
onReady() {
},
}
\ No newline at end of file
/*
* Copyright (C) 2022 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.
*/
.container {
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
}
.title {
font-size: 40px;
color: #000000;
opacity: 0.9;
}
@media screen and (device-type: tablet) and (orientation: landscape) {
.title {
font-size: 100px;
}
}
@media screen and (device-type: wearable) {
.title {
font-size: 28px;
color: #FFFFFF;
}
}
@media screen and (device-type: tv) {
.container {
background-image: url("/common/images/Wallpaper.png");
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
.title {
font-size: 100px;
color: #FFFFFF;
}
}
@media screen and (device-type: phone) and (orientation: landscape) {
.title {
font-size: 60px;
}
}
/*
* Copyright (C) 2022 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.
*/
.container {
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
}
.title {
font-size: 40px;
color: #000000;
opacity: 0.9;
}
@media screen and (device-type: tablet) and (orientation: landscape) {
.title {
font-size: 100px;
}
}
@media screen and (device-type: wearable) {
.title {
font-size: 28px;
color: #FFFFFF;
}
}
@media screen and (device-type: tv) {
.container {
background-image: url("/common/images/Wallpaper.png");
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
.title {
font-size: 100px;
color: #FFFFFF;
}
}
@media screen and (device-type: phone) and (orientation: landscape) {
.title {
font-size: 60px;
}
}
<!--
Copyright (c) 2022 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.
-->
<div class="container">
<text class="title">
VideoRecorder Test
</text>
<Xcomponent id = 'XcomponentId2'
type = 'surface'
onload = 'LoadXcomponent2'
style = "width:720px;height:480px;border-color:red;border-width:5px">
</Xcomponent>
</div>
<!--
Copyright (c) 2022 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.
-->
<div class="container">
<text class="title">
VideoRecorder Test
</text>
<Xcomponent id = 'XcomponentId2'
type = 'surface'
onload = 'LoadXcomponent2'
style = "width:720px;height:480px;border-color:red;border-width:5px">
</Xcomponent>
</div>
/*
* Copyright (C) 2022 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 {Core, ExpectExtend} from 'deccjsunit/index'
import Fileio from '@ohos.fileio'
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
},
onReady() {
},
LoadXcomponent2() {
globalThis.value = this.$element('XcomponentId2').getXComponentSurfaceId()
},
/*
* Copyright (C) 2022 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 {Core, ExpectExtend} from 'deccjsunit/index'
import Fileio from '@ohos.fileio'
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
},
onReady() {
},
LoadXcomponent2() {
globalThis.value = this.$element('XcomponentId2').getXComponentSurfaceId()
},
}
\ No newline at end of file
/*
* Copyright (C) 2022 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.
*/
.container {
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
}
.title {
font-size: 40px;
color: #000000;
opacity: 0.9;
}
@media screen and (device-type: tablet) and (orientation: landscape) {
.title {
font-size: 100px;
}
}
@media screen and (device-type: wearable) {
.title {
font-size: 28px;
color: #FFFFFF;
}
}
@media screen and (device-type: tv) {
.container {
background-image: url("/common/images/Wallpaper.png");
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
.title {
font-size: 100px;
color: #FFFFFF;
}
}
@media screen and (device-type: phone) and (orientation: landscape) {
.title {
font-size: 60px;
}
}
/*
* Copyright (C) 2022 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.
*/
.container {
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
}
.title {
font-size: 40px;
color: #000000;
opacity: 0.9;
}
@media screen and (device-type: tablet) and (orientation: landscape) {
.title {
font-size: 100px;
}
}
@media screen and (device-type: wearable) {
.title {
font-size: 28px;
color: #FFFFFF;
}
}
@media screen and (device-type: tv) {
.container {
background-image: url("/common/images/Wallpaper.png");
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
.title {
font-size: 100px;
color: #FFFFFF;
}
}
@media screen and (device-type: phone) and (orientation: landscape) {
.title {
font-size: 60px;
}
}
<!--
Copyright (c) 2022 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.
-->
<div class="container">
<text class="title">
VideoRecorder Test
</text>
<Xcomponent id = 'XcomponentId3'
type = 'surface'
onload = 'LoadXcomponent3'
style = "width:720px;height:480px;border-color:red;border-width:5px">
</Xcomponent>
</div>
<!--
Copyright (c) 2022 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.
-->
<div class="container">
<text class="title">
VideoRecorder Test
</text>
<Xcomponent id = 'XcomponentId3'
type = 'surface'
onload = 'LoadXcomponent3'
style = "width:720px;height:480px;border-color:red;border-width:5px">
</Xcomponent>
</div>
/*
* Copyright (C) 2022 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 {Core, ExpectExtend} from 'deccjsunit/index'
import Fileio from '@ohos.fileio'
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
},
onReady() {
},
LoadXcomponent3() {
globalThis.value = this.$element('XcomponentId3').getXComponentSurfaceId()
},
/*
* Copyright (C) 2022 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 {Core, ExpectExtend} from 'deccjsunit/index'
import Fileio from '@ohos.fileio'
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
},
onReady() {
},
LoadXcomponent3() {
globalThis.value = this.$element('XcomponentId3').getXComponentSurfaceId()
},
}
\ No newline at end of file
/*
* Copyright (C) 2022 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.
*/
export default {
onCreate() {
console.info('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
}
};
/*
* Copyright (c) 2022 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.
*/
export default {
onCreate() {
console.info('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
}
};
{
"strings": {
"hello": "Hello",
"world": "World"
},
"Files": {
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
},
"Files": {
}
}
\ No newline at end of file
.container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
}
.title {
font-size: 60px;
text-align: center;
width: 100%;
height: 40%;
margin: 10px;
}
@media screen and (device-type: phone) and (orientation: landscape) {
.title {
font-size: 60px;
}
}
@media screen and (device-type: tablet) and (orientation: landscape) {
.title {
font-size: 100px;
}
}
\ No newline at end of file
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
/*
* Copyright (c) 2022 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.
*/
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
}
}
/*
* Copyright (c) 2022 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 AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
function translateParamsToString(parameters) {
const keySet = new Set([
'-s class', '-s notClass', '-s suite', '-s itName',
'-s level', '-s testType', '-s size', '-s timeout',
'-s package', '-s dryRun'
])
let targetParams = '';
for (const key in parameters) {
if (keySet.has(key)) {
targetParams += ' ' + key + ' ' + parameters[key]
}
}
return targetParams.trim()
}
export default {
onPrepare() {
console.info('OpenHarmonyTestRunner OnPrepare')
},
onRun() {
console.log('OpenHarmonyTestRunner onRun run')
var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.MainAbility'
var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName
cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters)
var debug = abilityDelegatorArguments.parameters["-D"]
console.info('debug value : '+debug)
if (debug == 'true')
{
cmd += ' -D'
}
console.info('cmd : '+cmd)
abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.info('executeShellCommand : err : ' + JSON.stringify(err));
console.info('executeShellCommand : data : ' + data.stdResult);
console.info('executeShellCommand : data : ' + data.exitCode);
})
}
};
/*
* Copyright (C) 2022 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 {Core, ExpectExtend} from 'deccjsunit/index'
import * as mediaTestBase from '../../../../../../../MediaTestBase.js';
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
},
async onShow() {
console.info('onShow finish')
let applictionName = 'ohos.acts.multimedia.video.videorecorder';
let permissionName1 = 'ohos.permission.CAMERA';
let permissionName2 = 'ohos.permission.MICROPHONE';
let permissionName3 = 'ohos.permission.MEDIA_LOCATION';
let permissionName4 = 'ohos.permission.READ_MEDIA';
let permissionName5 = 'ohos.permission.WRITE_MEDIA';
let permissionNames = new Array(permissionName1, permissionName2, permissionName3,
permissionName4, permissionName5);
await mediaTestBase.applyPermission(applictionName, permissionNames);
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
this.timeout = 60000
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
},
onReady() {
},
}
\ No newline at end of file
/*
* Copyright (C) 2022 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.
*/
require('./VideoRecorderFuncCallbackTest.test.js')
require('./VideoRecorderFuncPromiseTest.test.js')
require('./VideoRecorderAPICallbackTest.test.js')
require('./VideoRecorderEnumTest.test.js')
/*
* Copyright (C) 2022 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 VideoRecorderFuncPromiseTest from './VideoRecorderFuncPromiseTest.test.js'
import VideoRecorderFuncCallbackTest from './VideoRecorderFuncCallbackTest.test.js'
import VideoRecorderAPICallbackTest from './VideoRecorderAPICallbackTest.test.js'
import VideoRecorderEnumTest from './VideoRecorderEnumTest.test.js'
export default function testsuite() {
VideoRecorderFuncPromiseTest()
VideoRecorderFuncCallbackTest()
VideoRecorderAPICallbackTest()
VideoRecorderEnumTest()
}
......@@ -19,1156 +19,1160 @@ import * as mediaTestBase from '../../../../../MediaTestBase.js';
import * as videoRecorderBase from '../../../../../VideoRecorderTestBase.js';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
describe('VideoRecorderAPICallbackTest', function () {
const RECORDER_TIME = 3000;
const PAUSE_TIME = 1000;
const END_EVENT = 'end';
const CREATE_EVENT = 'create';
const PREPARE_EVENT = 'prepare';
const GETSURFACE_EVENT = 'getInputSurface';
const START_EVENT = 'start';
const PAUSE_EVENT = 'pause';
const RESUME_EVENT = 'resume';
const STOP_EVENT = 'stop';
const RESET_EVENT = 'reset';
const RELEASE_EVENT = 'release';
const START_STREEAM = 'start_stream';
const CLOSE_STREAM = 'close_stream';
const ERROR_EVENT = 'error';
let cameraManager;
let cameras;
let captureSession;
let videoOutput;
let surfaceID;
let fdPath;
let fdObject;
let cameraID = 0;
let playerSurfaceId = '';
let pageId = 0;
let videoProfiles;
let previewProfiles;
let previewOutput;
const pagePath1 = 'pages/surfaceTest/surfaceTest';
const pagePath2 = 'pages/surfaceTest2/surfaceTest2';
let events = require('events');
let eventEmitter = new events.EventEmitter();
let configFile = {
audioBitrate : 48000,
audioChannels : 2,
audioCodec : media.CodecMimeType.AUDIO_AAC,
audioSampleRate : 48000,
durationTime : 1000,
fileFormat : media.ContainerFormatType.CFT_MPEG_4,
videoBitrate : 48000,
videoCodec : media.CodecMimeType.VIDEO_MPEG4,
videoFrameWidth : 640,
videoFrameHeight : 480,
videoFrameRate : 10
}
// rotation 0, 90, 180, 270
let videoConfig = {
audioSourceType : media.AudioSourceType.AUDIO_SOURCE_TYPE_MIC,
videoSourceType : media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_YUV,
profile : configFile,
url : 'fd://',
rotation : 0,
location : { latitude : 30, longitude : 130 },
maxSize : 100,
maxDuration : 500
}
beforeAll(async function () {
cameraManager = await camera.getCameraManager(null);
if (cameraManager != null) {
console.info('[camera] case getCameraManager success');
} else {
console.info('[camera] case getCameraManager failed');
return;
}
await cameraManager.getSupportedCameras().then((cameraDevices)=> {
cameras = cameraDevices;
}, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
if (cameras != null) {
console.info('[camera] case getCameras success');
} else {
console.info('[camera] case getCameras failed');
}
await cameraManager.getSupportedOutputCapability(cameras[0]).then((cameraoutputcapability) => {
console.info('[camera] case getSupportedOutputCapability success');
videoProfiles = cameraoutputcapability.videoProfiles;
videoProfiles[0].size.height = 480;
videoProfiles[0].size.width = 640;
previewProfiles = cameraoutputcapability.previewProfiles;
previewProfiles[0].size.height = 480;
previewProfiles[0].size.width = 640;
}, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback)
if (previewProfiles[0].format == camera.CameraFormat.CAMERA_FORMAT_YUV_420_SP) {
console.info('[camera] case format is VIDEO_SOURCE_TYPE_SURFACE_YUV');
videoConfig.videoSourceType = media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_YUV;
} else {
console.info('[camera] case format is VIDEO_SOURCE_TYPE_SURFACE_ES');
videoConfig.videoSourceType = media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_ES;
}
fdObject = await mediaTestBase.getFd('recorder_callback_api.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
videoConfig.url = fdPath;
console.info('beforeAll case');
})
beforeEach(async function () {
await mediaTestBase.toNewPage(pagePath1, pagePath2, pageId);
pageId = (pageId + 1) % 2;
await mediaTestBase.msleepAsync(1000).then(
() => {}, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
playerSurfaceId = globalThis.value;
surfaceID = null;
console.info('beforeEach case');
})
afterEach(function () {
console.info('afterEach case');
})
afterAll(async function () {
await mediaTestBase.closeFd(fdObject.fileAsset, fdObject.fdNumber);
console.info('afterAll case');
})
function printfError(error, done) {
expect().assertFail();
console.info(`case error called,errMessage is ${error.message}`);
done();
}
function toNextStep(videoRecorder, steps, done) {
if (steps[0] == END_EVENT) {
console.info('case success!!');
done();
} else {
eventEmitter.emit(steps[0], videoRecorder, steps, done);
export default function VideoRecorderAPICallbackTest() {
describe('VideoRecorderAPICallbackTest', function () {
const RECORDER_TIME = 3000;
const PAUSE_TIME = 1000;
const END_EVENT = 'end';
const CREATE_EVENT = 'create';
const PREPARE_EVENT = 'prepare';
const GETSURFACE_EVENT = 'getInputSurface';
const START_EVENT = 'start';
const PAUSE_EVENT = 'pause';
const RESUME_EVENT = 'resume';
const STOP_EVENT = 'stop';
const RESET_EVENT = 'reset';
const RELEASE_EVENT = 'release';
const START_STREEAM = 'start_stream';
const CLOSE_STREAM = 'close_stream';
const ERROR_EVENT = 'error';
let cameraManager;
let cameras;
let captureSession;
let videoOutput;
let surfaceID;
let fdPath;
let fdObject;
let cameraID = 0;
let playerSurfaceId = '';
let pageId = 0;
let videoProfiles;
let previewProfiles;
let previewOutput;
const pagePath1 = 'pages/surfaceTest/surfaceTest';
const pagePath2 = 'pages/surfaceTest2/surfaceTest2';
let events = require('events');
let eventEmitter = new events.EventEmitter();
let configFile = {
audioBitrate : 48000,
audioChannels : 2,
audioCodec : media.CodecMimeType.AUDIO_AAC,
audioSampleRate : 48000,
durationTime : 1000,
fileFormat : media.ContainerFormatType.CFT_MPEG_4,
videoBitrate : 48000,
videoCodec : media.CodecMimeType.VIDEO_MPEG4,
videoFrameWidth : 640,
videoFrameHeight : 480,
videoFrameRate : 10
}
}
eventEmitter.on(START_STREEAM, async (videoRecorder, steps, done) => {
steps.shift();
videoOutput = await cameraManager.createVideoOutput(videoProfiles[0], surfaceID);
if (videoOutput == null) {
console.info('[camera] case createVideoOutput failed');
} else {
console.info('[camera] case createVideoOutput success');
// rotation 0, 90, 180, 270
let videoConfig = {
audioSourceType : media.AudioSourceType.AUDIO_SOURCE_TYPE_MIC,
videoSourceType : media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_YUV,
profile : configFile,
url : 'fd://',
rotation : 0,
location : { latitude : 30, longitude : 130 },
maxSize : 100,
maxDuration : 500
}
previewOutput = await cameraManager.createPreviewOutput(previewProfiles[0], playerSurfaceId)
captureSession = await videoRecorderBase.initCaptureSession(videoOutput, cameraManager,
cameras[0], previewOutput);
await videoOutput.start().then(() => {
console.info('[camera] case videoOutput start success');
});
toNextStep(videoRecorder, steps, done);
});
eventEmitter.on(CLOSE_STREAM, async (videoRecorder, steps, done) => {
steps.shift();
await videoOutput.stop().then(() => {
console.info('[camera] case videoOutput stop success');
});
await videoRecorderBase.stopCaptureSession(captureSession);
toNextStep(videoRecorder, steps, done);
});
eventEmitter.on(CREATE_EVENT, async (videoRecorder, steps, done) => {
steps.shift();
media.createVideoRecorder((err, recorder) => {
if (typeof (err) == 'undefined') {
console.info('case createVideoRecorder success ');
videoRecorder = recorder;
expect(videoRecorder.state).assertEqual('idle');
toNextStep(videoRecorder, steps, done);
} else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) {
steps.shift();
console.info('case createVideoRecorder error hanpped');
toNextStep(videoRecorder, steps, done);
beforeAll(async function () {
cameraManager = await camera.getCameraManager(null);
if (cameraManager != null) {
console.info('[camera] case getCameraManager success');
} else {
printfError(err, done);
console.info('[camera] case getCameraManager failed');
return;
}
});
});
eventEmitter.on(PREPARE_EVENT, async (videoRecorder, steps, done) => {
steps.shift();
videoRecorder.prepare(videoConfig, (err) => {
if (typeof (err) == 'undefined') {
console.info('case prepare success');
expect(videoRecorder.state).assertEqual('prepared');
toNextStep(videoRecorder, steps, done);
} else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) {
steps.shift();
console.info('case prepare error hanpped');
toNextStep(videoRecorder, steps, done);
await cameraManager.getSupportedCameras().then((cameraDevices)=> {
cameras = cameraDevices;
}, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
if (cameras != null) {
console.info('[camera] case getCameras success');
} else {
printfError(err, done);
console.info('[camera] case getCameras failed');
}
});
});
eventEmitter.on(GETSURFACE_EVENT, async (videoRecorder, steps, done) => {
steps.shift();
videoRecorder.getInputSurface((err, outPutSurface) => {
if (typeof (err) == 'undefined') {
console.info('case getInputSurface success');
surfaceID = outPutSurface;
toNextStep(videoRecorder, steps, done);
} else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) {
steps.shift();
console.info('case getInputSurface error hanpped');
toNextStep(videoRecorder, steps, done);
await cameraManager.getSupportedOutputCapability(cameras[0]).then((cameraoutputcapability) => {
console.info('[camera] case getSupportedOutputCapability success');
videoProfiles = cameraoutputcapability.videoProfiles;
videoProfiles[0].size.height = 480;
videoProfiles[0].size.width = 640;
previewProfiles = cameraoutputcapability.previewProfiles;
previewProfiles[0].size.height = 480;
previewProfiles[0].size.width = 640;
}, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback)
if (previewProfiles[0].format == camera.CameraFormat.CAMERA_FORMAT_YUV_420_SP) {
console.info('[camera] case format is VIDEO_SOURCE_TYPE_SURFACE_YUV');
videoConfig.videoSourceType = media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_YUV;
} else {
printfError(err, done);
console.info('[camera] case format is VIDEO_SOURCE_TYPE_SURFACE_ES');
videoConfig.videoSourceType = media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_ES;
}
});
});
eventEmitter.on(START_EVENT, async (videoRecorder, steps, done) => {
steps.shift();
videoRecorder.start((err) => {
if (typeof (err) == 'undefined') {
console.info('case start success');
expect(videoRecorder.state).assertEqual('playing');
mediaTestBase.msleep(RECORDER_TIME);
toNextStep(videoRecorder, steps, done);
} else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) {
steps.shift();
console.info('case start error hanpped');
toNextStep(videoRecorder, steps, done);
fdObject = await mediaTestBase.getFd('recorder_callback_api.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
videoConfig.url = fdPath;
console.info('beforeAll case');
})
beforeEach(async function () {
await mediaTestBase.toNewPage(pagePath1, pagePath2, pageId);
pageId = (pageId + 1) % 2;
await mediaTestBase.msleepAsync(1000).then(
() => {}, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
playerSurfaceId = globalThis.value;
surfaceID = null;
console.info('beforeEach case');
})
afterEach(function () {
console.info('afterEach case');
})
afterAll(async function () {
await mediaTestBase.closeFd(fdObject.fileAsset, fdObject.fdNumber);
console.info('afterAll case');
})
function printfError(error, done) {
expect().assertFail();
console.info(`case error called,errMessage is ${error.message}`);
done();
}
function toNextStep(videoRecorder, steps, done) {
if (steps[0] == END_EVENT) {
console.info('case success!!');
done();
} else {
printfError(err, done);
eventEmitter.emit(steps[0], videoRecorder, steps, done);
}
});
});
eventEmitter.on(PAUSE_EVENT, async (videoRecorder, steps, done) => {
steps.shift();
videoRecorder.pause((err) => {
if (typeof (err) == 'undefined') {
console.info('case pause success');
mediaTestBase.msleep(PAUSE_TIME);
expect(videoRecorder.state).assertEqual('paused');
toNextStep(videoRecorder, steps, done);
} else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) {
steps.shift();
console.info('case pause error hanpped');
toNextStep(videoRecorder, steps, done);
}
eventEmitter.on(START_STREEAM, async (videoRecorder, steps, done) => {
steps.shift();
videoOutput = await cameraManager.createVideoOutput(videoProfiles[0], surfaceID);
if (videoOutput == null) {
console.info('[camera] case createVideoOutput failed');
} else {
printfError(err, done);
console.info('[camera] case createVideoOutput success');
}
previewOutput = await cameraManager.createPreviewOutput(previewProfiles[0], playerSurfaceId)
captureSession = await videoRecorderBase.initCaptureSession(videoOutput, cameraManager,
cameras[0], previewOutput);
await videoOutput.start().then(() => {
console.info('[camera] case videoOutput start success');
});
toNextStep(videoRecorder, steps, done);
});
});
eventEmitter.on(RESUME_EVENT, async (videoRecorder, steps, done) => {
steps.shift();
videoRecorder.resume((err) => {
if (typeof (err) == 'undefined') {
console.info('case resume success');
mediaTestBase.msleep(RECORDER_TIME);
expect(videoRecorder.state).assertEqual('playing');
toNextStep(videoRecorder, steps, done);
} else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) {
steps.shift();
console.info('case resume error hanpped');
toNextStep(videoRecorder, steps, done);
} else {
printfError(err, done);
}
eventEmitter.on(CLOSE_STREAM, async (videoRecorder, steps, done) => {
steps.shift();
await videoOutput.stop().then(() => {
console.info('[camera] case videoOutput stop success');
});
await videoRecorderBase.stopCaptureSession(captureSession);
toNextStep(videoRecorder, steps, done);
});
});
eventEmitter.on(STOP_EVENT, async (videoRecorder, steps, done) => {
steps.shift();
videoRecorder.stop((err) => {
if (typeof (err) == 'undefined') {
console.info('case stop success');
expect(videoRecorder.state).assertEqual('stopped');
toNextStep(videoRecorder, steps, done);
} else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) {
steps.shift();
console.info('case stop error hanpped');
toNextStep(videoRecorder, steps, done);
} else {
printfError(err, done);
}
eventEmitter.on(CREATE_EVENT, async (videoRecorder, steps, done) => {
steps.shift();
media.createVideoRecorder((err, recorder) => {
if (typeof (err) == 'undefined') {
console.info('case createVideoRecorder success ');
videoRecorder = recorder;
expect(videoRecorder.state).assertEqual('idle');
toNextStep(videoRecorder, steps, done);
} else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) {
steps.shift();
console.info('case createVideoRecorder error hanpped');
toNextStep(videoRecorder, steps, done);
} else {
printfError(err, done);
}
});
});
});
eventEmitter.on(RESET_EVENT, async (videoRecorder, steps, done) => {
steps.shift();
videoRecorder.reset((err) => {
if (typeof (err) == 'undefined') {
console.info('case reset success');
expect(videoRecorder.state).assertEqual('idle');
toNextStep(videoRecorder, steps, done);
} else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) {
steps.shift();
console.info('case reset error hanpped');
toNextStep(videoRecorder, steps, done);
} else {
printfError(err, done);
}
eventEmitter.on(PREPARE_EVENT, async (videoRecorder, steps, done) => {
steps.shift();
videoRecorder.prepare(videoConfig, (err) => {
if (typeof (err) == 'undefined') {
console.info('case prepare success');
expect(videoRecorder.state).assertEqual('prepared');
toNextStep(videoRecorder, steps, done);
} else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) {
steps.shift();
console.info('case prepare error hanpped');
toNextStep(videoRecorder, steps, done);
} else {
printfError(err, done);
}
});
});
});
eventEmitter.on(RELEASE_EVENT, async (videoRecorder, steps, done) => {
steps.shift();
videoRecorder.release((err) => {
if (typeof (err) == 'undefined') {
expect(videoRecorder.state).assertEqual('idle');
console.info('case release success');
toNextStep(videoRecorder, steps, done);
} else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) {
steps.shift();
console.info('case release error hanpped');
toNextStep(videoRecorder, steps, done);
} else {
printfError(err, done);
}
eventEmitter.on(GETSURFACE_EVENT, async (videoRecorder, steps, done) => {
steps.shift();
videoRecorder.getInputSurface((err, outPutSurface) => {
if (typeof (err) == 'undefined') {
console.info('case getInputSurface success');
surfaceID = outPutSurface;
toNextStep(videoRecorder, steps, done);
} else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) {
steps.shift();
console.info('case getInputSurface error hanpped');
toNextStep(videoRecorder, steps, done);
} else {
printfError(err, done);
}
});
});
});
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0100
* @tc.name : 01.create->prepare
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0100', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0200
* @tc.name : 02.start->prepare
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0200', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, PREPARE_EVENT, ERROR_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0300
* @tc.name : 03.pause->prepare
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0300', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, PAUSE_EVENT, CLOSE_STREAM, PREPARE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0400
* @tc.name : 04.resume->prepare
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0400', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, PAUSE_EVENT, RESUME_EVENT,
PREPARE_EVENT, ERROR_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0500
* @tc.name : 05.stop->prepare
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0500', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, STOP_EVENT, CLOSE_STREAM, PREPARE_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0600
* @tc.name : 06.reset->prepare
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0600', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, CLOSE_STREAM, RESET_EVENT, PREPARE_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0700
* @tc.name : 07.getInputSurface->prepare
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0700', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, PREPARE_EVENT,
ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0800
* @tc.name : 08.prepare 3 times
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0800', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, PREPARE_EVENT, ERROR_EVENT,
PREPARE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0100
* @tc.name : 01.create->start
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0100', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, START_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0200
* @tc.name : 02.prepare->start
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0200', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0300
* @tc.name : 03.pause->start
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0300', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, PAUSE_EVENT, START_EVENT, ERROR_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0400
* @tc.name : 04.resume->start
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0400', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, PAUSE_EVENT, RESUME_EVENT,
START_EVENT, ERROR_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0500
* @tc.name : 05.stop->start
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0500', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, STOP_EVENT, CLOSE_STREAM, START_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0600
* @tc.name : 06.reset->start
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0600', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, RESET_EVENT, CLOSE_STREAM, START_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0700
* @tc.name : 07.getInputSurface->start
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0700', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0800
* @tc.name : 08.start 3 times
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0800', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, START_EVENT, ERROR_EVENT, START_EVENT, ERROR_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0100
* @tc.name : 01.create->pause
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0100', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PAUSE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0200
* @tc.name : 02.prepare->pause
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0200', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, PAUSE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0300
* @tc.name : 03.start->pause
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0300', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, PAUSE_EVENT, CLOSE_STREAM, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0400
* @tc.name : 04.resume->pause
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0400', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, PAUSE_EVENT, RESUME_EVENT,
PAUSE_EVENT, CLOSE_STREAM, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0500
* @tc.name : 05.stop->pause
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0500', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, STOP_EVENT, CLOSE_STREAM, PAUSE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0600
* @tc.name : 06.reset->pause
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0600', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, RESET_EVENT, CLOSE_STREAM, PAUSE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0700
* @tc.name : 07.getInputSurface->pause
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0700', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, PAUSE_EVENT,
ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0800
* @tc.name : 08.pause 3 times
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0800', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, PAUSE_EVENT, PAUSE_EVENT, ERROR_EVENT, PAUSE_EVENT, ERROR_EVENT,
CLOSE_STREAM, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0100
* @tc.name : 01.create->resume
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0100', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, RESUME_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0200
* @tc.name : 02.prepare->resume
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0200', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, RESUME_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0300
* @tc.name : 03.start->resume
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0300', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, RESUME_EVENT, ERROR_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0400
* @tc.name : 04.pause->resume
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0400', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, PAUSE_EVENT,
RESUME_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0500
* @tc.name : 05.stop->resume
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0500', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, STOP_EVENT, CLOSE_STREAM, RESUME_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0600
* @tc.name : 06.reset->resume
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0600', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, RESET_EVENT, CLOSE_STREAM, RESUME_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0700
* @tc.name : 07.getInputSurface->resume
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0700', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, RESUME_EVENT,
ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0800
* @tc.name : 08.resume 3 times
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0800', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, PAUSE_EVENT,
RESUME_EVENT, RESUME_EVENT, ERROR_EVENT, RESUME_EVENT, ERROR_EVENT,
RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0100
* @tc.name : 01.create->stop
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0100', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, STOP_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0200
* @tc.name : 02.prepare->stop
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0200', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, STOP_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0300
* @tc.name : 03.start->stop
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0300', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, STOP_EVENT, CLOSE_STREAM, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0400
* @tc.name : 04.pause->stop
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0400', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, PAUSE_EVENT, STOP_EVENT, CLOSE_STREAM, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0500
* @tc.name : 05.resume->stop
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0500', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, PAUSE_EVENT, RESUME_EVENT,
STOP_EVENT, CLOSE_STREAM, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0600
* @tc.name : 06.reset->stop
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0600', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, RESET_EVENT, STOP_EVENT,
ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0700
* @tc.name : 07.getInputSurface->stop
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0700', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT,
STOP_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0800
* @tc.name : 08.stop 3 times
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0800', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, STOP_EVENT, CLOSE_STREAM, STOP_EVENT, ERROR_EVENT,
STOP_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0100
* @tc.name : 01.create->reset
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0100', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, RESET_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0200
* @tc.name : 02.prepare->reset
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0200', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, RESET_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0300
* @tc.name : 03.start->reset
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0300', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, RESET_EVENT, CLOSE_STREAM, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0400
* @tc.name : 04.pause->reset
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0400', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, PAUSE_EVENT, RESET_EVENT, CLOSE_STREAM, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0500
* @tc.name : 05.resume->reset
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0500', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, PAUSE_EVENT, RESUME_EVENT,
RESET_EVENT, CLOSE_STREAM, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0600
* @tc.name : 06.stop->reset
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0600', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, STOP_EVENT, CLOSE_STREAM, RESET_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0700
* @tc.name : 07.getInputSurface->reset
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0700', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, RESET_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0800
* @tc.name : 08.reset 3 times
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0800', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, RESET_EVENT,
RESET_EVENT, RESET_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0100
* @tc.name : 01.create->getInputSurface
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0100', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, GETSURFACE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0200
* @tc.name : 02.prepare->getInputSurface
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0200', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0300
* @tc.name : 03.start->getInputSurface
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0300', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM, START_EVENT,
GETSURFACE_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0400
* @tc.name : 04.pause->getInputSurface
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0400', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM, START_EVENT,
PAUSE_EVENT, GETSURFACE_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0500
* @tc.name : 05.resume->getInputSurface
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0500', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM, START_EVENT,
PAUSE_EVENT, RESUME_EVENT, GETSURFACE_EVENT,
RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0600
* @tc.name : 06.stop->getInputSurface
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0600', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM, START_EVENT,
STOP_EVENT, CLOSE_STREAM, GETSURFACE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
eventEmitter.on(START_EVENT, async (videoRecorder, steps, done) => {
steps.shift();
videoRecorder.start((err) => {
if (typeof (err) == 'undefined') {
console.info('case start success');
expect(videoRecorder.state).assertEqual('playing');
mediaTestBase.msleep(RECORDER_TIME);
toNextStep(videoRecorder, steps, done);
} else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) {
steps.shift();
console.info('case start error hanpped');
toNextStep(videoRecorder, steps, done);
} else {
printfError(err, done);
}
});
});
eventEmitter.on(PAUSE_EVENT, async (videoRecorder, steps, done) => {
steps.shift();
videoRecorder.pause((err) => {
if (typeof (err) == 'undefined') {
console.info('case pause success');
mediaTestBase.msleep(PAUSE_TIME);
expect(videoRecorder.state).assertEqual('paused');
toNextStep(videoRecorder, steps, done);
} else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) {
steps.shift();
console.info('case pause error hanpped');
toNextStep(videoRecorder, steps, done);
} else {
printfError(err, done);
}
});
});
eventEmitter.on(RESUME_EVENT, async (videoRecorder, steps, done) => {
steps.shift();
videoRecorder.resume((err) => {
if (typeof (err) == 'undefined') {
console.info('case resume success');
mediaTestBase.msleep(RECORDER_TIME);
expect(videoRecorder.state).assertEqual('playing');
toNextStep(videoRecorder, steps, done);
} else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) {
steps.shift();
console.info('case resume error hanpped');
toNextStep(videoRecorder, steps, done);
} else {
printfError(err, done);
}
});
});
eventEmitter.on(STOP_EVENT, async (videoRecorder, steps, done) => {
steps.shift();
videoRecorder.stop((err) => {
if (typeof (err) == 'undefined') {
console.info('case stop success');
expect(videoRecorder.state).assertEqual('stopped');
toNextStep(videoRecorder, steps, done);
} else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) {
steps.shift();
console.info('case stop error hanpped');
toNextStep(videoRecorder, steps, done);
} else {
printfError(err, done);
}
});
});
eventEmitter.on(RESET_EVENT, async (videoRecorder, steps, done) => {
steps.shift();
videoRecorder.reset((err) => {
if (typeof (err) == 'undefined') {
console.info('case reset success');
expect(videoRecorder.state).assertEqual('idle');
toNextStep(videoRecorder, steps, done);
} else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) {
steps.shift();
console.info('case reset error hanpped');
toNextStep(videoRecorder, steps, done);
} else {
printfError(err, done);
}
});
});
eventEmitter.on(RELEASE_EVENT, async (videoRecorder, steps, done) => {
steps.shift();
videoRecorder.release((err) => {
if (typeof (err) == 'undefined') {
expect(videoRecorder.state).assertEqual('idle');
console.info('case release success');
toNextStep(videoRecorder, steps, done);
} else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) {
steps.shift();
console.info('case release error hanpped');
toNextStep(videoRecorder, steps, done);
} else {
printfError(err, done);
}
});
});
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0100
* @tc.name : 01.create->prepare
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0100', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0200
* @tc.name : 02.start->prepare
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0200', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, PREPARE_EVENT, ERROR_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0300
* @tc.name : 03.pause->prepare
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0300', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, PAUSE_EVENT, CLOSE_STREAM, PREPARE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0400
* @tc.name : 04.resume->prepare
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0400', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, PAUSE_EVENT, RESUME_EVENT,
PREPARE_EVENT, ERROR_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0500
* @tc.name : 05.stop->prepare
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0500', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, STOP_EVENT, CLOSE_STREAM, PREPARE_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0600
* @tc.name : 06.reset->prepare
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0600', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, CLOSE_STREAM, RESET_EVENT, PREPARE_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0700
* @tc.name : 07.getInputSurface->prepare
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0700', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, PREPARE_EVENT,
ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0800
* @tc.name : 08.prepare 3 times
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0800', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, PREPARE_EVENT, ERROR_EVENT,
PREPARE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0100
* @tc.name : 01.create->start
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0100', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, START_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0200
* @tc.name : 02.prepare->start
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0200', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0300
* @tc.name : 03.pause->start
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0300', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, PAUSE_EVENT, START_EVENT, ERROR_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0400
* @tc.name : 04.resume->start
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0400', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, PAUSE_EVENT, RESUME_EVENT,
START_EVENT, ERROR_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0500
* @tc.name : 05.stop->start
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0500', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, STOP_EVENT, CLOSE_STREAM, START_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0600
* @tc.name : 06.reset->start
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0600', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, RESET_EVENT, CLOSE_STREAM, START_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0700
* @tc.name : 07.getInputSurface->start
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0700', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0800
* @tc.name : 08.start 3 times
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0800', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, START_EVENT, ERROR_EVENT, START_EVENT, ERROR_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0100
* @tc.name : 01.create->pause
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0100', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PAUSE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0200
* @tc.name : 02.prepare->pause
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0200', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, PAUSE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0300
* @tc.name : 03.start->pause
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0300', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, PAUSE_EVENT, CLOSE_STREAM, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0400
* @tc.name : 04.resume->pause
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0400', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, PAUSE_EVENT, RESUME_EVENT,
PAUSE_EVENT, CLOSE_STREAM, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0500
* @tc.name : 05.stop->pause
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0500', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, STOP_EVENT, CLOSE_STREAM, PAUSE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0600
* @tc.name : 06.reset->pause
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0600', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, RESET_EVENT, CLOSE_STREAM, PAUSE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0700
* @tc.name : 07.getInputSurface->pause
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0700', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, PAUSE_EVENT,
ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0800
* @tc.name : 08.pause 3 times
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0800', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, PAUSE_EVENT, PAUSE_EVENT, ERROR_EVENT, PAUSE_EVENT, ERROR_EVENT,
CLOSE_STREAM, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0100
* @tc.name : 01.create->resume
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0100', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, RESUME_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0200
* @tc.name : 02.prepare->resume
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0200', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, RESUME_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0300
* @tc.name : 03.start->resume
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0300', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, RESUME_EVENT, ERROR_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0400
* @tc.name : 04.pause->resume
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0400', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, PAUSE_EVENT,
RESUME_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0500
* @tc.name : 05.stop->resume
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0500', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, STOP_EVENT, CLOSE_STREAM, RESUME_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0600
* @tc.name : 06.reset->resume
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0600', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, RESET_EVENT, CLOSE_STREAM, RESUME_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0700
* @tc.name : 07.getInputSurface->resume
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0700', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, RESUME_EVENT,
ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0800
* @tc.name : 08.resume 3 times
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0800', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, PAUSE_EVENT,
RESUME_EVENT, RESUME_EVENT, ERROR_EVENT, RESUME_EVENT, ERROR_EVENT,
RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0100
* @tc.name : 01.create->stop
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0100', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, STOP_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0200
* @tc.name : 02.prepare->stop
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0200', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, STOP_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0300
* @tc.name : 03.start->stop
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0300', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, STOP_EVENT, CLOSE_STREAM, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0400
* @tc.name : 04.pause->stop
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0400', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, PAUSE_EVENT, STOP_EVENT, CLOSE_STREAM, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0500
* @tc.name : 05.resume->stop
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0500', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, PAUSE_EVENT, RESUME_EVENT,
STOP_EVENT, CLOSE_STREAM, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0600
* @tc.name : 06.reset->stop
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0600', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, RESET_EVENT, STOP_EVENT,
ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0700
* @tc.name : 07.getInputSurface->stop
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0700', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT,
STOP_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0800
* @tc.name : 08.stop 3 times
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0800', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, STOP_EVENT, CLOSE_STREAM, STOP_EVENT, ERROR_EVENT,
STOP_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0100
* @tc.name : 01.create->reset
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0100', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, RESET_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0200
* @tc.name : 02.prepare->reset
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0200', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, RESET_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0300
* @tc.name : 03.start->reset
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0300', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, RESET_EVENT, CLOSE_STREAM, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0400
* @tc.name : 04.pause->reset
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0400', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, PAUSE_EVENT, RESET_EVENT, CLOSE_STREAM, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0500
* @tc.name : 05.resume->reset
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0500', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, PAUSE_EVENT, RESUME_EVENT,
RESET_EVENT, CLOSE_STREAM, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0600
* @tc.name : 06.stop->reset
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0600', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, STOP_EVENT, CLOSE_STREAM, RESET_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0700
* @tc.name : 07.getInputSurface->reset
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0700', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, RESET_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0800
* @tc.name : 08.reset 3 times
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0800', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, RESET_EVENT,
RESET_EVENT, RESET_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0100
* @tc.name : 01.create->getInputSurface
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0100', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, GETSURFACE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0200
* @tc.name : 02.prepare->getInputSurface
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0200', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0300
* @tc.name : 03.start->getInputSurface
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0300', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM, START_EVENT,
GETSURFACE_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0400
* @tc.name : 04.pause->getInputSurface
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0400', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM, START_EVENT,
PAUSE_EVENT, GETSURFACE_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0500
* @tc.name : 05.resume->getInputSurface
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0500', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM, START_EVENT,
PAUSE_EVENT, RESUME_EVENT, GETSURFACE_EVENT,
RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0600
* @tc.name : 06.stop->getInputSurface
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0600', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM, START_EVENT,
STOP_EVENT, CLOSE_STREAM, GETSURFACE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0700
* @tc.name : 07.reset->getInputSurface
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0700', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, RESET_EVENT,
GETSURFACE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0800
* @tc.name : 08.getInputSurface 3 times
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0800', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT,
GETSURFACE_EVENT, GETSURFACE_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
})
}
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0700
* @tc.name : 07.reset->getInputSurface
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0700', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, RESET_EVENT,
GETSURFACE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0800
* @tc.name : 08.getInputSurface 3 times
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0800', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT,
GETSURFACE_EVENT, GETSURFACE_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
})
......@@ -16,65 +16,68 @@
import media from '@ohos.multimedia.media'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
describe('VideoRecorderEnumTest', function () {
beforeAll(function() {
console.info('beforeAll case');
export default function VideoRecorderEnumTest() {
describe('VideoRecorderEnumTest', function () {
beforeAll(function() {
console.info('beforeAll case');
})
beforeEach(function() {
console.info('beforeEach case');
})
afterEach(function() {
console.info('afterEach case');
})
afterAll(function() {
console.info('afterAll case');
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_ENUM_AUDIO_SOURCE_TYPE_0100
* @tc.name : AudioSourceType
* @tc.desc : AudioSourceType Enumeration test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_ENUM_AUDIO_SOURCE_TYPE_0100', 0, async function (done) {
expect(media.AudioSourceType.AUDIO_SOURCE_TYPE_DEFAULT).assertEqual(0);
expect(media.AudioSourceType.AUDIO_SOURCE_TYPE_MIC).assertEqual(1);
done();
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_ENUM_VIDEO_SOURCE_TYPE_0100
* @tc.name : VideoSourceType
* @tc.desc : VideoSourceType Enumeration test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_ENUM_VIDEO_SOURCE_TYPE_0100', 0, async function (done) {
expect(media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_YUV).assertEqual(0);
expect(media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_ES).assertEqual(1);
done();
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_ENUM_CODECMIMETYPE_0100
* @tc.name : CodecMimeType
* @tc.desc : Test Enumerate CodecMimeType
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_ENUM_CODECMIMETYPE_0100', 0, async function (done) {
expect(media.CodecMimeType.VIDEO_H263).assertEqual('video/h263');
expect(media.CodecMimeType.VIDEO_AVC).assertEqual('video/avc');
expect(media.CodecMimeType.VIDEO_MPEG2).assertEqual('video/mpeg2');
expect(media.CodecMimeType.VIDEO_MPEG4).assertEqual('video/mp4v-es');
expect(media.CodecMimeType.VIDEO_VP8).assertEqual('video/x-vnd.on2.vp8');
done();
})
})
}
beforeEach(function() {
console.info('beforeEach case');
})
afterEach(function() {
console.info('afterEach case');
})
afterAll(function() {
console.info('afterAll case');
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_ENUM_AUDIO_SOURCE_TYPE_0100
* @tc.name : AudioSourceType
* @tc.desc : AudioSourceType Enumeration test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_ENUM_AUDIO_SOURCE_TYPE_0100', 0, async function (done) {
expect(media.AudioSourceType.AUDIO_SOURCE_TYPE_DEFAULT).assertEqual(0);
expect(media.AudioSourceType.AUDIO_SOURCE_TYPE_MIC).assertEqual(1);
done();
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_ENUM_VIDEO_SOURCE_TYPE_0100
* @tc.name : VideoSourceType
* @tc.desc : VideoSourceType Enumeration test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_ENUM_VIDEO_SOURCE_TYPE_0100', 0, async function (done) {
expect(media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_YUV).assertEqual(0);
expect(media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_ES).assertEqual(1);
done();
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_ENUM_CODECMIMETYPE_0100
* @tc.name : CodecMimeType
* @tc.desc : Test Enumerate CodecMimeType
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_ENUM_CODECMIMETYPE_0100', 0, async function (done) {
expect(media.CodecMimeType.VIDEO_H263).assertEqual('video/h263');
expect(media.CodecMimeType.VIDEO_AVC).assertEqual('video/avc');
expect(media.CodecMimeType.VIDEO_MPEG2).assertEqual('video/mpeg2');
expect(media.CodecMimeType.VIDEO_MPEG4).assertEqual('video/mp4v-es');
expect(media.CodecMimeType.VIDEO_VP8).assertEqual('video/x-vnd.on2.vp8');
done();
})
})
\ No newline at end of file
......@@ -19,826 +19,830 @@ import * as mediaTestBase from '../../../../../MediaTestBase.js';
import * as videoRecorderBase from '../../../../../VideoRecorderTestBase.js';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
describe('VideoRecorderFuncCallbackTest', function () {
const RECORDER_TIME = 3000;
const PAUSE_TIME = 1000;
const END_EVENT = 'end';
const CREATE_EVENT = 'create';
const PREPARE_EVENT = 'prepare';
const PREPARE_OLNYVIDEO_EVENT = 'prepare_only';
const GETSURFACE_EVENT = 'getInputSurface';
const START_EVENT = 'start';
const PAUSE_EVENT = 'pause';
const RESUME_EVENT = 'resume';
const STOP_EVENT = 'stop';
const RESET_EVENT = 'reset';
const RELEASE_EVENT = 'release';
const CHECK_EVENT = "check";
const ONLYVIDEO_TYPE = 'only_video';
const AUDIO_VIDEO_TYPE = 'audio_video';
const pagePath1 = 'pages/surfaceTest/surfaceTest';
const pagePath2 = 'pages/surfaceTest2/surfaceTest2';
let cameraManager;
let cameras;
let captureSession;
let videoOutput;
let surfaceID;
let playerSurfaceId = '';
let fdPath;
let fdObject;
let cameraID = 0;
let pageId = 0;
let videoProfiles;
let previewProfiles;
let previewOutput;
let configFile = {
audioBitrate : 48000,
audioChannels : 2,
audioCodec : media.CodecMimeType.AUDIO_AAC,
audioSampleRate : 48000,
durationTime : 1000,
fileFormat : media.ContainerFormatType.CFT_MPEG_4,
videoBitrate : 48000,
videoCodec : media.CodecMimeType.VIDEO_MPEG4,
videoFrameWidth : 640,
videoFrameHeight : 480,
videoFrameRate : 10
}
// rotation 0, 90, 180, 270
let videoConfig = {
audioSourceType : media.AudioSourceType.AUDIO_SOURCE_TYPE_MIC,
videoSourceType : media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_YUV,
profile : configFile,
url : 'fd://',
rotation : 0,
location : { latitude : 30, longitude : 130 },
maxSize : 100,
maxDuration : 500
}
let onlyVideoProfile = {
durationTime : 1000,
fileFormat : media.ContainerFormatType.CFT_MPEG_4,
videoBitrate : 48000,
videoCodec : media.CodecMimeType.VIDEO_MPEG4,
videoFrameWidth : 640,
videoFrameHeight : 480,
videoFrameRate : 10
}
let onlyVideoConfig = {
videoSourceType : media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_YUV,
profile : onlyVideoProfile,
url : 'fd://',
rotation : 0,
location : { latitude : 30, longitude : 130 },
maxSize : 100,
maxDuration : 500
}
beforeAll(async function () {
cameraManager = await camera.getCameraManager(null);
if (cameraManager != null) {
console.info('[camera] case getCameraManager success');
} else {
console.info('[camera] case getCameraManager failed');
return;
export default function VideoRecorderFuncCallbackTest() {
describe('VideoRecorderFuncCallbackTest', function () {
const RECORDER_TIME = 3000;
const PAUSE_TIME = 1000;
const END_EVENT = 'end';
const CREATE_EVENT = 'create';
const PREPARE_EVENT = 'prepare';
const PREPARE_OLNYVIDEO_EVENT = 'prepare_only';
const GETSURFACE_EVENT = 'getInputSurface';
const START_EVENT = 'start';
const PAUSE_EVENT = 'pause';
const RESUME_EVENT = 'resume';
const STOP_EVENT = 'stop';
const RESET_EVENT = 'reset';
const RELEASE_EVENT = 'release';
const CHECK_EVENT = "check";
const ONLYVIDEO_TYPE = 'only_video';
const AUDIO_VIDEO_TYPE = 'audio_video';
const pagePath1 = 'pages/surfaceTest/surfaceTest';
const pagePath2 = 'pages/surfaceTest2/surfaceTest2';
let cameraManager;
let cameras;
let captureSession;
let videoOutput;
let surfaceID;
let playerSurfaceId = '';
let fdPath;
let fdObject;
let cameraID = 0;
let pageId = 0;
let videoProfiles;
let previewProfiles;
let previewOutput;
let configFile = {
audioBitrate : 48000,
audioChannels : 2,
audioCodec : media.CodecMimeType.AUDIO_AAC,
audioSampleRate : 48000,
durationTime : 1000,
fileFormat : media.ContainerFormatType.CFT_MPEG_4,
videoBitrate : 48000,
videoCodec : media.CodecMimeType.VIDEO_MPEG4,
videoFrameWidth : 640,
videoFrameHeight : 480,
videoFrameRate : 10
}
await cameraManager.getSupportedCameras().then((cameraDevices)=> {
cameras = cameraDevices;
}, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
if (cameras != null) {
console.info('[camera] case getCameras success');
} else {
console.info('[camera] case getCameras failed');
// rotation 0, 90, 180, 270
let videoConfig = {
audioSourceType : media.AudioSourceType.AUDIO_SOURCE_TYPE_MIC,
videoSourceType : media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_YUV,
profile : configFile,
url : 'fd://',
rotation : 0,
location : { latitude : 30, longitude : 130 },
maxSize : 100,
maxDuration : 500
}
await cameraManager.getSupportedOutputCapability(cameras[0]).then((cameraoutputcapability) => {
console.info('[camera] case getSupportedOutputCapability success');
videoProfiles = cameraoutputcapability.videoProfiles;
videoProfiles[0].size.height = 480;
videoProfiles[0].size.width = 640;
previewProfiles = cameraoutputcapability.previewProfiles;
previewProfiles[0].size.height = 480;
previewProfiles[0].size.width = 640;
}, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback)
if (previewProfiles[0].format == camera.CameraFormat.CAMERA_FORMAT_YUV_420_SP) {
console.info('[camera] case format is VIDEO_SOURCE_TYPE_SURFACE_YUV');
videoConfig.videoSourceType = media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_YUV;
} else {
console.info('[camera] case format is VIDEO_SOURCE_TYPE_SURFACE_ES');
videoConfig.videoSourceType = media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_ES;
let onlyVideoProfile = {
durationTime : 1000,
fileFormat : media.ContainerFormatType.CFT_MPEG_4,
videoBitrate : 48000,
videoCodec : media.CodecMimeType.VIDEO_MPEG4,
videoFrameWidth : 640,
videoFrameHeight : 480,
videoFrameRate : 10
}
console.info('beforeAll case');
})
beforeEach(async function () {
await mediaTestBase.toNewPage(pagePath1, pagePath2, pageId);
pageId = (pageId + 1) % 2;
if (previewProfiles[0].format == camera.CameraFormat.CAMERA_FORMAT_YUV_420_SP) {
if (pageId == 0) {
configFile.videoCodec = media.CodecMimeType.VIDEO_MPEG4;
onlyVideoProfile.videoCodec = media.CodecMimeType.VIDEO_MPEG4;
} else {
configFile.videoCodec = media.CodecMimeType.VIDEO_AVC;
onlyVideoProfile.videoCodec = media.CodecMimeType.VIDEO_AVC;
}
} else {
configFile.videoCodec = media.CodecMimeType.VIDEO_MPEG4;
onlyVideoProfile.videoCodec = media.CodecMimeType.VIDEO_MPEG4;
let onlyVideoConfig = {
videoSourceType : media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_YUV,
profile : onlyVideoProfile,
url : 'fd://',
rotation : 0,
location : { latitude : 30, longitude : 130 },
maxSize : 100,
maxDuration : 500
}
await mediaTestBase.msleepAsync(1000).then(
() => {}, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
playerSurfaceId = globalThis.value;
cameraID = 0;
console.info('beforeEach case');
})
afterEach(async function () {
await mediaTestBase.clearRouter();
console.info('afterEach case');
})
afterAll(function () {
console.info('afterAll case');
})
function printfError(error, done) {
expect().assertFail();
console.info(`case error called,errMessage is ${error.message}`);
done();
}
let events = require('events');
let eventEmitter = new events.EventEmitter();
async function toNextStep(videoRecorder, steps, done) {
if (steps[0] == END_EVENT) {
console.info('case success!!');
await mediaTestBase.closeFd(fdObject.fileAsset, fdObject.fdNumber);
done();
} else {
console.info('case toNextStep is ' + steps[0]);
eventEmitter.emit(steps[0], videoRecorder, steps, done);
}
}
function setOnCallback(videoRecorder) {
videoRecorder.on('info', (infoType, extra) => {
console.info('case info called, infoType is ' + infoType);
console.info('case info called, extra is ' + extra);
});
videoRecorder.on('error', (err) => {
console.info('case error called, errMessage is ' + err.message);
expect().assertFail();
});
}
eventEmitter.on(CREATE_EVENT, async (videoRecorder, steps, done) => {
steps.shift();
media.createVideoRecorder((err, recorder) => {
if (typeof (err) == 'undefined') {
console.info('case createVideoRecorder success ');
videoRecorder = recorder;
setOnCallback(videoRecorder);
expect(videoRecorder.state).assertEqual('idle');
toNextStep(videoRecorder, steps, done);
beforeAll(async function () {
cameraManager = await camera.getCameraManager(null);
if (cameraManager != null) {
console.info('[camera] case getCameraManager success');
} else {
printfError(err, done);
console.info('[camera] case getCameraManager failed');
return;
}
});
});
eventEmitter.on(PREPARE_EVENT, async (videoRecorder, steps, done) => {
steps.shift();
videoRecorder.prepare(videoConfig, (err) => {
if (typeof (err) == 'undefined') {
console.info('case prepare success');
expect(videoRecorder.state).assertEqual('prepared');
toNextStep(videoRecorder, steps, done);
await cameraManager.getSupportedCameras().then((cameraDevices)=> {
cameras = cameraDevices;
}, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
if (cameras != null) {
console.info('[camera] case getCameras success');
} else {
printfError(err, done);
console.info('[camera] case getCameras failed');
}
});
});
eventEmitter.on(PREPARE_OLNYVIDEO_EVENT, async (videoRecorder, steps, done) => {
steps.shift();
videoRecorder.prepare(onlyVideoConfig, (err) => {
if (typeof (err) == 'undefined') {
console.info('case prepare success');
expect(videoRecorder.state).assertEqual('prepared');
toNextStep(videoRecorder, steps, done);
await cameraManager.getSupportedOutputCapability(cameras[0]).then((cameraoutputcapability) => {
console.info('[camera] case getSupportedOutputCapability success');
videoProfiles = cameraoutputcapability.videoProfiles;
videoProfiles[0].size.height = 480;
videoProfiles[0].size.width = 640;
previewProfiles = cameraoutputcapability.previewProfiles;
previewProfiles[0].size.height = 480;
previewProfiles[0].size.width = 640;
}, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback)
if (previewProfiles[0].format == camera.CameraFormat.CAMERA_FORMAT_YUV_420_SP) {
console.info('[camera] case format is VIDEO_SOURCE_TYPE_SURFACE_YUV');
videoConfig.videoSourceType = media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_YUV;
} else {
printfError(err, done);
console.info('[camera] case format is VIDEO_SOURCE_TYPE_SURFACE_ES');
videoConfig.videoSourceType = media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_ES;
}
});
});
eventEmitter.on(GETSURFACE_EVENT, async (videoRecorder, steps, done) => {
steps.shift();
videoRecorder.getInputSurface((err, outPutsurface) => {
if (typeof (err) == 'undefined') {
expect(videoRecorder.state).assertEqual('prepared');
surfaceID = outPutsurface;
console.info('case getInputSurface success :' + surfaceID);
toNextStep(videoRecorder, steps, done);
console.info('beforeAll case');
})
beforeEach(async function () {
await mediaTestBase.toNewPage(pagePath1, pagePath2, pageId);
pageId = (pageId + 1) % 2;
if (previewProfiles[0].format == camera.CameraFormat.CAMERA_FORMAT_YUV_420_SP) {
if (pageId == 0) {
configFile.videoCodec = media.CodecMimeType.VIDEO_MPEG4;
onlyVideoProfile.videoCodec = media.CodecMimeType.VIDEO_MPEG4;
} else {
configFile.videoCodec = media.CodecMimeType.VIDEO_AVC;
onlyVideoProfile.videoCodec = media.CodecMimeType.VIDEO_AVC;
}
} else {
printfError(err, done);
configFile.videoCodec = media.CodecMimeType.VIDEO_MPEG4;
onlyVideoProfile.videoCodec = media.CodecMimeType.VIDEO_MPEG4;
}
});
});
eventEmitter.on(START_EVENT, async (videoRecorder, steps, done) => {
steps.shift();
videoOutput = await cameraManager.createVideoOutput(videoProfiles[0], surfaceID);
if (videoOutput == null) {
console.info('case createVideoOutput failed');
} else {
console.info('case createVideoOutput success');
await mediaTestBase.msleepAsync(1000).then(
() => {}, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
playerSurfaceId = globalThis.value;
cameraID = 0;
console.info('beforeEach case');
})
afterEach(async function () {
await mediaTestBase.clearRouter();
console.info('afterEach case');
})
afterAll(function () {
console.info('afterAll case');
})
function printfError(error, done) {
expect().assertFail();
console.info(`case error called,errMessage is ${error.message}`);
done();
}
previewOutput = await cameraManager.createPreviewOutput(previewProfiles[0], playerSurfaceId)
captureSession = await videoRecorderBase.initCaptureSession(videoOutput, cameraManager,
cameras[0], previewOutput);
await videoOutput.start().then(() => {
console.info('case videoOutput start success');
});
videoRecorder.start((err) => {
if (typeof (err) == 'undefined') {
console.info('case start success');
expect(videoRecorder.state).assertEqual('playing');
mediaTestBase.msleep(RECORDER_TIME);
toNextStep(videoRecorder, steps, done);
let events = require('events');
let eventEmitter = new events.EventEmitter();
async function toNextStep(videoRecorder, steps, done) {
if (steps[0] == END_EVENT) {
console.info('case success!!');
await mediaTestBase.closeFd(fdObject.fileAsset, fdObject.fdNumber);
done();
} else {
printfError(err, done);
console.info('case toNextStep is ' + steps[0]);
eventEmitter.emit(steps[0], videoRecorder, steps, done);
}
}
function setOnCallback(videoRecorder) {
videoRecorder.on('info', (infoType, extra) => {
console.info('case info called, infoType is ' + infoType);
console.info('case info called, extra is ' + extra);
});
videoRecorder.on('error', (err) => {
console.info('case error called, errMessage is ' + err.message);
expect().assertFail();
});
}
eventEmitter.on(CREATE_EVENT, async (videoRecorder, steps, done) => {
steps.shift();
media.createVideoRecorder((err, recorder) => {
if (typeof (err) == 'undefined') {
console.info('case createVideoRecorder success ');
videoRecorder = recorder;
setOnCallback(videoRecorder);
expect(videoRecorder.state).assertEqual('idle');
toNextStep(videoRecorder, steps, done);
} else {
printfError(err, done);
}
});
});
});
eventEmitter.on(PAUSE_EVENT, async (videoRecorder, steps, done) => {
steps.shift();
videoRecorder.pause((err) => {
if (typeof (err) == 'undefined') {
console.info('case pause success');
expect(videoRecorder.state).assertEqual('paused');
mediaTestBase.msleep(PAUSE_TIME);
toNextStep(videoRecorder, steps, done);
} else {
printfError(err, done);
}
eventEmitter.on(PREPARE_EVENT, async (videoRecorder, steps, done) => {
steps.shift();
videoRecorder.prepare(videoConfig, (err) => {
if (typeof (err) == 'undefined') {
console.info('case prepare success');
expect(videoRecorder.state).assertEqual('prepared');
toNextStep(videoRecorder, steps, done);
} else {
printfError(err, done);
}
});
});
});
eventEmitter.on(RESUME_EVENT, async (videoRecorder, steps, done) => {
steps.shift();
videoRecorder.resume((err) => {
if (typeof (err) == 'undefined') {
console.info('case resume success');
mediaTestBase.msleep(RECORDER_TIME);
expect(videoRecorder.state).assertEqual('playing');
toNextStep(videoRecorder, steps, done);
} else {
printfError(err, done);
}
eventEmitter.on(PREPARE_OLNYVIDEO_EVENT, async (videoRecorder, steps, done) => {
steps.shift();
videoRecorder.prepare(onlyVideoConfig, (err) => {
if (typeof (err) == 'undefined') {
console.info('case prepare success');
expect(videoRecorder.state).assertEqual('prepared');
toNextStep(videoRecorder, steps, done);
} else {
printfError(err, done);
}
});
});
});
eventEmitter.on(STOP_EVENT, async (videoRecorder, steps, done) => {
steps.shift();
videoRecorder.stop((err) => {
if (typeof (err) == 'undefined') {
console.info('case stop success');
expect(videoRecorder.state).assertEqual('stopped');
toNextStep(videoRecorder, steps, done);
} else {
printfError(err, done);
}
eventEmitter.on(GETSURFACE_EVENT, async (videoRecorder, steps, done) => {
steps.shift();
videoRecorder.getInputSurface((err, outPutsurface) => {
if (typeof (err) == 'undefined') {
expect(videoRecorder.state).assertEqual('prepared');
surfaceID = outPutsurface;
console.info('case getInputSurface success :' + surfaceID);
toNextStep(videoRecorder, steps, done);
} else {
printfError(err, done);
}
});
});
});
eventEmitter.on(RESET_EVENT, async (videoRecorder, steps, done) => {
steps.shift();
videoRecorder.reset((err) => {
if (typeof (err) == 'undefined') {
console.info('case reset success');
expect(videoRecorder.state).assertEqual('idle');
toNextStep(videoRecorder, steps, done);
eventEmitter.on(START_EVENT, async (videoRecorder, steps, done) => {
steps.shift();
videoOutput = await cameraManager.createVideoOutput(videoProfiles[0], surfaceID);
if (videoOutput == null) {
console.info('case createVideoOutput failed');
} else {
printfError(err, done);
console.info('case createVideoOutput success');
}
previewOutput = await cameraManager.createPreviewOutput(previewProfiles[0], playerSurfaceId)
captureSession = await videoRecorderBase.initCaptureSession(videoOutput, cameraManager,
cameras[0], previewOutput);
await videoOutput.start().then(() => {
console.info('case videoOutput start success');
});
videoRecorder.start((err) => {
if (typeof (err) == 'undefined') {
console.info('case start success');
expect(videoRecorder.state).assertEqual('playing');
mediaTestBase.msleep(RECORDER_TIME);
toNextStep(videoRecorder, steps, done);
} else {
printfError(err, done);
}
});
});
});
eventEmitter.on(RELEASE_EVENT, async (videoRecorder, steps, done) => {
steps.shift();
videoRecorder.release(async (err) => {
await videoOutput.stop().then(() => {
console.info('case videoOutput stop success');
eventEmitter.on(PAUSE_EVENT, async (videoRecorder, steps, done) => {
steps.shift();
videoRecorder.pause((err) => {
if (typeof (err) == 'undefined') {
console.info('case pause success');
expect(videoRecorder.state).assertEqual('paused');
mediaTestBase.msleep(PAUSE_TIME);
toNextStep(videoRecorder, steps, done);
} else {
printfError(err, done);
}
});
await videoRecorderBase.stopCaptureSession(captureSession);
if (typeof (err) == 'undefined') {
expect(videoRecorder.state).assertEqual('idle');
console.info('case release success');
toNextStep(videoRecorder, steps, done);
} else {
printfError(err, done);
}
});
});
eventEmitter.on(CHECK_EVENT, async (videoRecorder, steps, done) => {
steps.shift();
let trackArray = steps[0];
let recorderTime = steps[1];
steps.shift();
steps.shift();
await videoRecorderBase.checkVideos(fdPath, recorderTime, trackArray, playerSurfaceId);
toNextStep(videoRecorder, steps, done);
});
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0100
* @tc.name : 01.start->release (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0100', 0, async function (done) {
fdObject = await mediaTestBase.getFd('recorder_callback_01.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
videoConfig.url = fdPath;
let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT, RELEASE_EVENT, CHECK_EVENT,
trackArray, RECORDER_TIME, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0200
* @tc.name : 02.start->pause->release (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0200', 0, async function (done) {
fdObject = await mediaTestBase.getFd('recorder_callback_02.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
videoConfig.url = fdPath;
let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT,
PAUSE_EVENT, RELEASE_EVENT, CHECK_EVENT,
trackArray, RECORDER_TIME, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0300
* @tc.name : 03.start->pause->resume->release (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0300', 0, async function (done) {
fdObject = await mediaTestBase.getFd('recorder_callback_03.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
videoConfig.url = fdPath;
let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT,
PAUSE_EVENT, RESUME_EVENT, RELEASE_EVENT, CHECK_EVENT,
trackArray, RECORDER_TIME * 2, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0400
* @tc.name : 04.start->stop->release (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0400', 0, async function (done) {
fdObject = await mediaTestBase.getFd('recorder_callback_04.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
videoConfig.url = fdPath;
let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT,
STOP_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0500
* @tc.name : 05.start->reset->release (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0500', 0, async function (done) {
fdObject = await mediaTestBase.getFd('recorder_callback_05.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
videoConfig.url = fdPath;
let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT,
RESET_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0600
* @tc.name : 06.start->pause->stop->release (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0600', 0, async function (done) {
fdObject = await mediaTestBase.getFd('recorder_callback_06.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
videoConfig.url = fdPath;
let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT, PAUSE_EVENT,
STOP_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0700
* @tc.name : 07.start->pause->reset->release (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0700', 0, async function (done) {
fdObject = await mediaTestBase.getFd('recorder_callback_07.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
videoConfig.url = fdPath;
let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT, PAUSE_EVENT,
RESET_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0800
* @tc.name : 08.start->pause->resume->stop->release (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0800', 0, async function (done) {
fdObject = await mediaTestBase.getFd('recorder_callback_08.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
videoConfig.url = fdPath;
let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT, PAUSE_EVENT,
RESUME_EVENT, STOP_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME * 2, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0900
* @tc.name : 09.start->pause->resume->reset->release (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0900', 0, async function (done) {
fdObject = await mediaTestBase.getFd('recorder_callback_09.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
videoConfig.url = fdPath;
let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT, PAUSE_EVENT,
RESUME_EVENT, RESET_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME * 2, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1000
* @tc.name : 10.start->stop->release
* (audioBitrate 8000,audioSampleRate 8000,videoBitrateRange 8000)(promise)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1000', 0, async function (done) {
configFile.audioBitrate = 8000;
configFile.audioSampleRate = 8000;
configFile.videoBitrate = 8000;
fdObject = await mediaTestBase.getFd('recorder_callback_10.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
videoConfig.url = fdPath;
let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT,
STOP_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1100
* @tc.name : 11.start->stop->release
* (audioBitrate 16000, audioSampleRate 32000, videoBitrateRange 16000)(callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1100', 0, async function (done) {
configFile.audioBitrate = 16000;
configFile.audioSampleRate = 32000;
configFile.videoBitrate = 16000;
fdObject = await mediaTestBase.getFd('recorder_callback_11.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
videoConfig.url = fdPath;
let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT,
STOP_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1200
* @tc.name : 12.start->stop->release
* (audioBitrate 32000, audioSampleRate 44100, videoBitrateRange 32000)(callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1200', 0, async function (done) {
configFile.audioBitrate = 32000;
configFile.audioSampleRate = 44100;
configFile.videoBitrate = 32000;
fdObject = await mediaTestBase.getFd('recorder_callback_12.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
videoConfig.url = fdPath;
let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT,
STOP_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1300
* @tc.name : 13.start->stop->release
* (audioBitrate 112000, audioSampleRate 96000, videoBitrateRange 112000)(callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1300', 0, async function (done) {
configFile.audioBitrate = 112000;
configFile.audioSampleRate = 96000;
configFile.videoBitrate = 112000;
fdObject = await mediaTestBase.getFd('recorder_callback_13.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
videoConfig.url = fdPath;
let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT,
STOP_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1400
* @tc.name : 14.start->release (only video) (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1400', 0, async function (done) {
fdObject = await mediaTestBase.getFd('recorder_callback_14.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
onlyVideoConfig.url = fdPath;
let trackArray = videoRecorderBase.getTrackArray(ONLYVIDEO_TYPE, onlyVideoProfile,
onlyVideoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_OLNYVIDEO_EVENT, GETSURFACE_EVENT,
START_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1500
* @tc.name : 15.start->pause->release (only video) (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1500', 0, async function (done) {
fdObject = await mediaTestBase.getFd('recorder_callback_15.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
onlyVideoConfig.url = fdPath;
let trackArray = videoRecorderBase.getTrackArray(ONLYVIDEO_TYPE, onlyVideoProfile,
onlyVideoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_OLNYVIDEO_EVENT, GETSURFACE_EVENT, START_EVENT,
PAUSE_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1600
* @tc.name : 16.start->pause->resume->releas (only video) (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1600', 0, async function (done) {
fdObject = await mediaTestBase.getFd('recorder_callback_16.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
onlyVideoConfig.url = fdPath;
let trackArray = videoRecorderBase.getTrackArray(ONLYVIDEO_TYPE, onlyVideoProfile,
onlyVideoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_OLNYVIDEO_EVENT, GETSURFACE_EVENT, START_EVENT,
PAUSE_EVENT, RESUME_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME * 2, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1700
* @tc.name : 17.start->stop->release (only video) (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1700', 0, async function (done) {
fdObject = await mediaTestBase.getFd('recorder_callback_17.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
onlyVideoConfig.url = fdPath;
let trackArray = videoRecorderBase.getTrackArray(ONLYVIDEO_TYPE, onlyVideoProfile,
onlyVideoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_OLNYVIDEO_EVENT, GETSURFACE_EVENT, START_EVENT,
STOP_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1800
* @tc.name : 18.start->reset->release (only video) (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1800', 0, async function (done) {
fdObject = await mediaTestBase.getFd('recorder_callback_18.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
onlyVideoConfig.url = fdPath;
let trackArray = videoRecorderBase.getTrackArray(ONLYVIDEO_TYPE, onlyVideoProfile,
onlyVideoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_OLNYVIDEO_EVENT, GETSURFACE_EVENT, START_EVENT,
RESET_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1900
* @tc.name : 19.rotation 90 (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level1
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1900', 0, async function (done) {
fdObject = await mediaTestBase.getFd('recorder_callback_19.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
videoConfig.url = fdPath;
configFile.audioSampleRate = 48000;
videoConfig.rotation = 90;
let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT,
START_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2000
* @tc.name : 20.rotation 180 (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level1
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2000', 0, async function (done) {
fdObject = await mediaTestBase.getFd('recorder_callback_20.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
videoConfig.url = fdPath;
videoConfig.rotation = 180;
let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT, RELEASE_EVENT,
CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2100
* @tc.name : 21.rotation 270 (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level1
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2100', 0, async function (done) {
fdObject = await mediaTestBase.getFd('recorder_callback_21.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
videoConfig.url = fdPath;
videoConfig.rotation = 270;
let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT, RELEASE_EVENT,
CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2200
* @tc.name : 22.videoFrameRate 20 (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level1
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2200', 0, async function (done) {
fdObject = await mediaTestBase.getFd('recorder_callback_22.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
videoConfig.url = fdPath;
configFile.videoFrameRate = 20;
let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT, RELEASE_EVENT,
CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
eventEmitter.on(RESUME_EVENT, async (videoRecorder, steps, done) => {
steps.shift();
videoRecorder.resume((err) => {
if (typeof (err) == 'undefined') {
console.info('case resume success');
mediaTestBase.msleep(RECORDER_TIME);
expect(videoRecorder.state).assertEqual('playing');
toNextStep(videoRecorder, steps, done);
} else {
printfError(err, done);
}
});
});
eventEmitter.on(STOP_EVENT, async (videoRecorder, steps, done) => {
steps.shift();
videoRecorder.stop((err) => {
if (typeof (err) == 'undefined') {
console.info('case stop success');
expect(videoRecorder.state).assertEqual('stopped');
toNextStep(videoRecorder, steps, done);
} else {
printfError(err, done);
}
});
});
eventEmitter.on(RESET_EVENT, async (videoRecorder, steps, done) => {
steps.shift();
videoRecorder.reset((err) => {
if (typeof (err) == 'undefined') {
console.info('case reset success');
expect(videoRecorder.state).assertEqual('idle');
toNextStep(videoRecorder, steps, done);
} else {
printfError(err, done);
}
});
});
eventEmitter.on(RELEASE_EVENT, async (videoRecorder, steps, done) => {
steps.shift();
videoRecorder.release(async (err) => {
await videoOutput.stop().then(() => {
console.info('case videoOutput stop success');
});
await videoRecorderBase.stopCaptureSession(captureSession);
if (typeof (err) == 'undefined') {
expect(videoRecorder.state).assertEqual('idle');
console.info('case release success');
toNextStep(videoRecorder, steps, done);
} else {
printfError(err, done);
}
});
});
eventEmitter.on(CHECK_EVENT, async (videoRecorder, steps, done) => {
steps.shift();
let trackArray = steps[0];
let recorderTime = steps[1];
steps.shift();
steps.shift();
await videoRecorderBase.checkVideos(fdPath, recorderTime, trackArray, playerSurfaceId);
toNextStep(videoRecorder, steps, done);
});
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0100
* @tc.name : 01.start->release (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0100', 0, async function (done) {
fdObject = await mediaTestBase.getFd('recorder_callback_01.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
videoConfig.url = fdPath;
let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT, RELEASE_EVENT, CHECK_EVENT,
trackArray, RECORDER_TIME, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0200
* @tc.name : 02.start->pause->release (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0200', 0, async function (done) {
fdObject = await mediaTestBase.getFd('recorder_callback_02.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
videoConfig.url = fdPath;
let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT,
PAUSE_EVENT, RELEASE_EVENT, CHECK_EVENT,
trackArray, RECORDER_TIME, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0300
* @tc.name : 03.start->pause->resume->release (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0300', 0, async function (done) {
fdObject = await mediaTestBase.getFd('recorder_callback_03.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
videoConfig.url = fdPath;
let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT,
PAUSE_EVENT, RESUME_EVENT, RELEASE_EVENT, CHECK_EVENT,
trackArray, RECORDER_TIME * 2, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0400
* @tc.name : 04.start->stop->release (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0400', 0, async function (done) {
fdObject = await mediaTestBase.getFd('recorder_callback_04.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
videoConfig.url = fdPath;
let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT,
STOP_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0500
* @tc.name : 05.start->reset->release (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0500', 0, async function (done) {
fdObject = await mediaTestBase.getFd('recorder_callback_05.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
videoConfig.url = fdPath;
let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT,
RESET_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0600
* @tc.name : 06.start->pause->stop->release (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0600', 0, async function (done) {
fdObject = await mediaTestBase.getFd('recorder_callback_06.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
videoConfig.url = fdPath;
let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT, PAUSE_EVENT,
STOP_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0700
* @tc.name : 07.start->pause->reset->release (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0700', 0, async function (done) {
fdObject = await mediaTestBase.getFd('recorder_callback_07.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
videoConfig.url = fdPath;
let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT, PAUSE_EVENT,
RESET_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0800
* @tc.name : 08.start->pause->resume->stop->release (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0800', 0, async function (done) {
fdObject = await mediaTestBase.getFd('recorder_callback_08.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
videoConfig.url = fdPath;
let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT, PAUSE_EVENT,
RESUME_EVENT, STOP_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME * 2, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0900
* @tc.name : 09.start->pause->resume->reset->release (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0900', 0, async function (done) {
fdObject = await mediaTestBase.getFd('recorder_callback_09.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
videoConfig.url = fdPath;
let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT, PAUSE_EVENT,
RESUME_EVENT, RESET_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME * 2, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1000
* @tc.name : 10.start->stop->release
* (audioBitrate 8000,audioSampleRate 8000,videoBitrateRange 8000)(promise)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1000', 0, async function (done) {
configFile.audioBitrate = 8000;
configFile.audioSampleRate = 8000;
configFile.videoBitrate = 8000;
fdObject = await mediaTestBase.getFd('recorder_callback_10.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
videoConfig.url = fdPath;
let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT,
STOP_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1100
* @tc.name : 11.start->stop->release
* (audioBitrate 16000, audioSampleRate 32000, videoBitrateRange 16000)(callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1100', 0, async function (done) {
configFile.audioBitrate = 16000;
configFile.audioSampleRate = 32000;
configFile.videoBitrate = 16000;
fdObject = await mediaTestBase.getFd('recorder_callback_11.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
videoConfig.url = fdPath;
let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT,
STOP_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1200
* @tc.name : 12.start->stop->release
* (audioBitrate 32000, audioSampleRate 44100, videoBitrateRange 32000)(callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1200', 0, async function (done) {
configFile.audioBitrate = 32000;
configFile.audioSampleRate = 44100;
configFile.videoBitrate = 32000;
fdObject = await mediaTestBase.getFd('recorder_callback_12.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
videoConfig.url = fdPath;
let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT,
STOP_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1300
* @tc.name : 13.start->stop->release
* (audioBitrate 112000, audioSampleRate 96000, videoBitrateRange 112000)(callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1300', 0, async function (done) {
configFile.audioBitrate = 112000;
configFile.audioSampleRate = 96000;
configFile.videoBitrate = 112000;
fdObject = await mediaTestBase.getFd('recorder_callback_13.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
videoConfig.url = fdPath;
let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT,
STOP_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1400
* @tc.name : 14.start->release (only video) (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1400', 0, async function (done) {
fdObject = await mediaTestBase.getFd('recorder_callback_14.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
onlyVideoConfig.url = fdPath;
let trackArray = videoRecorderBase.getTrackArray(ONLYVIDEO_TYPE, onlyVideoProfile,
onlyVideoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_OLNYVIDEO_EVENT, GETSURFACE_EVENT,
START_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1500
* @tc.name : 15.start->pause->release (only video) (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1500', 0, async function (done) {
fdObject = await mediaTestBase.getFd('recorder_callback_15.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
onlyVideoConfig.url = fdPath;
let trackArray = videoRecorderBase.getTrackArray(ONLYVIDEO_TYPE, onlyVideoProfile,
onlyVideoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_OLNYVIDEO_EVENT, GETSURFACE_EVENT, START_EVENT,
PAUSE_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1600
* @tc.name : 16.start->pause->resume->releas (only video) (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1600', 0, async function (done) {
fdObject = await mediaTestBase.getFd('recorder_callback_16.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
onlyVideoConfig.url = fdPath;
let trackArray = videoRecorderBase.getTrackArray(ONLYVIDEO_TYPE, onlyVideoProfile,
onlyVideoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_OLNYVIDEO_EVENT, GETSURFACE_EVENT, START_EVENT,
PAUSE_EVENT, RESUME_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME * 2, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1700
* @tc.name : 17.start->stop->release (only video) (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1700', 0, async function (done) {
fdObject = await mediaTestBase.getFd('recorder_callback_17.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
onlyVideoConfig.url = fdPath;
let trackArray = videoRecorderBase.getTrackArray(ONLYVIDEO_TYPE, onlyVideoProfile,
onlyVideoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_OLNYVIDEO_EVENT, GETSURFACE_EVENT, START_EVENT,
STOP_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1800
* @tc.name : 18.start->reset->release (only video) (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1800', 0, async function (done) {
fdObject = await mediaTestBase.getFd('recorder_callback_18.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
onlyVideoConfig.url = fdPath;
let trackArray = videoRecorderBase.getTrackArray(ONLYVIDEO_TYPE, onlyVideoProfile,
onlyVideoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_OLNYVIDEO_EVENT, GETSURFACE_EVENT, START_EVENT,
RESET_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1900
* @tc.name : 19.rotation 90 (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level1
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1900', 0, async function (done) {
fdObject = await mediaTestBase.getFd('recorder_callback_19.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
videoConfig.url = fdPath;
configFile.audioSampleRate = 48000;
videoConfig.rotation = 90;
let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT,
START_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2000
* @tc.name : 20.rotation 180 (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level1
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2000', 0, async function (done) {
fdObject = await mediaTestBase.getFd('recorder_callback_20.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
videoConfig.url = fdPath;
videoConfig.rotation = 180;
let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT, RELEASE_EVENT,
CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2100
* @tc.name : 21.rotation 270 (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level1
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2100', 0, async function (done) {
fdObject = await mediaTestBase.getFd('recorder_callback_21.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
videoConfig.url = fdPath;
videoConfig.rotation = 270;
let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT, RELEASE_EVENT,
CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2200
* @tc.name : 22.videoFrameRate 20 (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level1
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2200', 0, async function (done) {
fdObject = await mediaTestBase.getFd('recorder_callback_22.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
videoConfig.url = fdPath;
configFile.videoFrameRate = 20;
let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT, RELEASE_EVENT,
CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2300
* @tc.name : 23.videoFrameRate 30 (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level1
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2300', 0, async function (done) {
fdObject = await mediaTestBase.getFd('recorder_callback_23.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
videoConfig.url = fdPath;
configFile.videoFrameRate = 30;
let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT, RELEASE_EVENT,
CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2400
* @tc.name : 24.videoFrameRate 60 (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level1
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2400', 0, async function (done) {
fdObject = await mediaTestBase.getFd('recorder_callback_24.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
videoConfig.url = fdPath;
configFile.videoFrameRate = 60;
let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT, RELEASE_EVENT,
CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
})
}
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2300
* @tc.name : 23.videoFrameRate 30 (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level1
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2300', 0, async function (done) {
fdObject = await mediaTestBase.getFd('recorder_callback_23.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
videoConfig.url = fdPath;
configFile.videoFrameRate = 30;
let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT, RELEASE_EVENT,
CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2400
* @tc.name : 24.videoFrameRate 60 (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level1
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2400', 0, async function (done) {
fdObject = await mediaTestBase.getFd('recorder_callback_24.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
videoConfig.url = fdPath;
configFile.videoFrameRate = 60;
let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT, RELEASE_EVENT,
CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
})
......@@ -19,6 +19,7 @@ import * as mediaTestBase from '../../../../../MediaTestBase.js';
import * as videoRecorderBase from '../../../../../VideoRecorderTestBase.js';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
export default function VideoRecorderFuncPromiseTest() {
describe('VideoRecorderFuncPromiseTest', function () {
const RECORDER_TIME = 3000;
const PAUSE_TIME = 1000;
......@@ -82,6 +83,15 @@ describe('VideoRecorderFuncPromiseTest', function () {
}
beforeAll(async function () {
let permissionName1 = 'ohos.permission.MICROPHONE';
let permissionName2 = 'ohos.permission.MEDIA_LOCATION';
let permissionName3 = 'ohos.permission.READ_MEDIA';
let permissionName4 = 'ohos.permission.WRITE_MEDIA';
let permissionName5 = 'ohos.permission.CAMERA';
let permissionNames = [permissionName1, permissionName2, permissionName3, permissionName4, permissionName5];
await mediaTestBase.getPermission(permissionNames);
await mediaTestBase.msleepAsync(2000);
await mediaTestBase.driveFn(3);
cameraManager = await camera.getCameraManager(null);
if (cameraManager != null) {
console.info('[camera] case getCameraManager success');
......@@ -149,26 +159,6 @@ describe('VideoRecorderFuncPromiseTest', function () {
console.info('afterAll case');
})
function checkErrorCode(errorCode)
{
let value = false;
switch (errorCode) {
case 0:
case 201:
case 401:
case 801:
case 5400101:
case 5400102:
case 5400103:
case 5400104:
case 5400105:
case 5400106:
value = true;
break;
}
return value;
}
async function startVideoOutput(videoOutPut) {
if (videoOutPut == null) {
console.info('[camera] case videoOutPut is null');
......@@ -1737,115 +1727,6 @@ describe('VideoRecorderFuncPromiseTest', function () {
await mediaTestBase.closeFd(fdObject.fileAsset, fdObject.fdNumber);
done();
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_ERRORCODE
* @tc.name : 25.error code (promise)
* @tc.desc : Video recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_ERRORCODE', 0, async function (done) {
let videoRecorder = undefined;
let surfaceID = '';
let videoOutput;
let previewOutput;
let errorCode = false;
fdObject = await mediaTestBase.getFd('recorder_promise_25.mp4');
fdPath = "fd://" + fdObject.fdNumber.toString();
videoConfig.url = '';
await media.createVideoRecorder().then((recorder) => {
console.info('case createVideoRecorder called');
if (typeof (recorder) != 'undefined') {
videoRecorder = recorder;
expect(videoRecorder.state).assertEqual('idle');
} else {
console.info('case recordr is undefined!!');
}
}, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
videoRecorder.on('error', (err) => {
console.info('case on error called, errMessage is ' + err.code);
errorCode = checkErrorCode(err.code);
expect(errorCode).assertEqual(true);
});
await videoRecorder.prepare(videoConfig).then(() => {
console.info('case recordr prepare called');
expect(videoRecorder.state).assertEqual('prepared');
}, (err) => {
console.info('case promise error called, errMessage is ' + err.code);
errorCode = checkErrorCode(err.code);
expect(errorCode).assertEqual(true);
}).catch(mediaTestBase.catchCallback);
await videoRecorder.reset().then(() => {
console.info('case recordr reset called');
expect(videoRecorder.state).assertEqual('idle');
}, (err) => {
console.info('case promise error called, errMessage is ' + err.code);
errorCode = checkErrorCode(err.code);
expect(errorCode).assertEqual(true);
}).catch(mediaTestBase.catchCallback);
videoConfig.url = fdPath;
await videoRecorder.prepare(videoConfig).then(() => {
console.info('case recordr prepare called');
expect(videoRecorder.state).assertEqual('prepared');
}, (err) => {
expect(videoRecorder.state).assertEqual('error');
console.info('case promise error called, errMessage is ' + err.code);
expect().assertFail();
}).catch(mediaTestBase.catchCallback);
await videoRecorder.getInputSurface().then((outPutSurface) => {
console.info('case getInputSurface called');
expect(videoRecorder.state).assertEqual('prepared');
surfaceID = outPutSurface;
}, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
videoOutput = await cameraManager.createVideoOutput(videoProfiles[0], surfaceID);
previewOutput = await cameraManager.createPreviewOutput(previewProfiles[0], playerSurfaceId)
captureSession = await videoRecorderBase.initCaptureSession(videoOutput, cameraManager,
cameras[0], previewOutput);
await startVideoOutput(videoOutput);
await videoRecorder.start().then(() => {
console.info('case recordr play called');
expect(videoRecorder.state).assertEqual('playing');
}, (err) => {
console.info('case promise error called, errMessage is ' + err.code);
expect().assertFail();
}).catch(mediaTestBase.catchCallback);
await videoRecorder.start().then(() => {
console.info('case recordr start called');
}, (err) => {
console.info('case promise error called, errMessage is ' + err.code);
errorCode = checkErrorCode(err.code);
expect(errorCode).assertEqual(true);
}).catch(mediaTestBase.catchCallback);
await videoRecorder.prepare(videoConfig).then(() => {
console.info('case recordr prepare called');
}, (err) => {
console.info('case promise error called, errMessage is ' + err.code);
errorCode = checkErrorCode(err.code);
expect(errorCode).assertEqual(true);
}).catch(mediaTestBase.catchCallback);
await videoRecorder.release().then(() => {
console.info('case release ');
expect(videoRecorder.state).assertEqual('idle');
}, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
await videoOutput.stop();
await videoRecorderBase.stopCaptureSession(captureSession);
await mediaTestBase.closeFd(fdObject.fileAsset, fdObject.fdNumber);
await videoRecorder.prepare(videoConfig).then(() => {
console.info('case recordr prepare called');
}, (err) => {
console.info('case promise error called, errMessage is ' + err.code);
errorCode = checkErrorCode(err.code);
expect(errorCode).assertEqual(true);
}).catch(mediaTestBase.catchCallback);
done();
})
})
}
{
"string": [
{
"name": "entry_MainAbility",
"value": "entry_MainAbility"
},
{
"name": "mainability_description",
"value": "JS_Empty Ability"
}
]
{
"string": [
{
"name": "entry_MainAbility",
"value": "entry_MainAbility"
},
{
"name": "mainability_description",
"value": "JS_Empty Ability"
},
{
"name": "MainAbility_desc",
"value": "description"
},
{
"name": "MainAbility_label",
"value": "label"
},
{
"name": "TestAbility_desc",
"value": "description"
},
{
"name": "TestAbility_label",
"value": "label"
}
]
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册