提交 2e326e93 编写于 作者: T tianfenxia

tianfenxia1@huawei.com

Signed-off-by: Ntianfenxia <tianfenxia1@huawei.com>
上级 02c8ccdf
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"description": "Configuration for audio manager Tests", "description": "Configuration for audio manager Tests",
"driver": { "driver": {
"type": "JSUnitTest", "type": "JSUnitTest",
"test-timeout": "4800000", "test-timeout": "200000",
"package": "ohos.acts.multimedia.audio.audiomanager", "package": "ohos.acts.multimedia.audio.audiomanager",
"shell-timeout": "60000" "shell-timeout": "60000"
}, },
......
{ {
"app": { "app": {
"bundleName": "ohos.acts.multimedia.audio.audiomanager",
"vendor": "acts",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": { "apiVersion": {
"compatible": 6, "compatible": 6,
"target": 5 "releaseType": "Beta1",
} "target": 7
},
"vendor": "acts",
"bundleName": "ohos.acts.multimedia.audio.audiomanager",
"version": {
"code": 1000000,
"name": "1.0.0"
}
},
"deviceConfig": {
"default": {
"debug": true
}
}, },
"deviceConfig": {},
"module": { "module": {
"package": "ohos.acts.multimedia.audio.audiomanager", "abilities": [
"name": ".MyApplication",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry"
},
"abilities": [
{
"skills": [
{ {
"entities": [ "iconId": 16777218,
"entity.system.home" "skills": [
], {
"actions": [ "entities": [
"action.system.home" "entity.system.home"
] ],
"actions": [
"action.system.home"
]
}
],
"descriptionId": 16777217,
"visible": true,
"labelId": 16777216,
"icon": "$media:icon",
"name": "ohos.acts.multimedia.audio.audiomanager.MainAbility",
"description": "$string:mainability_description",
"label": "$string:entry_MainAbility",
"type": "page",
"homeAbility": true,
"launchType": "standard"
} }
], ],
"visible": true, "deviceType": [
"name": "ohos.acts.multimedia.audio.audiomanager.MainAbility", "phone",
"icon": "$media:icon", "tablet",
"description": "$string:mainability_description", "tv",
"label": "$string:entry_MainAbility", "wearable"
"type": "page", ],
"launchType": "standard" "mainAbility": "ohos.acts.multimedia.audio.audiomanager.MainAbility",
} "distro": {
], "moduleType": "entry",
"js": [ "installationFree": false,
{ "deliveryWithInstall": true,
"pages": [ "moduleName": "entry"
"pages/index/index" },
], "package": "ohos.acts.multimedia.audio.audiomanager",
"name": "default", "name": ".MyApplication",
"window": { "js": [
"designWidth": 720, {
"autoDesignWidth": true "pages": [
} "pages/index/index"
} ],
] "name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": true
}
}
]
} }
} }
\ No newline at end of file
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ohos.acts.multimedia.audio.audioplayer;
import ohos.ace.ability.AceAbility;
import ohos.aafwk.content.Intent;
/*
* java MainAbility
*/
public class MainAbility extends AceAbility {
@Override
public void onStart(Intent intent) {
super.onStart(intent);
}
@Override
public void onStop() {
super.onStop();
}
}
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ohos.acts.multimedia.audio.audioplayer;
import ohos.aafwk.ability.AbilityPackage;
/*
* java MyApplication
*/
public class MyApplication extends AbilityPackage {
@Override
public void onInitialize() {
super.onInitialize();
}
}
...@@ -13,8 +13,5 @@ ...@@ -13,8 +13,5 @@
* limitations under the License. * limitations under the License.
*/ */
// require('./AudioPerf.test.js')
require('./AudioFramework.test.js') require('./AudioFramework.test.js')
//require('./AudioFramework.test-Gitee.js')
//require('./AudioCapturer.test.js')
//require('./AudioRenderer.test.js')
\ No newline at end of file
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
"description": "Configuration for audioPlayer Tests", "description": "Configuration for audioPlayer Tests",
"driver": { "driver": {
"type": "JSUnitTest", "type": "JSUnitTest",
"test-timeout": "3000000", "test-timeout": "2000000",
"package": "ohos.acts.multimedia.audio.audioplayer", "package": "ohos.acts.multimedia.audio.audioplayer",
"shell-timeout": "60000" "shell-timeout": "60000"
}, },
"kits": [ "kits": [
{ {
...@@ -12,40 +12,33 @@ ...@@ -12,40 +12,33 @@
"pre-push": [ "pre-push": [
], ],
"push": [ "push": [
"resource/audio/01.mp3 ->/data/media/", "./resource/audio/01.mp3 ->/data/media/",
"resource/audio/02.mp3 ->/data/media/", "./resource/audio/02.mp3 ->/data/media/",
"resource/audio/03.mp3 ->/data/media/", "./resource/audio/03.mp3 ->/data/media/",
"resource/audio/04.mp3 ->/data/media/", "./resource/audio/04.mp3 ->/data/media/",
"resource/audio/47.mp4 ->/data/media/", "./resource/audio/47.mp4 ->/data/media/",
"resource/audio/49.mp4 ->/data/media/", "./resource/audio/49.mp4 ->/data/media/",
"resource/audio/50.mp4 ->/data/media/", "./resource/audio/50.mp4 ->/data/media/",
"resource/audio/51.mp4 ->/data/media/", "./resource/audio/51.mp4 ->/data/media/",
"resource/audio/54.mp4 ->/data/media/", "./resource/audio/54.mp4 ->/data/media/",
"resource/audio/55.m4a ->/data/media/", "./resource/audio/55.m4a ->/data/media/",
"resource/audio/57.m4a ->/data/media/", "./resource/audio/57.m4a ->/data/media/",
"resource/audio/58.m4a ->/data/media/", "./resource/audio/58.m4a ->/data/media/",
"resource/audio/59.m4a ->/data/media/", "./resource/audio/59.m4a ->/data/media/",
"resource/audio/62.m4a ->/data/media/", "./resource/audio/62.m4a ->/data/media/",
"resource/audio/64.mp4 ->/data/media/", "./resource/audio/64.mp4 ->/data/media/",
"resource/audio/65.mp4 ->/data/media/", "./resource/audio/65.mp4 ->/data/media/",
"resource/audio/66.mp4 ->/data/media/", "./resource/audio/66.mp4 ->/data/media/",
"resource/audio/67.mp4 ->/data/media/", "./resource/audio/67.mp4 ->/data/media/",
"resource/audio/92.mp4 ->/data/media/", "./resource/audio/92.mp4 ->/data/media/",
"resource/audio/93.mp4 ->/data/media/", "./resource/audio/93.mp4 ->/data/media/",
"resource/audio/94.mp4 ->/data/media/", "./resource/audio/94.mp4 ->/data/media/",
"resource/audio/96.mp4 ->/data/media/", "./resource/audio/96.mp4 ->/data/media/",
"resource/audio/97.mp4 ->/data/media/", "./resource/audio/97.mp4 ->/data/media/",
"resource/audio/98.mp4 ->/data/media/" "./resource/audio/98.mp4 ->/data/media/"
] ]
}, },
{ {
"test-file-name": [
"AudioPlayerJsTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
},
{
"type": "ShellKit", "type": "ShellKit",
"run-command": [ "run-command": [
"chmod -R 666 /data/media/*", "chmod -R 666 /data/media/*",
...@@ -54,6 +47,13 @@ ...@@ -54,6 +47,13 @@
"teardown-command":[ "teardown-command":[
"setenforce 1" "setenforce 1"
] ]
},
{
"test-file-name": [
"AudioPlayerJsTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
} }
] ]
} }
\ No newline at end of file
{ {
"app": { "app": {
"bundleName": "ohos.acts.multimedia.audio.audioplayer", "apiVersion": {
"vendor": "acts", "compatible": 6,
"version": { "releaseType": "Beta1",
"code": 1, "target": 7
"name": "1.0" },
}, "vendor": "acts",
"apiVersion": { "bundleName": "ohos.acts.multimedia.audio.audioplayer",
"compatible": 6, "version": {
"target": 5 "code": 1000000,
} "name": "1.0.0"
}
},
"deviceConfig": {
"default": {
"debug": true
}
}, },
"deviceConfig": {},
"module": { "module": {
"package": "ohos.acts.multimedia.audio.audioplayer", "abilities": [
"name": ".MyApplication",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry"
},
"abilities": [
{
"skills": [
{ {
"entities": [ "iconId": 16777218,
"entity.system.home" "skills": [
], {
"actions": [ "entities": [
"action.system.home" "entity.system.home"
] ],
"actions": [
"action.system.home"
]
}
],
"descriptionId": 16777217,
"visible": true,
"labelId": 16777216,
"icon": "$media:icon",
"name": "ohos.acts.multimedia.audio.audioplayer.MainAbility",
"description": "$string:mainability_description",
"label": "$string:entry_MainAbility",
"type": "page",
"homeAbility": true,
"launchType": "standard"
} }
], ],
"visible": true, "deviceType": [
"name": "ohos.acts.multimedia.audio.audioplayer.MainAbility", "phone",
"icon": "$media:icon", "tablet",
"description": "$string:mainability_description", "tv",
"label": "$string:entry_MainAbility", "wearable"
"type": "page", ],
"launchType": "standard" "mainAbility": "ohos.acts.multimedia.audio.audioplayer.MainAbility",
} "distro": {
], "moduleType": "entry",
"js": [ "installationFree": false,
{ "deliveryWithInstall": true,
"pages": [ "moduleName": "entry"
"pages/index/index" },
], "package": "ohos.acts.multimedia.audio.audioplayer",
"name": "default", "name": ".MyApplication",
"window": { "js": [
"designWidth": 720, {
"autoDesignWidth": true "pages": [
} "pages/index/index"
} ],
] "name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": true
}
}
]
} }
} }
\ No newline at end of file
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ohos.acts.multimedia.audio.audioplayer;
import ohos.ace.ability.AceAbility;
import ohos.aafwk.content.Intent;
/*
* java MainAbility
*/
public class MainAbility extends AceAbility {
@Override
public void onStart(Intent intent) {
super.onStart(intent);
}
@Override
public void onStop() {
super.onStop();
}
}
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ohos.acts.multimedia.audio.audioplayer;
import ohos.aafwk.ability.AbilityPackage;
/*
* java MyApplication
*/
public class MyApplication extends AbilityPackage {
@Override
public void onInitialize() {
super.onInitialize();
}
}
...@@ -74,9 +74,10 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -74,9 +74,10 @@ describe('PlayerLocalTestAudioFUNC', function () {
} }
} }
function nextStep(mySteps) { function nextStep(mySteps,done) {
if (mySteps[0] == END_STATE) { if (mySteps[0] == END_STATE) {
isTimeOut = true; done();
console.info('case to done');
return; return;
} }
switch (mySteps[0]) { switch (mySteps[0]) {
...@@ -125,18 +126,16 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -125,18 +126,16 @@ describe('PlayerLocalTestAudioFUNC', function () {
} }
} }
function setSrcCallback(mySteps) { function setCallback(mySteps, done) {
console.info(`case setCallback`);
audioPlayer.on('dataLoad', () => { audioPlayer.on('dataLoad', () => {
mySteps.shift(); mySteps.shift();
console.info(`case dataLoad called`); console.info(`case dataLoad called`);
expect(audioPlayer.currentTime).assertEqual(0); expect(audioPlayer.currentTime).assertEqual(0);
expect(audioPlayer.duration).assertEqual(DURATION_TIME); expect(audioPlayer.duration).assertEqual(DURATION_TIME);
expect(audioPlayer.state).assertEqual('paused'); expect(audioPlayer.state).assertEqual('paused');
nextStep(mySteps); nextStep(mySteps,done);
}); });
}
function setPlayCallback(mySteps) {
audioPlayer.on('play', () => { audioPlayer.on('play', () => {
mySteps.shift(); mySteps.shift();
console.info(`case play called`); console.info(`case play called`);
...@@ -148,31 +147,22 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -148,31 +147,22 @@ describe('PlayerLocalTestAudioFUNC', function () {
return; return;
} }
expect(audioPlayer.state).assertEqual('playing'); expect(audioPlayer.state).assertEqual('playing');
nextStep(mySteps); nextStep(mySteps,done);
}); });
}
function setPauseCallback(mySteps) {
audioPlayer.on('pause', () => { audioPlayer.on('pause', () => {
mySteps.shift(); mySteps.shift();
console.info(`case pause called`); console.info(`case pause called`);
console.info(`case pause currentTime is ${audioPlayer.currentTime}`); console.info(`case pause currentTime is ${audioPlayer.currentTime}`);
expect(audioPlayer.duration).assertEqual(DURATION_TIME); expect(audioPlayer.duration).assertEqual(DURATION_TIME);
expect(audioPlayer.state).assertEqual('paused'); expect(audioPlayer.state).assertEqual('paused');
nextStep(mySteps); nextStep(mySteps,done);
}); });
}
function setResetCallback(mySteps) {
audioPlayer.on('reset', () => { audioPlayer.on('reset', () => {
mySteps.shift(); mySteps.shift();
console.info(`case reset called`); console.info(`case reset called`);
expect(audioPlayer.state).assertEqual('idle'); expect(audioPlayer.state).assertEqual('idle');
nextStep(mySteps); nextStep(mySteps,done);
}); });
}
function setStopCallback(mySteps) {
audioPlayer.on('stop', () => { audioPlayer.on('stop', () => {
if (mySteps[0] == RESET_STATE) { if (mySteps[0] == RESET_STATE) {
console.info(`case reset stop called`); console.info(`case reset stop called`);
...@@ -183,11 +173,8 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -183,11 +173,8 @@ describe('PlayerLocalTestAudioFUNC', function () {
expect(audioPlayer.currentTime).assertEqual(0); expect(audioPlayer.currentTime).assertEqual(0);
expect(audioPlayer.duration).assertEqual(DURATION_TIME); expect(audioPlayer.duration).assertEqual(DURATION_TIME);
expect(audioPlayer.state).assertEqual('stopped'); expect(audioPlayer.state).assertEqual('stopped');
nextStep(mySteps); nextStep(mySteps,done);
}); });
}
function setSeekCallback(mySteps) {
audioPlayer.on('timeUpdate', (seekDoneTime) => { audioPlayer.on('timeUpdate', (seekDoneTime) => {
if (typeof (seekDoneTime) == 'undefined') { if (typeof (seekDoneTime) == 'undefined') {
console.info(`case seek filed,errcode is ${seekDoneTime}`); console.info(`case seek filed,errcode is ${seekDoneTime}`);
...@@ -207,12 +194,9 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -207,12 +194,9 @@ describe('PlayerLocalTestAudioFUNC', function () {
sleep(PLAY_STATE); sleep(PLAY_STATE);
} }
if ((seekDoneTime < audioPlayer.duration) || (audioPlayer.state == 'paused')) { if ((seekDoneTime < audioPlayer.duration) || (audioPlayer.state == 'paused')) {
nextStep(mySteps); nextStep(mySteps,done);
} }
}); });
}
function setVolumeCallback(mySteps) {
audioPlayer.on('volumeChange', () => { audioPlayer.on('volumeChange', () => {
console.info(`case setvolume called`); console.info(`case setvolume called`);
mySteps.shift(); mySteps.shift();
...@@ -220,21 +204,15 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -220,21 +204,15 @@ describe('PlayerLocalTestAudioFUNC', function () {
if (audioPlayer.state == 'playing') { if (audioPlayer.state == 'playing') {
sleep(PLAY_TIME); sleep(PLAY_TIME);
} }
nextStep(mySteps); nextStep(mySteps,done);
}); });
}
function setFinishCallback(mySteps) {
audioPlayer.on('finish', () => { audioPlayer.on('finish', () => {
mySteps.shift(); mySteps.shift();
expect(audioPlayer.state).assertEqual('stopped'); expect(audioPlayer.state).assertEqual('stopped');
expect(audioPlayer.currentTime).assertClose(audioPlayer.duration, DELTA_TIME); expect(audioPlayer.currentTime).assertClose(audioPlayer.duration, DELTA_TIME);
console.info(`case finish called`); console.info(`case finish called`);
nextStep(mySteps); nextStep(mySteps,done);
}); });
}
function setErrorCallback(mySteps) {
audioPlayer.on('error', (err) => { audioPlayer.on('error', (err) => {
console.info(`case error called,errName is ${err.name}`); console.info(`case error called,errName is ${err.name}`);
console.info(`case error called,errCode is ${err.code}`); console.info(`case error called,errCode is ${err.code}`);
...@@ -247,28 +225,9 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -247,28 +225,9 @@ describe('PlayerLocalTestAudioFUNC', function () {
mySteps.shift(); mySteps.shift();
mySteps.shift(); mySteps.shift();
} }
nextStep(mySteps); nextStep(mySteps,done);
}); });
}
function setCallback(mySteps, done) {
console.info(`case setCallback`);
setSrcCallback(mySteps);
setPlayCallback(mySteps);
setPauseCallback(mySteps);
setResetCallback(mySteps);
setStopCallback(mySteps);
setSeekCallback(mySteps);
setVolumeCallback(mySteps);
setFinishCallback(mySteps);
setErrorCallback(mySteps);
setTimeout(function() {
if (!isTimeOut) {
console.info(`case is time out!`);
expect().assertFail();
}
done();
}, TIME_OUT);
}; };
/* * /* *
...@@ -279,7 +238,9 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -279,7 +238,9 @@ describe('PlayerLocalTestAudioFUNC', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_0100', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_0100', 0, async function (done) {
console.info(`case update`);
let mySteps = new Array(SRC_STATE, PLAY_STATE, END_STATE); let mySteps = new Array(SRC_STATE, PLAY_STATE, END_STATE);
initAudioPlayer(); initAudioPlayer();
setCallback(mySteps, done); setCallback(mySteps, done);
...@@ -294,6 +255,7 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -294,6 +255,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_0200', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_0200', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, RESET_STATE, END_STATE); let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, RESET_STATE, END_STATE);
initAudioPlayer(); initAudioPlayer();
...@@ -309,6 +271,7 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -309,6 +271,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_0300', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_0300', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, PLAY_STATE, RESET_STATE, END_STATE); let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, PLAY_STATE, RESET_STATE, END_STATE);
initAudioPlayer(); initAudioPlayer();
...@@ -324,6 +287,7 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -324,6 +287,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_0500', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_0500', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, RESET_STATE, END_STATE); let mySteps = new Array(SRC_STATE, PLAY_STATE, RESET_STATE, END_STATE);
initAudioPlayer(); initAudioPlayer();
...@@ -339,6 +303,7 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -339,6 +303,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_0600', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_0600', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, PLAY_STATE, PAUSE_STATE, END_STATE); let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, PLAY_STATE, PAUSE_STATE, END_STATE);
initAudioPlayer(); initAudioPlayer();
...@@ -354,6 +319,7 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -354,6 +319,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_0700', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_0700', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, STOP_STATE, END_STATE); let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, STOP_STATE, END_STATE);
initAudioPlayer(); initAudioPlayer();
...@@ -369,6 +335,7 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -369,6 +335,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_0800', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_0800', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, PLAY_STATE, STOP_STATE, END_STATE); let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, PLAY_STATE, STOP_STATE, END_STATE);
initAudioPlayer(); initAudioPlayer();
...@@ -384,6 +351,7 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -384,6 +351,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_0900', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_0900', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, STOP_STATE, RESET_STATE, SRC_STATE, PLAY_STATE, let mySteps = new Array(SRC_STATE, PLAY_STATE, STOP_STATE, RESET_STATE, SRC_STATE, PLAY_STATE,
PAUSE_STATE, PLAY_STATE, RESET_STATE, END_STATE); PAUSE_STATE, PLAY_STATE, RESET_STATE, END_STATE);
...@@ -400,6 +368,7 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -400,6 +368,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_1000', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_1000', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, STOP_STATE, RESET_STATE, SRC_STATE, PLAY_STATE, let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, STOP_STATE, RESET_STATE, SRC_STATE, PLAY_STATE,
PAUSE_STATE, RESET_STATE, END_STATE); PAUSE_STATE, RESET_STATE, END_STATE);
...@@ -416,6 +385,7 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -416,6 +385,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_1100', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_1100', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, STOP_STATE, RESET_STATE, let mySteps = new Array(SRC_STATE, PLAY_STATE, STOP_STATE, RESET_STATE,
SRC_STATE, PLAY_STATE, RESET_STATE, END_STATE); SRC_STATE, PLAY_STATE, RESET_STATE, END_STATE);
...@@ -432,6 +402,7 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -432,6 +402,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_1200', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_1200', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, PLAY_STATE, RESET_STATE, END_STATE); let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, PLAY_STATE, RESET_STATE, END_STATE);
initAudioPlayer(); initAudioPlayer();
...@@ -447,6 +418,7 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -447,6 +418,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_1300', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_1300', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, STOP_STATE, PAUSE_STATE, ERROR_STATE, END_STATE); let mySteps = new Array(SRC_STATE, PLAY_STATE, STOP_STATE, PAUSE_STATE, ERROR_STATE, END_STATE);
initAudioPlayer(); initAudioPlayer();
...@@ -462,6 +434,7 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -462,6 +434,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_1400', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_1400', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, 0, PAUSE_STATE, END_STATE); let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, 0, PAUSE_STATE, END_STATE);
initAudioPlayer(); initAudioPlayer();
...@@ -477,6 +450,7 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -477,6 +450,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_1500', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_1500', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, SEEK_STATE, DURATION_TIME, let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, SEEK_STATE, DURATION_TIME,
PLAY_STATE, FINISH_STATE, END_STATE); PLAY_STATE, FINISH_STATE, END_STATE);
...@@ -493,6 +467,7 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -493,6 +467,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_1600', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_1600', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, PLAY_STATE, SEEK_STATE, 0, PAUSE_STATE, END_STATE); let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, PLAY_STATE, SEEK_STATE, 0, PAUSE_STATE, END_STATE);
initAudioPlayer(); initAudioPlayer();
...@@ -508,6 +483,7 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -508,6 +483,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_1700', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_1700', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, 0, RESET_STATE, END_STATE); let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, 0, RESET_STATE, END_STATE);
initAudioPlayer(); initAudioPlayer();
...@@ -523,6 +499,7 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -523,6 +499,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_1800', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_1800', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, 0, STOP_STATE, RESET_STATE, END_STATE); let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, 0, STOP_STATE, RESET_STATE, END_STATE);
initAudioPlayer(); initAudioPlayer();
...@@ -538,6 +515,7 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -538,6 +515,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_1900', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_1900', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, STOP_STATE, SEEK_STATE, 0, ERROR_STATE, END_STATE); let mySteps = new Array(SRC_STATE, PLAY_STATE, STOP_STATE, SEEK_STATE, 0, ERROR_STATE, END_STATE);
initAudioPlayer(); initAudioPlayer();
...@@ -553,6 +531,7 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -553,6 +531,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_2000', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_2000', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, SEEK_STATE, 0, RESET_STATE, END_STATE); let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, SEEK_STATE, 0, RESET_STATE, END_STATE);
initAudioPlayer(); initAudioPlayer();
...@@ -568,6 +547,7 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -568,6 +547,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_2100', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_2100', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, SEEK_STATE, DURATION_TIME / RAND_NUM, let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, SEEK_STATE, DURATION_TIME / RAND_NUM,
STOP_STATE, END_STATE); STOP_STATE, END_STATE);
...@@ -584,6 +564,7 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -584,6 +564,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_2200', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_2200', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, PLAY_STATE, SEEK_STATE, 0, END_STATE); let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, PLAY_STATE, SEEK_STATE, 0, END_STATE);
initAudioPlayer(); initAudioPlayer();
...@@ -599,6 +580,7 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -599,6 +580,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_2300', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_2300', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, PLAY_STATE, SEEK_STATE, 0, STOP_STATE, END_STATE); let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, PLAY_STATE, SEEK_STATE, 0, STOP_STATE, END_STATE);
initAudioPlayer(); initAudioPlayer();
...@@ -614,6 +596,7 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -614,6 +596,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_2400', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_2400', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, STOP_STATE, SEEK_STATE, 0, ERROR_STATE, let mySteps = new Array(SRC_STATE, PLAY_STATE, STOP_STATE, SEEK_STATE, 0, ERROR_STATE,
RESET_STATE, SRC_STATE, PLAY_STATE, END_STATE); RESET_STATE, SRC_STATE, PLAY_STATE, END_STATE);
...@@ -630,6 +613,7 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -630,6 +613,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_2500', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_2500', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, 0, END_STATE); let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, 0, END_STATE);
initAudioPlayer(); initAudioPlayer();
...@@ -645,6 +629,7 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -645,6 +629,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level 3 * @tc.level : Level 3
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_2600', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_2600', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, STOP_STATE, SEEK_STATE, SEEK_TIME, ERROR_STATE, let mySteps = new Array(SRC_STATE, PLAY_STATE, STOP_STATE, SEEK_STATE, SEEK_TIME, ERROR_STATE,
PAUSE_STATE, ERROR_STATE, RESET_STATE, END_STATE); PAUSE_STATE, ERROR_STATE, RESET_STATE, END_STATE);
...@@ -661,6 +646,7 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -661,6 +646,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level 3 * @tc.level : Level 3
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_2700', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_2700', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, STOP_STATE, SEEK_STATE, SEEK_TIME, ERROR_STATE, let mySteps = new Array(SRC_STATE, PLAY_STATE, STOP_STATE, SEEK_STATE, SEEK_TIME, ERROR_STATE,
RESET_STATE, SRC_STATE, PLAY_STATE, END_STATE); RESET_STATE, SRC_STATE, PLAY_STATE, END_STATE);
...@@ -677,6 +663,7 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -677,6 +663,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_2800', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_2800', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, DURATION_TIME, FINISH_STATE, END_STATE); let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, DURATION_TIME, FINISH_STATE, END_STATE);
initAudioPlayer(); initAudioPlayer();
...@@ -692,6 +679,7 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -692,6 +679,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level 3 * @tc.level : Level 3
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_2900', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_2900', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, DURATION_TIME + DELTA_TIME, let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, DURATION_TIME + DELTA_TIME,
FINISH_STATE, END_STATE); FINISH_STATE, END_STATE);
...@@ -708,6 +696,7 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -708,6 +696,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_3000', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_3000', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, DURATION_TIME / RAND_NUM, END_STATE); let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, DURATION_TIME / RAND_NUM, END_STATE);
initAudioPlayer(); initAudioPlayer();
...@@ -723,6 +712,7 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -723,6 +712,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_3200', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_3200', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, SEEK_STATE, 0, PLAY_STATE, RESET_STATE, END_STATE); let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, SEEK_STATE, 0, PLAY_STATE, RESET_STATE, END_STATE);
initAudioPlayer(); initAudioPlayer();
...@@ -738,6 +728,7 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -738,6 +728,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_3300', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_3300', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, SEEK_STATE, DURATION_TIME, PLAY_STATE, let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, SEEK_STATE, DURATION_TIME, PLAY_STATE,
FINISH_STATE, RESET_STATE, END_STATE); FINISH_STATE, RESET_STATE, END_STATE);
...@@ -754,6 +745,7 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -754,6 +745,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level 3 * @tc.level : Level 3
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_3400', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_3400', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, SEEK_STATE, DURATION_TIME + DELTA_TIME, PLAY_STATE, let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, SEEK_STATE, DURATION_TIME + DELTA_TIME, PLAY_STATE,
FINISH_STATE, RESET_STATE, END_STATE); FINISH_STATE, RESET_STATE, END_STATE);
...@@ -770,6 +762,7 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -770,6 +762,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level 3 * @tc.level : Level 3
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_3500', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_3500', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, DURATION_TIME + DELTA_TIME, let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, DURATION_TIME + DELTA_TIME,
FINISH_STATE, PLAY_STATE, RESET_STATE, END_STATE); FINISH_STATE, PLAY_STATE, RESET_STATE, END_STATE);
...@@ -786,6 +779,7 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -786,6 +779,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_3600', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_3600', 0, async function (done) {
let playCount = 0; let playCount = 0;
let seekCount = 0; let seekCount = 0;
...@@ -852,6 +846,7 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -852,6 +846,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_3700', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_3700', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, VOLUME_STATE, 0, let mySteps = new Array(SRC_STATE, PLAY_STATE, VOLUME_STATE, 0,
VOLUME_STATE, MAX_VOLUME, RESET_STATE, END_STATE); VOLUME_STATE, MAX_VOLUME, RESET_STATE, END_STATE);
......
...@@ -45,16 +45,15 @@ describe('PlayerLocalTestAudioFormat', function () { ...@@ -45,16 +45,15 @@ describe('PlayerLocalTestAudioFormat', function () {
for(let t = Date.now(); Date.now() - t <= time;); for(let t = Date.now(); Date.now() - t <= time;);
} }
function setSrcCallback(audioPlayer) { function playSource(audioSource, done) {
let audioPlayer = media.createAudioPlayer();
audioPlayer.src = audioSource;
audioPlayer.on('dataLoad', () => { audioPlayer.on('dataLoad', () => {
console.info('case set source success'); console.info('case set source success');
expect(audioPlayer.state).assertEqual('paused'); expect(audioPlayer.state).assertEqual('paused');
expect(audioPlayer.currentTime).assertEqual(0); expect(audioPlayer.currentTime).assertEqual(0);
audioPlayer.play(); audioPlayer.play();
}); });
}
function setPlayCallback(audioPlayer) {
audioPlayer.on('play', () => { audioPlayer.on('play', () => {
console.info('case start to play'); console.info('case start to play');
expect(audioPlayer.state).assertEqual('playing'); expect(audioPlayer.state).assertEqual('playing');
...@@ -65,17 +64,16 @@ describe('PlayerLocalTestAudioFormat', function () { ...@@ -65,17 +64,16 @@ describe('PlayerLocalTestAudioFormat', function () {
audioPlayer.seek(SEEK_TIME); audioPlayer.seek(SEEK_TIME);
} }
}); });
}
function setPauseCallback(audioPlayer) {
audioPlayer.on('pause', () => { audioPlayer.on('pause', () => {
console.info('case now is paused'); console.info('case now is paused');
expect(audioPlayer.state).assertEqual('paused'); expect(audioPlayer.state).assertEqual('paused');
audioPlayer.setVolume(MAX_VOLUME); audioPlayer.setVolume(MAX_VOLUME);
}); });
} audioPlayer.on('stop', () => {
console.info('case stop success');
function setResetCallback(audioPlayer, done) { expect(audioPlayer.state).assertEqual('stopped');
audioPlayer.reset();
});
audioPlayer.on('reset', () => { audioPlayer.on('reset', () => {
console.info('case reset success'); console.info('case reset success');
expect(audioPlayer.state).assertEqual('idle'); expect(audioPlayer.state).assertEqual('idle');
...@@ -83,17 +81,6 @@ describe('PlayerLocalTestAudioFormat', function () { ...@@ -83,17 +81,6 @@ describe('PlayerLocalTestAudioFormat', function () {
audioPlayer = undefined; audioPlayer = undefined;
done(); done();
}); });
}
function setStopCallback(audioPlayer) {
audioPlayer.on('stop', () => {
console.info('case stop success');
expect(audioPlayer.state).assertEqual('stopped');
audioPlayer.reset();
});
}
function setSeekCallback(audioPlayer, done) {
audioPlayer.on('timeUpdate', (seekDoneTime) => { audioPlayer.on('timeUpdate', (seekDoneTime) => {
if (typeof (seekDoneTime) == "undefined") { if (typeof (seekDoneTime) == "undefined") {
console.info(`case seek filed,errcode is ${seekDoneTime}`); console.info(`case seek filed,errcode is ${seekDoneTime}`);
...@@ -112,25 +99,16 @@ describe('PlayerLocalTestAudioFormat', function () { ...@@ -112,25 +99,16 @@ describe('PlayerLocalTestAudioFormat', function () {
expect(audioPlayer.duration).assertEqual(seekDoneTime); expect(audioPlayer.duration).assertEqual(seekDoneTime);
} }
}); });
}
function setVolumeCallback(audioPlayer) {
audioPlayer.on('volumeChange', () => { audioPlayer.on('volumeChange', () => {
console.info('case set volume value to ' + MAX_VOLUME); console.info('case set volume value to ' + MAX_VOLUME);
audioPlayer.play(); audioPlayer.play();
isToSeek = true; isToSeek = true;
}); });
}
function setFinishCallback(audioPlayer) {
audioPlayer.on('finish', () => { audioPlayer.on('finish', () => {
console.info('case play end'); console.info('case play end');
expect(audioPlayer.state).assertEqual('stopped'); expect(audioPlayer.state).assertEqual('stopped');
audioPlayer.stop(); audioPlayer.stop();
}); });
}
function setErrorCallback(audioPlayer, done) {
audioPlayer.on('error', (err) => { audioPlayer.on('error', (err) => {
console.info(`case error called,errName is ${err.name}`); console.info(`case error called,errName is ${err.name}`);
console.info(`case error called,errCode is ${err.code}`); console.info(`case error called,errCode is ${err.code}`);
...@@ -141,26 +119,6 @@ describe('PlayerLocalTestAudioFormat', function () { ...@@ -141,26 +119,6 @@ describe('PlayerLocalTestAudioFormat', function () {
}); });
} }
function playSource(audioSource, done) {
let audioPlayer = media.createAudioPlayer();
if (typeof (audioPlayer) == 'undefined') {
console.info('case create player is faild');
expect().assertFail();
done();
return;
}
setSrcCallback(audioPlayer);
setPlayCallback(audioPlayer);
setPauseCallback(audioPlayer);
setResetCallback(audioPlayer, done);
setStopCallback(audioPlayer);
setSeekCallback(audioPlayer, done);
setVolumeCallback(audioPlayer);
setFinishCallback(audioPlayer);
setErrorCallback(audioPlayer, done);
audioPlayer.src = audioSource;
}
/* * /* *
* @tc.number : SUB_MEDIA_PLAYER_LOCAL_Format_MP3_01_0100 * @tc.number : SUB_MEDIA_PLAYER_LOCAL_Format_MP3_01_0100
* @tc.name : 001.Playing mp3 streams * @tc.name : 001.Playing mp3 streams
...@@ -173,6 +131,7 @@ describe('PlayerLocalTestAudioFormat', function () { ...@@ -173,6 +131,7 @@ describe('PlayerLocalTestAudioFormat', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_Format_MP3_01_0100', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_Format_MP3_01_0100', 0, async function (done) {
playSource(BASIC_PATH + '01.mp3', done); playSource(BASIC_PATH + '01.mp3', done);
}) })
...@@ -189,6 +148,7 @@ describe('PlayerLocalTestAudioFormat', function () { ...@@ -189,6 +148,7 @@ describe('PlayerLocalTestAudioFormat', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_Format_MP3_01_0200', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_Format_MP3_01_0200', 0, async function (done) {
playSource(BASIC_PATH + '02.mp3', done); playSource(BASIC_PATH + '02.mp3', done);
}) })
...@@ -205,6 +165,7 @@ describe('PlayerLocalTestAudioFormat', function () { ...@@ -205,6 +165,7 @@ describe('PlayerLocalTestAudioFormat', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_Format_MP3_01_0300', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_Format_MP3_01_0300', 0, async function (done) {
playSource(BASIC_PATH + '03.mp3', done); playSource(BASIC_PATH + '03.mp3', done);
}) })
...@@ -221,6 +182,7 @@ describe('PlayerLocalTestAudioFormat', function () { ...@@ -221,6 +182,7 @@ describe('PlayerLocalTestAudioFormat', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_Format_MP3_01_0400', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_Format_MP3_01_0400', 0, async function (done) {
playSource(BASIC_PATH + '04.mp3', done); playSource(BASIC_PATH + '04.mp3', done);
}) })
...@@ -237,6 +199,7 @@ describe('PlayerLocalTestAudioFormat', function () { ...@@ -237,6 +199,7 @@ describe('PlayerLocalTestAudioFormat', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_0100', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_0100', 0, async function (done) {
playSource(BASIC_PATH + '47.mp4', done); playSource(BASIC_PATH + '47.mp4', done);
}) })
...@@ -254,6 +217,7 @@ describe('PlayerLocalTestAudioFormat', function () { ...@@ -254,6 +217,7 @@ describe('PlayerLocalTestAudioFormat', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_0300', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_0300', 0, async function (done) {
playSource(BASIC_PATH + '49.mp4', done); playSource(BASIC_PATH + '49.mp4', done);
}) })
...@@ -270,6 +234,7 @@ describe('PlayerLocalTestAudioFormat', function () { ...@@ -270,6 +234,7 @@ describe('PlayerLocalTestAudioFormat', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_0400', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_0400', 0, async function (done) {
playSource(BASIC_PATH + '50.mp4', done); playSource(BASIC_PATH + '50.mp4', done);
}) })
...@@ -286,6 +251,7 @@ describe('PlayerLocalTestAudioFormat', function () { ...@@ -286,6 +251,7 @@ describe('PlayerLocalTestAudioFormat', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_0500', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_0500', 0, async function (done) {
playSource(BASIC_PATH + '51.mp4', done); playSource(BASIC_PATH + '51.mp4', done);
}) })
...@@ -302,6 +268,7 @@ describe('PlayerLocalTestAudioFormat', function () { ...@@ -302,6 +268,7 @@ describe('PlayerLocalTestAudioFormat', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_0600', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_0600', 0, async function (done) {
playSource(BASIC_PATH + '54.mp4', done); playSource(BASIC_PATH + '54.mp4', done);
}) })
...@@ -318,6 +285,7 @@ describe('PlayerLocalTestAudioFormat', function () { ...@@ -318,6 +285,7 @@ describe('PlayerLocalTestAudioFormat', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_0700', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_0700', 0, async function (done) {
playSource(BASIC_PATH + '64.mp4', done); playSource(BASIC_PATH + '64.mp4', done);
}) })
...@@ -334,6 +302,7 @@ describe('PlayerLocalTestAudioFormat', function () { ...@@ -334,6 +302,7 @@ describe('PlayerLocalTestAudioFormat', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_0800', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_0800', 0, async function (done) {
playSource(BASIC_PATH + '65.mp4', done); playSource(BASIC_PATH + '65.mp4', done);
}) })
...@@ -350,6 +319,7 @@ describe('PlayerLocalTestAudioFormat', function () { ...@@ -350,6 +319,7 @@ describe('PlayerLocalTestAudioFormat', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_0900', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_0900', 0, async function (done) {
playSource(BASIC_PATH + '66.mp4', done); playSource(BASIC_PATH + '66.mp4', done);
}) })
...@@ -366,6 +336,7 @@ describe('PlayerLocalTestAudioFormat', function () { ...@@ -366,6 +336,7 @@ describe('PlayerLocalTestAudioFormat', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_1000', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_1000', 0, async function (done) {
playSource(BASIC_PATH + '67.mp4', done); playSource(BASIC_PATH + '67.mp4', done);
}) })
...@@ -382,6 +353,7 @@ describe('PlayerLocalTestAudioFormat', function () { ...@@ -382,6 +353,7 @@ describe('PlayerLocalTestAudioFormat', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_1100', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_1100', 0, async function (done) {
playSource(BASIC_PATH + '92.mp4', done); playSource(BASIC_PATH + '92.mp4', done);
}) })
...@@ -398,6 +370,7 @@ describe('PlayerLocalTestAudioFormat', function () { ...@@ -398,6 +370,7 @@ describe('PlayerLocalTestAudioFormat', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_1200', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_1200', 0, async function (done) {
playSource(BASIC_PATH + '93.mp4', done); playSource(BASIC_PATH + '93.mp4', done);
}) })
...@@ -414,6 +387,7 @@ describe('PlayerLocalTestAudioFormat', function () { ...@@ -414,6 +387,7 @@ describe('PlayerLocalTestAudioFormat', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_1300', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_1300', 0, async function (done) {
playSource(BASIC_PATH + '94.mp4', done); playSource(BASIC_PATH + '94.mp4', done);
}) })
...@@ -430,6 +404,7 @@ describe('PlayerLocalTestAudioFormat', function () { ...@@ -430,6 +404,7 @@ describe('PlayerLocalTestAudioFormat', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_1400', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_1400', 0, async function (done) {
playSource(BASIC_PATH + '96.mp4', done); playSource(BASIC_PATH + '96.mp4', done);
}) })
...@@ -446,6 +421,7 @@ describe('PlayerLocalTestAudioFormat', function () { ...@@ -446,6 +421,7 @@ describe('PlayerLocalTestAudioFormat', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_1500', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_1500', 0, async function (done) {
playSource(BASIC_PATH + '97.mp4', done); playSource(BASIC_PATH + '97.mp4', done);
}) })
...@@ -462,6 +438,7 @@ describe('PlayerLocalTestAudioFormat', function () { ...@@ -462,6 +438,7 @@ describe('PlayerLocalTestAudioFormat', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_1600', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_1600', 0, async function (done) {
playSource(BASIC_PATH + '98.mp4', done); playSource(BASIC_PATH + '98.mp4', done);
}) })
...@@ -478,6 +455,7 @@ describe('PlayerLocalTestAudioFormat', function () { ...@@ -478,6 +455,7 @@ describe('PlayerLocalTestAudioFormat', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_Format_M4A_01_0100', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_Format_M4A_01_0100', 0, async function (done) {
playSource(BASIC_PATH + '55.m4a', done); playSource(BASIC_PATH + '55.m4a', done);
}) })
...@@ -495,6 +473,7 @@ describe('PlayerLocalTestAudioFormat', function () { ...@@ -495,6 +473,7 @@ describe('PlayerLocalTestAudioFormat', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_Format_M4A_01_0300', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_Format_M4A_01_0300', 0, async function (done) {
playSource(BASIC_PATH + '57.m4a', done); playSource(BASIC_PATH + '57.m4a', done);
}) })
...@@ -511,6 +490,7 @@ describe('PlayerLocalTestAudioFormat', function () { ...@@ -511,6 +490,7 @@ describe('PlayerLocalTestAudioFormat', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_Format_M4A_01_0400', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_Format_M4A_01_0400', 0, async function (done) {
playSource(BASIC_PATH + '58.m4a', done); playSource(BASIC_PATH + '58.m4a', done);
}) })
...@@ -527,6 +507,7 @@ describe('PlayerLocalTestAudioFormat', function () { ...@@ -527,6 +507,7 @@ describe('PlayerLocalTestAudioFormat', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_Format_M4A_01_0500', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_Format_M4A_01_0500', 0, async function (done) {
playSource(BASIC_PATH + '59.m4a', done); playSource(BASIC_PATH + '59.m4a', done);
}) })
...@@ -543,6 +524,7 @@ describe('PlayerLocalTestAudioFormat', function () { ...@@ -543,6 +524,7 @@ describe('PlayerLocalTestAudioFormat', function () {
* @tc.type : Function test * @tc.type : Function test
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_PLAYER_LOCAL_Format_M4A_01_0700', 0, async function (done) { it('SUB_MEDIA_PLAYER_LOCAL_Format_M4A_01_0700', 0, async function (done) {
playSource(BASIC_PATH + '62.m4a', done); playSource(BASIC_PATH + '62.m4a', done);
}) })
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"description": "Configuration for audioPlayerApi Tests", "description": "Configuration for audioPlayerApi Tests",
"driver": { "driver": {
"type": "JSUnitTest", "type": "JSUnitTest",
"test-timeout": "3000000", "test-timeout": "2000000",
"package": "ohos.acts.multimedia.audio.audioplayerapi", "package": "ohos.acts.multimedia.audio.audioplayerapi",
"shell-timeout": "60000" "shell-timeout": "60000"
}, },
...@@ -12,39 +12,32 @@ ...@@ -12,39 +12,32 @@
"pre-push": [ "pre-push": [
], ],
"push": [ "push": [
"resource/audio/01.mp3 ->/data/media/", "./resource/audio/01.mp3 ->/data/media/",
"resource/audio/02.mp3 ->/data/media/", "./resource/audio/02.mp3 ->/data/media/",
"resource/audio/03.mp3 ->/data/media/", "./resource/audio/03.mp3 ->/data/media/",
"resource/audio/04.mp3 ->/data/media/", "./resource/audio/04.mp3 ->/data/media/",
"resource/audio/47.mp4 ->/data/media/", "./resource/audio/47.mp4 ->/data/media/",
"resource/audio/49.mp4 ->/data/media/", "./resource/audio/49.mp4 ->/data/media/",
"resource/audio/50.mp4 ->/data/media/", "./resource/audio/50.mp4 ->/data/media/",
"resource/audio/51.mp4 ->/data/media/", "./resource/audio/51.mp4 ->/data/media/",
"resource/audio/54.mp4 ->/data/media/", "./resource/audio/54.mp4 ->/data/media/",
"resource/audio/55.m4a ->/data/media/", "./resource/audio/55.m4a ->/data/media/",
"resource/audio/57.m4a ->/data/media/", "./resource/audio/57.m4a ->/data/media/",
"resource/audio/58.m4a ->/data/media/", "./resource/audio/58.m4a ->/data/media/",
"resource/audio/59.m4a ->/data/media/", "./resource/audio/59.m4a ->/data/media/",
"resource/audio/62.m4a ->/data/media/", "./resource/audio/62.m4a ->/data/media/",
"resource/audio/64.mp4 ->/data/media/", "./resource/audio/64.mp4 ->/data/media/",
"resource/audio/65.mp4 ->/data/media/", "./resource/audio/65.mp4 ->/data/media/",
"resource/audio/66.mp4 ->/data/media/", "./resource/audio/66.mp4 ->/data/media/",
"resource/audio/67.mp4 ->/data/media/", "./resource/audio/67.mp4 ->/data/media/",
"resource/audio/92.mp4 ->/data/media/", "./resource/audio/92.mp4 ->/data/media/",
"resource/audio/93.mp4 ->/data/media/", "./resource/audio/93.mp4 ->/data/media/",
"resource/audio/94.mp4 ->/data/media/", "./resource/audio/94.mp4 ->/data/media/",
"resource/audio/96.mp4 ->/data/media/", "./resource/audio/96.mp4 ->/data/media/",
"resource/audio/97.mp4 ->/data/media/", "./resource/audio/97.mp4 ->/data/media/",
"resource/audio/98.mp4 ->/data/media/" "./resource/audio/98.mp4 ->/data/media/"
] ]
}, },
{
"test-file-name": [
"AudioPlayerApiJsTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
},
{ {
"type": "ShellKit", "type": "ShellKit",
"run-command": [ "run-command": [
...@@ -54,6 +47,13 @@ ...@@ -54,6 +47,13 @@
"teardown-command":[ "teardown-command":[
"setenforce 1" "setenforce 1"
] ]
},
{
"test-file-name": [
"AudioPlayerApiJsTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
} }
] ]
} }
\ No newline at end of file
{ {
"app": { "app": {
"bundleName": "ohos.acts.multimedia.audio.audioplayerapi", "apiVersion": {
"vendor": "acts", "compatible": 6,
"version": { "releaseType": "Beta1",
"code": 1, "target": 7
"name": "1.0" },
"vendor": "acts",
"bundleName": "ohos.acts.multimedia.audio.audioplayerapi",
"version": {
"code": 1000000,
"name": "1.0.0"
}
}, },
"apiVersion": { "deviceConfig": {
"compatible": 6, "default": {
"target": 5 "debug": true
} }
},
"deviceConfig": {},
"module": {
"package": "ohos.acts.multimedia.audio.audioplayerapi",
"name": ".MyApplication",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry"
}, },
"abilities": [ "module": {
{ "abilities": [
"skills": [ {
{ "iconId": 16777218,
"entities": [ "skills": [
"entity.system.home" {
], "entities": [
"actions": [ "entity.system.home"
"action.system.home" ],
] "actions": [
} "action.system.home"
]
}
],
"descriptionId": 16777217,
"visible": true,
"labelId": 16777216,
"icon": "$media:icon",
"name": "ohos.acts.multimedia.audio.audioplayerapi.MainAbility",
"description": "$string:mainability_description",
"label": "$string:entry_MainAbility",
"type": "page",
"homeAbility": true,
"launchType": "standard"
}
], ],
"visible": true, "deviceType": [
"name": "ohos.acts.multimedia.audio.audioplayerapi.MainAbility", "phone",
"icon": "$media:icon", "tablet",
"description": "$string:mainability_description", "tv",
"label": "$string:entry_MainAbility", "wearable"
"type": "page",
"launchType": "standard"
}
],
"js": [
{
"pages": [
"pages/index/index"
], ],
"name": "default", "mainAbility": "ohos.acts.multimedia.audio.audioplayerapi.MainAbility",
"window": { "distro": {
"designWidth": 720, "moduleType": "entry",
"autoDesignWidth": true "installationFree": false,
} "deliveryWithInstall": true,
} "moduleName": "entry"
] },
} "package": "ohos.acts.multimedia.audio.audioplayerapi",
"name": ".MyApplication",
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": true
}
}
]
}
} }
\ No newline at end of file
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ohos.acts.multimedia.audio.audioplayerapi;
import ohos.ace.ability.AceAbility;
import ohos.aafwk.content.Intent;
/*
* java MainAbility
*/
public class MainAbility extends AceAbility {
@Override
public void onStart(Intent intent) {
super.onStart(intent);
}
@Override
public void onStop() {
super.onStop();
}
}
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ohos.acts.multimedia.audio.audioplayerapi;
import ohos.aafwk.ability.AbilityPackage;
/*
* java MyApplication
*/
public class MyApplication extends AbilityPackage {
@Override
public void onInitialize() {
super.onInitialize();
}
}
...@@ -74,9 +74,10 @@ describe('PlayerLocalTestAudioAPI', function () { ...@@ -74,9 +74,10 @@ describe('PlayerLocalTestAudioAPI', function () {
} }
} }
function nextStep(mySteps) { function nextStep(mySteps,done) {
if (mySteps[0] == END_STATE) { if (mySteps[0] == END_STATE) {
isTimeOut = true; done();
console.info('case to done');
return; return;
} }
switch (mySteps[0]) { switch (mySteps[0]) {
...@@ -127,21 +128,20 @@ describe('PlayerLocalTestAudioAPI', function () { ...@@ -127,21 +128,20 @@ describe('PlayerLocalTestAudioAPI', function () {
} }
} }
function setSrcCallback(mySteps) { function setCallback(mySteps, done) {
console.info(`case setCallback`);
audioPlayer.on('dataLoad', () => { audioPlayer.on('dataLoad', () => {
mySteps.shift(); mySteps.shift();
console.info(`case dataLoad called`); console.info(`case dataLoad called`);
expect(audioPlayer.currentTime).assertEqual(0); expect(audioPlayer.currentTime).assertEqual(0);
expect(audioPlayer.duration).assertEqual(DURATION_TIME); expect(audioPlayer.duration).assertEqual(DURATION_TIME);
expect(audioPlayer.state).assertEqual('paused'); expect(audioPlayer.state).assertEqual('paused');
nextStep(mySteps); nextStep(mySteps,done);
}); });
}
function setPlayCallback(mySteps) {
audioPlayer.on('play', () => { audioPlayer.on('play', () => {
mySteps.shift(); mySteps.shift();
console.info(`case play called`); console.info(`case play called`);
sleep(PLAY_TIME);
console.info(`case play currentTime is ${audioPlayer.currentTime}`); console.info(`case play currentTime is ${audioPlayer.currentTime}`);
expect(audioPlayer.duration).assertEqual(DURATION_TIME); expect(audioPlayer.duration).assertEqual(DURATION_TIME);
if (mySteps[0] == FINISH_STATE) { if (mySteps[0] == FINISH_STATE) {
...@@ -149,31 +149,22 @@ describe('PlayerLocalTestAudioAPI', function () { ...@@ -149,31 +149,22 @@ describe('PlayerLocalTestAudioAPI', function () {
return; return;
} }
expect(audioPlayer.state).assertEqual('playing'); expect(audioPlayer.state).assertEqual('playing');
nextStep(mySteps); nextStep(mySteps,done);
}); });
}
function setPauseCallback(mySteps) {
audioPlayer.on('pause', () => { audioPlayer.on('pause', () => {
mySteps.shift(); mySteps.shift();
console.info(`case pause called`); console.info(`case pause called`);
console.info(`case pause currentTime is ${audioPlayer.currentTime}`); console.info(`case pause currentTime is ${audioPlayer.currentTime}`);
expect(audioPlayer.duration).assertEqual(DURATION_TIME); expect(audioPlayer.duration).assertEqual(DURATION_TIME);
expect(audioPlayer.state).assertEqual('paused'); expect(audioPlayer.state).assertEqual('paused');
nextStep(mySteps); nextStep(mySteps,done);
}); });
}
function setResetCallback(mySteps) {
audioPlayer.on('reset', () => { audioPlayer.on('reset', () => {
mySteps.shift(); mySteps.shift();
console.info(`case reset called`); console.info(`case reset called`);
expect(audioPlayer.state).assertEqual('idle'); expect(audioPlayer.state).assertEqual('idle');
nextStep(mySteps); nextStep(mySteps,done);
}); });
}
function setStopCallback(mySteps) {
audioPlayer.on('stop', () => { audioPlayer.on('stop', () => {
if (mySteps[0] == RESET_STATE) { if (mySteps[0] == RESET_STATE) {
console.info(`case reset stop called`); console.info(`case reset stop called`);
...@@ -184,11 +175,8 @@ describe('PlayerLocalTestAudioAPI', function () { ...@@ -184,11 +175,8 @@ describe('PlayerLocalTestAudioAPI', function () {
expect(audioPlayer.currentTime).assertEqual(0); expect(audioPlayer.currentTime).assertEqual(0);
expect(audioPlayer.duration).assertEqual(DURATION_TIME); expect(audioPlayer.duration).assertEqual(DURATION_TIME);
expect(audioPlayer.state).assertEqual('stopped'); expect(audioPlayer.state).assertEqual('stopped');
nextStep(mySteps); nextStep(mySteps,done);
}); });
}
function setSeekCallback(mySteps) {
audioPlayer.on('timeUpdate', (seekDoneTime) => { audioPlayer.on('timeUpdate', (seekDoneTime) => {
if (typeof (seekDoneTime) == 'undefined') { if (typeof (seekDoneTime) == 'undefined') {
console.info(`case seek filed,errcode is ${seekDoneTime}`); console.info(`case seek filed,errcode is ${seekDoneTime}`);
...@@ -208,12 +196,9 @@ describe('PlayerLocalTestAudioAPI', function () { ...@@ -208,12 +196,9 @@ describe('PlayerLocalTestAudioAPI', function () {
sleep(PLAY_STATE); sleep(PLAY_STATE);
} }
if ((seekDoneTime < audioPlayer.duration) || (audioPlayer.state == 'paused')) { if ((seekDoneTime < audioPlayer.duration) || (audioPlayer.state == 'paused')) {
nextStep(mySteps); nextStep(mySteps,done);
} }
}); });
}
function setVolumeCallback(mySteps) {
audioPlayer.on('volumeChange', () => { audioPlayer.on('volumeChange', () => {
console.info(`case setvolume called`); console.info(`case setvolume called`);
mySteps.shift(); mySteps.shift();
...@@ -221,21 +206,15 @@ describe('PlayerLocalTestAudioAPI', function () { ...@@ -221,21 +206,15 @@ describe('PlayerLocalTestAudioAPI', function () {
if (audioPlayer.state == 'playing') { if (audioPlayer.state == 'playing') {
sleep(PLAY_TIME); sleep(PLAY_TIME);
} }
nextStep(mySteps); nextStep(mySteps,done);
}); });
}
function setFinishCallback(mySteps) {
audioPlayer.on('finish', () => { audioPlayer.on('finish', () => {
mySteps.shift(); mySteps.shift();
expect(audioPlayer.state).assertEqual('stopped'); expect(audioPlayer.state).assertEqual('stopped');
expect(audioPlayer.currentTime).assertClose(audioPlayer.duration, DELTA_TIME); expect(audioPlayer.currentTime).assertClose(audioPlayer.duration, DELTA_TIME);
console.info(`case finish called`); console.info(`case finish called`);
nextStep(mySteps); nextStep(mySteps,done);
}); });
}
function setErrorCallback(mySteps) {
audioPlayer.on('error', (err) => { audioPlayer.on('error', (err) => {
console.info(`case error called,errName is ${err.name}`); console.info(`case error called,errName is ${err.name}`);
console.info(`case error called,errCode is ${err.code}`); console.info(`case error called,errCode is ${err.code}`);
...@@ -252,29 +231,10 @@ describe('PlayerLocalTestAudioAPI', function () { ...@@ -252,29 +231,10 @@ describe('PlayerLocalTestAudioAPI', function () {
} else { } else {
mySteps.shift(); mySteps.shift();
mySteps.shift(); mySteps.shift();
nextStep(mySteps); nextStep(mySteps,done);
} }
}); });
}
function setCallback(mySteps, done) {
console.info(`case setCallback`);
setSrcCallback(mySteps);
setPlayCallback(mySteps);
setPauseCallback(mySteps);
setResetCallback(mySteps);
setStopCallback(mySteps);
setSeekCallback(mySteps);
setVolumeCallback(mySteps);
setFinishCallback(mySteps);
setErrorCallback(mySteps);
setTimeout(function() {
if (!isTimeOut) {
console.info(`case is time out!`);
expect(isTimeOut).assertTrue();
}
done();
}, TIME_OUT);
}; };
/* * /* *
...@@ -285,7 +245,9 @@ describe('PlayerLocalTestAudioAPI', function () { ...@@ -285,7 +245,9 @@ describe('PlayerLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_PLAYER_AudioPlayer_Play_API_0100', 0, async function (done) { it('SUB_MEDIA_PLAYER_AudioPlayer_Play_API_0100', 0, async function (done) {
console.info(`case update`);
let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, PLAY_STATE, END_STATE); let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, PLAY_STATE, END_STATE);
initAudioPlayer(); initAudioPlayer();
setCallback(mySteps, done); setCallback(mySteps, done);
...@@ -300,6 +262,7 @@ describe('PlayerLocalTestAudioAPI', function () { ...@@ -300,6 +262,7 @@ describe('PlayerLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_PLAYER_AudioPlayer_Play_API_0200', 0, async function (done) { it('SUB_MEDIA_PLAYER_AudioPlayer_Play_API_0200', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, STOP_STATE, PLAY_STATE, ERROR_STATE, END_STATE); let mySteps = new Array(SRC_STATE, PLAY_STATE, STOP_STATE, PLAY_STATE, ERROR_STATE, END_STATE);
initAudioPlayer(); initAudioPlayer();
...@@ -315,6 +278,7 @@ describe('PlayerLocalTestAudioAPI', function () { ...@@ -315,6 +278,7 @@ describe('PlayerLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_PLAYER_AudioPlayer_Play_API_0300', 0, async function (done) { it('SUB_MEDIA_PLAYER_AudioPlayer_Play_API_0300', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, SEEK_STATE, SEEK_TIME, PLAY_STATE, END_STATE); let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, SEEK_STATE, SEEK_TIME, PLAY_STATE, END_STATE);
initAudioPlayer(); initAudioPlayer();
...@@ -330,6 +294,7 @@ describe('PlayerLocalTestAudioAPI', function () { ...@@ -330,6 +294,7 @@ describe('PlayerLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_PLAYER_AudioPlayer_Play_API_0400', 0, async function (done) { it('SUB_MEDIA_PLAYER_AudioPlayer_Play_API_0400', 0, async function (done) {
let mySteps = new Array(SRC_STATE, RESET_STATE, PLAY_STATE, ERROR_STATE, END_STATE); let mySteps = new Array(SRC_STATE, RESET_STATE, PLAY_STATE, ERROR_STATE, END_STATE);
initAudioPlayer(); initAudioPlayer();
...@@ -345,6 +310,7 @@ describe('PlayerLocalTestAudioAPI', function () { ...@@ -345,6 +310,7 @@ describe('PlayerLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_PLAYER_AudioPlayer_Pause_API_0100', 0, async function (done) { it('SUB_MEDIA_PLAYER_AudioPlayer_Pause_API_0100', 0, async function (done) {
let mySteps = new Array(PAUSE_STATE, ERROR_STATE, END_STATE); let mySteps = new Array(PAUSE_STATE, ERROR_STATE, END_STATE);
initAudioPlayer(); initAudioPlayer();
...@@ -360,6 +326,7 @@ describe('PlayerLocalTestAudioAPI', function () { ...@@ -360,6 +326,7 @@ describe('PlayerLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_PLAYER_AudioPlayer_Pause_API_0200', 0, async function (done) { it('SUB_MEDIA_PLAYER_AudioPlayer_Pause_API_0200', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, END_STATE); let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, END_STATE);
initAudioPlayer(); initAudioPlayer();
...@@ -375,6 +342,7 @@ describe('PlayerLocalTestAudioAPI', function () { ...@@ -375,6 +342,7 @@ describe('PlayerLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_PLAYER_AudioPlayer_Pause_API_0300', 0, async function (done) { it('SUB_MEDIA_PLAYER_AudioPlayer_Pause_API_0300', 0, async function (done) {
let mySteps = new Array(PLAY_STATE, STOP_STATE, PAUSE_STATE, ERROR_STATE, END_STATE); let mySteps = new Array(PLAY_STATE, STOP_STATE, PAUSE_STATE, ERROR_STATE, END_STATE);
initAudioPlayer(); initAudioPlayer();
...@@ -390,6 +358,7 @@ describe('PlayerLocalTestAudioAPI', function () { ...@@ -390,6 +358,7 @@ describe('PlayerLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_PLAYER_AudioPlayer_Pause_API_0400', 0, async function (done) { it('SUB_MEDIA_PLAYER_AudioPlayer_Pause_API_0400', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, SEEK_TIME, PAUSE_STATE, END_STATE); let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, SEEK_TIME, PAUSE_STATE, END_STATE);
initAudioPlayer(); initAudioPlayer();
...@@ -405,6 +374,7 @@ describe('PlayerLocalTestAudioAPI', function () { ...@@ -405,6 +374,7 @@ describe('PlayerLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_PLAYER_AudioPlayer_Stop_API_0100', 0, async function (done) { it('SUB_MEDIA_PLAYER_AudioPlayer_Stop_API_0100', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, STOP_STATE, END_STATE); let mySteps = new Array(SRC_STATE, PLAY_STATE, STOP_STATE, END_STATE);
initAudioPlayer(); initAudioPlayer();
...@@ -420,6 +390,7 @@ describe('PlayerLocalTestAudioAPI', function () { ...@@ -420,6 +390,7 @@ describe('PlayerLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_PLAYER_AudioPlayer_Stop_API_0200', 0, async function (done) { it('SUB_MEDIA_PLAYER_AudioPlayer_Stop_API_0200', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, STOP_STATE, END_STATE); let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, STOP_STATE, END_STATE);
initAudioPlayer(); initAudioPlayer();
...@@ -435,6 +406,7 @@ describe('PlayerLocalTestAudioAPI', function () { ...@@ -435,6 +406,7 @@ describe('PlayerLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_PLAYER_AudioPlayer_Stop_API_0300', 0, async function (done) { it('SUB_MEDIA_PLAYER_AudioPlayer_Stop_API_0300', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, SEEK_TIME, STOP_STATE, END_STATE); let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, SEEK_TIME, STOP_STATE, END_STATE);
initAudioPlayer(); initAudioPlayer();
...@@ -450,6 +422,7 @@ describe('PlayerLocalTestAudioAPI', function () { ...@@ -450,6 +422,7 @@ describe('PlayerLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_PLAYER_AudioPlayer_Seek_API_0100', 0, async function (done) { it('SUB_MEDIA_PLAYER_AudioPlayer_Seek_API_0100', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, SEEK_TIME, END_STATE); let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, SEEK_TIME, END_STATE);
initAudioPlayer(); initAudioPlayer();
...@@ -465,12 +438,14 @@ describe('PlayerLocalTestAudioAPI', function () { ...@@ -465,12 +438,14 @@ describe('PlayerLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_PLAYER_AudioPlayer_Seek_API_0200', 0, async function (done) { it('SUB_MEDIA_PLAYER_AudioPlayer_Seek_API_0200', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, SEEK_STATE, SEEK_TIME, END_STATE); let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, SEEK_STATE, SEEK_TIME, END_STATE);
initAudioPlayer(); initAudioPlayer();
setCallback(mySteps, done); setCallback(mySteps, done);
audioPlayer.src = AUDIO_SOURCE; audioPlayer.src = AUDIO_SOURCE;
}) })
/* * /* *
* @tc.number : SUB_MEDIA_PLAYER_AudioPlayer_Seek_API_0300 * @tc.number : SUB_MEDIA_PLAYER_AudioPlayer_Seek_API_0300
* @tc.name : 03.seek(0) * @tc.name : 03.seek(0)
...@@ -479,6 +454,7 @@ describe('PlayerLocalTestAudioAPI', function () { ...@@ -479,6 +454,7 @@ describe('PlayerLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_PLAYER_AudioPlayer_Seek_API_0300', 0, async function (done) { it('SUB_MEDIA_PLAYER_AudioPlayer_Seek_API_0300', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, 0, END_STATE); let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, 0, END_STATE);
initAudioPlayer(); initAudioPlayer();
...@@ -494,6 +470,7 @@ describe('PlayerLocalTestAudioAPI', function () { ...@@ -494,6 +470,7 @@ describe('PlayerLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_PLAYER_AudioPlayer_Reset_API_0100', 0, async function (done) { it('SUB_MEDIA_PLAYER_AudioPlayer_Reset_API_0100', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, RESET_STATE, END_STATE); let mySteps = new Array(SRC_STATE, PLAY_STATE, RESET_STATE, END_STATE);
initAudioPlayer(); initAudioPlayer();
...@@ -509,6 +486,7 @@ describe('PlayerLocalTestAudioAPI', function () { ...@@ -509,6 +486,7 @@ describe('PlayerLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_PLAYER_AudioPlayer_Reset_API_0200', 0, async function (done) { it('SUB_MEDIA_PLAYER_AudioPlayer_Reset_API_0200', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, RESET_STATE, END_STATE); let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, RESET_STATE, END_STATE);
initAudioPlayer(); initAudioPlayer();
...@@ -524,12 +502,14 @@ describe('PlayerLocalTestAudioAPI', function () { ...@@ -524,12 +502,14 @@ describe('PlayerLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_PLAYER_AudioPlayer_SetVolume_API_0100', 0, async function (done) { it('SUB_MEDIA_PLAYER_AudioPlayer_SetVolume_API_0100', 0, async function (done) {
var mySteps = new Array(VOLUME_STATE, VOLUME_VALUE, ERROR_STATE, END_STATE); var mySteps = new Array(VOLUME_STATE, VOLUME_VALUE, ERROR_STATE, END_STATE);
initAudioPlayer(); initAudioPlayer();
setCallback(mySteps, done); setCallback(mySteps, done);
audioPlayer.setVolume(VOLUME_VALUE); audioPlayer.setVolume(VOLUME_VALUE);
}) })
/* * /* *
* @tc.number : SUB_MEDIA_PLAYER_AudioPlayer_SetVolume_API_0200 * @tc.number : SUB_MEDIA_PLAYER_AudioPlayer_SetVolume_API_0200
* @tc.name : 02.play->setVolume * @tc.name : 02.play->setVolume
...@@ -538,12 +518,14 @@ describe('PlayerLocalTestAudioAPI', function () { ...@@ -538,12 +518,14 @@ describe('PlayerLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_PLAYER_AudioPlayer_SetVolume_API_0200', 0, async function (done) { it('SUB_MEDIA_PLAYER_AudioPlayer_SetVolume_API_0200', 0, async function (done) {
var mySteps = new Array(SRC_STATE, PLAY_STATE, VOLUME_STATE, VOLUME_VALUE, END_STATE); var mySteps = new Array(SRC_STATE, PLAY_STATE, VOLUME_STATE, VOLUME_VALUE, END_STATE);
initAudioPlayer(); initAudioPlayer();
setCallback(mySteps, done); setCallback(mySteps, done);
audioPlayer.src = AUDIO_SOURCE; audioPlayer.src = AUDIO_SOURCE;
}) })
/* * /* *
* @tc.number : SUB_MEDIA_PLAYER_AudioPlayer_SetVolume_API_0300 * @tc.number : SUB_MEDIA_PLAYER_AudioPlayer_SetVolume_API_0300
* @tc.name : 03.pause->setVolume * @tc.name : 03.pause->setVolume
...@@ -552,6 +534,7 @@ describe('PlayerLocalTestAudioAPI', function () { ...@@ -552,6 +534,7 @@ describe('PlayerLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_PLAYER_AudioPlayer_SetVolume_API_0300', 0, async function (done) { it('SUB_MEDIA_PLAYER_AudioPlayer_SetVolume_API_0300', 0, async function (done) {
var mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, VOLUME_STATE, VOLUME_VALUE, END_STATE); var mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, VOLUME_STATE, VOLUME_VALUE, END_STATE);
initAudioPlayer(); initAudioPlayer();
...@@ -567,6 +550,7 @@ describe('PlayerLocalTestAudioAPI', function () { ...@@ -567,6 +550,7 @@ describe('PlayerLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_PLAYER_AudioPlayer_Release_API_0100', 0, async function (done) { it('SUB_MEDIA_PLAYER_AudioPlayer_Release_API_0100', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, RELEASE_STATE, END_STATE); let mySteps = new Array(SRC_STATE, PLAY_STATE, RELEASE_STATE, END_STATE);
initAudioPlayer(); initAudioPlayer();
...@@ -582,6 +566,7 @@ describe('PlayerLocalTestAudioAPI', function () { ...@@ -582,6 +566,7 @@ describe('PlayerLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_PLAYER_AudioPlayer_Release_API_0200', 0, async function (done) { it('SUB_MEDIA_PLAYER_AudioPlayer_Release_API_0200', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, RELEASE_STATE, END_STATE); let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, RELEASE_STATE, END_STATE);
initAudioPlayer(); initAudioPlayer();
...@@ -597,6 +582,7 @@ describe('PlayerLocalTestAudioAPI', function () { ...@@ -597,6 +582,7 @@ describe('PlayerLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_PLAYER_AudioPlayer_Release_API_0300', 0, async function (done) { it('SUB_MEDIA_PLAYER_AudioPlayer_Release_API_0300', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, STOP_STATE, RELEASE_STATE, END_STATE); let mySteps = new Array(SRC_STATE, PLAY_STATE, STOP_STATE, RELEASE_STATE, END_STATE);
initAudioPlayer(); initAudioPlayer();
...@@ -612,6 +598,7 @@ describe('PlayerLocalTestAudioAPI', function () { ...@@ -612,6 +598,7 @@ describe('PlayerLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_PLAYER_AudioPlayer_Release_API_0400', 0, async function (done) { it('SUB_MEDIA_PLAYER_AudioPlayer_Release_API_0400', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, SEEK_TIME, RELEASE_STATE, END_STATE); let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, SEEK_TIME, RELEASE_STATE, END_STATE);
initAudioPlayer(); initAudioPlayer();
...@@ -627,6 +614,7 @@ describe('PlayerLocalTestAudioAPI', function () { ...@@ -627,6 +614,7 @@ describe('PlayerLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_PLAYER_AudioPlayer_Release_API_0400', 0, async function (done) { it('SUB_MEDIA_PLAYER_AudioPlayer_Release_API_0400', 0, async function (done) {
let mySteps = new Array(SRC_STATE, PLAY_STATE, RESET_STATE, RELEASE_STATE, END_STATE); let mySteps = new Array(SRC_STATE, PLAY_STATE, RESET_STATE, RELEASE_STATE, END_STATE);
initAudioPlayer(); initAudioPlayer();
...@@ -642,6 +630,7 @@ describe('PlayerLocalTestAudioAPI', function () { ...@@ -642,6 +630,7 @@ describe('PlayerLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_PLAYER_AudioPlayer_Time_API_0100', 0, async function (done) { it('SUB_MEDIA_PLAYER_AudioPlayer_Time_API_0100', 0, async function (done) {
initAudioPlayer(); initAudioPlayer();
expect(audioPlayer.src).assertEqual(undefined); expect(audioPlayer.src).assertEqual(undefined);
...@@ -660,6 +649,7 @@ describe('PlayerLocalTestAudioAPI', function () { ...@@ -660,6 +649,7 @@ describe('PlayerLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_PLAYER_AudioPlayer_Time_API_0200', 0, async function (done) { it('SUB_MEDIA_PLAYER_AudioPlayer_Time_API_0200', 0, async function (done) {
initAudioPlayer(); initAudioPlayer();
audioPlayer.src = AUDIO_SOURCE; audioPlayer.src = AUDIO_SOURCE;
......
...@@ -2,11 +2,21 @@ ...@@ -2,11 +2,21 @@
"description": "Configuration for audioRecorder Tests", "description": "Configuration for audioRecorder Tests",
"driver": { "driver": {
"type": "JSUnitTest", "type": "JSUnitTest",
"test-timeout": "3000000", "test-timeout": "1000000",
"package": "ohos.acts.multimedia.audio.audiorecorder", "package": "ohos.acts.multimedia.audio.audiorecorder",
"shell-timeout": "60000" "shell-timeout": "60000"
}, },
"kits": [ "kits": [
{
"type": "ShellKit",
"run-command": [
"chmod -R 777 /data/accounts/account_0/appdata/recorder/*",
"setenforce 0"
],
"teardown-command":[
"setenforce 1"
]
},
{ {
"test-file-name": [ "test-file-name": [
"AudioRecorderJsTest.hap" "AudioRecorderJsTest.hap"
......
{ {
"app": { "app": {
"bundleName": "ohos.acts.multimedia.audio.audiorecorder",
"vendor": "acts",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": { "apiVersion": {
"compatible": 6, "compatible": 6,
"target": 5 "releaseType": "Beta1",
} "target": 7
},
"vendor": "acts",
"bundleName": "ohos.acts.multimedia.audio.audiorecorder",
"version": {
"code": 1000000,
"name": "1.0.0"
}
},
"deviceConfig": {
"default": {
"debug": true
}
}, },
"deviceConfig": {},
"module": { "module": {
"package": "ohos.acts.multimedia.audio.audiorecorder", "abilities": [
"name": ".MyApplication",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry"
},
"abilities": [
{
"skills": [
{ {
"entities": [ "iconId": 16777218,
"entity.system.home" "skills": [
], {
"actions": [ "entities": [
"action.system.home" "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"
} }
], ],
"visible": true, "deviceType": [
"name": "ohos.acts.multimedia.audio.audiorecorder.MainAbility", "phone",
"icon": "$media:icon", "tablet",
"description": "$string:mainability_description", "tv",
"label": "$string:entry_MainAbility", "wearable"
"type": "page", ],
"launchType": "standard" "mainAbility": "ohos.acts.multimedia.audio.audiorecorder.MainAbility",
} "distro": {
], "moduleType": "entry",
"js": [ "installationFree": false,
{ "deliveryWithInstall": true,
"pages": [ "moduleName": "entry"
"pages/index/index" },
], "package": "ohos.acts.multimedia.audio.audiorecorder",
"name": "default", "name": ".MyApplication",
"window": { "js": [
"designWidth": 720, {
"autoDesignWidth": true "pages": [
} "pages/index/index"
} ],
] "name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": true
}
}
]
} }
} }
\ No newline at end of file
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ohos.acts.multimedia.audio.audioplayer;
import ohos.ace.ability.AceAbility;
import ohos.aafwk.content.Intent;
/*
* java MainAbility
*/
public class MainAbility extends AceAbility {
@Override
public void onStart(Intent intent) {
super.onStart(intent);
}
@Override
public void onStop() {
super.onStop();
}
}
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ohos.acts.multimedia.audio.audioplayer;
import ohos.aafwk.ability.AbilityPackage;
/*
* java MyApplication
*/
public class MyApplication extends AbilityPackage {
@Override
public void onInitialize() {
super.onInitialize();
}
}
...@@ -52,10 +52,10 @@ describe('RecorderLocalTestAudioAPI', function () { ...@@ -52,10 +52,10 @@ describe('RecorderLocalTestAudioAPI', function () {
audioRecorder = media.createAudioRecorder(); audioRecorder = media.createAudioRecorder();
} }
function nextStep(mySteps) { function nextStep(mySteps,done) {
if (mySteps[0] == END_STATE) { if (mySteps[0] == END_STATE) {
console.info('case end!!!'); done();
isTimeOut = true; console.info('case to done');
return; return;
} }
switch (mySteps[0]) { switch (mySteps[0]) {
...@@ -95,72 +95,58 @@ describe('RecorderLocalTestAudioAPI', function () { ...@@ -95,72 +95,58 @@ describe('RecorderLocalTestAudioAPI', function () {
} }
} }
function setErrorCallback(mySteps) { function setCallback(mySteps, done) {
audioRecorder.on('error', (err) => {
console.info(`case error called,errName is ${err.name}`);
console.info(`case error called,errCode is ${err.code}`);
console.info(`case error called,errMessage is ${err.message}`);
console.info('case err returned in error() case callback');
mySteps.shift();
expect(mySteps[0]).assertEqual(ERROR_STATE);
mySteps.shift();
nextStep(mySteps);
});
}
function setCallback(mySteps, done) {
audioRecorder.on('prepare', () => { audioRecorder.on('prepare', () => {
console.info('setCallback prepare() case callback is called'); console.info('setCallback prepare() case callback is called');
mySteps.shift(); mySteps.shift();
nextStep(mySteps); nextStep(mySteps,done);
}); });
audioRecorder.on('start', () => { audioRecorder.on('start', () => {
console.info('setCallback start() case callback is called'); console.info('setCallback start() case callback is called');
sleep(RECORDER_TIME);
mySteps.shift(); mySteps.shift();
nextStep(mySteps); nextStep(mySteps,done);
}); });
audioRecorder.on('pause', () => { audioRecorder.on('pause', () => {
console.info('setCallback pause() case callback is called'); console.info('setCallback pause() case callback is called');
mySteps.shift(); mySteps.shift();
nextStep(mySteps); nextStep(mySteps,done);
}); });
audioRecorder.on('resume', () => { audioRecorder.on('resume', () => {
console.info('setCallback resume() case callback is called'); console.info('setCallback resume() case callback is called');
mySteps.shift(); mySteps.shift();
nextStep(mySteps); nextStep(mySteps,done);
}); });
audioRecorder.on('stop', () => { audioRecorder.on('stop', () => {
console.info('setCallback stop() case callback is called'); console.info('setCallback stop() case callback is called');
mySteps.shift(); mySteps.shift();
nextStep(mySteps); nextStep(mySteps,done);
}); });
audioRecorder.on('reset', () => { audioRecorder.on('reset', () => {
console.info('setCallback reset() case callback is called'); console.info('setCallback reset() case callback is called');
mySteps.shift(); mySteps.shift();
nextStep(mySteps); nextStep(mySteps,done);
}); });
audioRecorder.on('release', () => { audioRecorder.on('release', () => {
console.info('setCallback release() case callback is called'); console.info('setCallback release() case callback is called');
mySteps.shift(); mySteps.shift();
nextStep(mySteps); nextStep(mySteps,done);
audioRecorder = undefined;
}); });
audioRecorder.on('error', (err) => {
setErrorCallback(mySteps); console.info(`case error called,errName is ${err.name}`);
setTimeout(function() { console.info(`case error called,errCode is ${err.code}`);
if (!isTimeOut) { console.info(`case error called,errMessage is ${err.message}`);
console.info('case is time out!'); mySteps.shift();
expect(isTimeOut).assertTrue(); expect(mySteps[0]).assertEqual(ERROR_STATE);
} mySteps.shift();
mySteps = undefined; nextStep(mySteps,done);
done(); });
}, TIME_OUT);
} }
beforeAll(function () { beforeAll(function () {
...@@ -188,6 +174,7 @@ describe('RecorderLocalTestAudioAPI', function () { ...@@ -188,6 +174,7 @@ describe('RecorderLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_RECORDER_createAudioRecorder_API_0100', 0, async function (done) { it('SUB_MEDIA_RECORDER_createAudioRecorder_API_0100', 0, async function (done) {
let testAudioRecorder; let testAudioRecorder;
expect(testAudioRecorder).assertNull(); expect(testAudioRecorder).assertNull();
...@@ -204,6 +191,7 @@ describe('RecorderLocalTestAudioAPI', function () { ...@@ -204,6 +191,7 @@ describe('RecorderLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_RECORDER_AudioRecorder_Prepare_API_0100', 0, async function (done) { it('SUB_MEDIA_RECORDER_AudioRecorder_Prepare_API_0100', 0, async function (done) {
let testAudioRecorder= media.createAudioRecorder(); let testAudioRecorder= media.createAudioRecorder();
expect(testAudioRecorder != null).assertTrue(); expect(testAudioRecorder != null).assertTrue();
...@@ -219,6 +207,7 @@ describe('RecorderLocalTestAudioAPI', function () { ...@@ -219,6 +207,7 @@ describe('RecorderLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_RECORDER_AudioRecorder_Prepare_API_0200', 0, async function (done) { it('SUB_MEDIA_RECORDER_AudioRecorder_Prepare_API_0200', 0, async function (done) {
initAudioRecorder(); initAudioRecorder();
let mySteps = new Array(START_STATE, ERROR_STATE, PRE_STATE, END_STATE); let mySteps = new Array(START_STATE, ERROR_STATE, PRE_STATE, END_STATE);
...@@ -234,6 +223,7 @@ describe('RecorderLocalTestAudioAPI', function () { ...@@ -234,6 +223,7 @@ describe('RecorderLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_RECORDER_AudioRecorder_Prepare_API_0500', 0, async function (done) { it('SUB_MEDIA_RECORDER_AudioRecorder_Prepare_API_0500', 0, async function (done) {
initAudioRecorder(); initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RESET_STATE, PRE_STATE, END_STATE); let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RESET_STATE, PRE_STATE, END_STATE);
...@@ -249,6 +239,7 @@ describe('RecorderLocalTestAudioAPI', function () { ...@@ -249,6 +239,7 @@ describe('RecorderLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_RECORDER_AudioRecorder_Prepare_API_0600', 0, async function (done) { it('SUB_MEDIA_RECORDER_AudioRecorder_Prepare_API_0600', 0, async function (done) {
initAudioRecorder(); initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, PRE_STATE, END_STATE); let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, PRE_STATE, END_STATE);
...@@ -264,6 +255,7 @@ describe('RecorderLocalTestAudioAPI', function () { ...@@ -264,6 +255,7 @@ describe('RecorderLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_RECORDER_AudioRecorder_Prepare_API_0800', 0, async function (done) { it('SUB_MEDIA_RECORDER_AudioRecorder_Prepare_API_0800', 0, async function (done) {
initAudioRecorder(); initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PRE_STATE, ERROR_STATE, STOP_STATE, let mySteps = new Array(PRE_STATE, START_STATE, PRE_STATE, ERROR_STATE, STOP_STATE,
...@@ -280,6 +272,7 @@ describe('RecorderLocalTestAudioAPI', function () { ...@@ -280,6 +272,7 @@ describe('RecorderLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_RECORDER_AudioRecorder_Prepare_API_0900', 0, async function (done) { it('SUB_MEDIA_RECORDER_AudioRecorder_Prepare_API_0900', 0, async function (done) {
initAudioRecorder(); initAudioRecorder();
let mySteps = new Array(PRE_STATE, PRE_STATE, ERROR_STATE, PRE_STATE, ERROR_STATE, END_STATE); let mySteps = new Array(PRE_STATE, PRE_STATE, ERROR_STATE, PRE_STATE, ERROR_STATE, END_STATE);
...@@ -295,6 +288,7 @@ describe('RecorderLocalTestAudioAPI', function () { ...@@ -295,6 +288,7 @@ describe('RecorderLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_RECORDER_AudioRecorder_Start_API_0100', 0, async function (done) { it('SUB_MEDIA_RECORDER_AudioRecorder_Start_API_0100', 0, async function (done) {
initAudioRecorder(); initAudioRecorder();
let mySteps = new Array(START_STATE, ERROR_STATE, END_STATE); let mySteps = new Array(START_STATE, ERROR_STATE, END_STATE);
...@@ -310,6 +304,7 @@ describe('RecorderLocalTestAudioAPI', function () { ...@@ -310,6 +304,7 @@ describe('RecorderLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_RECORDER_AudioRecorder_Start_API_0200', 0, async function (done) { it('SUB_MEDIA_RECORDER_AudioRecorder_Start_API_0200', 0, async function (done) {
initAudioRecorder(); initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, END_STATE); let mySteps = new Array(PRE_STATE, START_STATE, END_STATE);
...@@ -325,6 +320,7 @@ describe('RecorderLocalTestAudioAPI', function () { ...@@ -325,6 +320,7 @@ describe('RecorderLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_RECORDER_AudioRecorder_Start_API_0500', 0, async function (done) { it('SUB_MEDIA_RECORDER_AudioRecorder_Start_API_0500', 0, async function (done) {
initAudioRecorder(); initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, START_STATE, ERROR_STATE, END_STATE); let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, START_STATE, ERROR_STATE, END_STATE);
...@@ -340,6 +336,7 @@ describe('RecorderLocalTestAudioAPI', function () { ...@@ -340,6 +336,7 @@ describe('RecorderLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_RECORDER_AudioRecorder_Start_API_0600', 0, async function (done) { it('SUB_MEDIA_RECORDER_AudioRecorder_Start_API_0600', 0, async function (done) {
initAudioRecorder(); initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, START_STATE, ERROR_STATE, END_STATE); let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, START_STATE, ERROR_STATE, END_STATE);
...@@ -355,6 +352,7 @@ describe('RecorderLocalTestAudioAPI', function () { ...@@ -355,6 +352,7 @@ describe('RecorderLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_RECORDER_AudioRecorder_Start_API_0800', 0, async function (done) { it('SUB_MEDIA_RECORDER_AudioRecorder_Start_API_0800', 0, async function (done) {
initAudioRecorder(); initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, START_STATE, ERROR_STATE, let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, START_STATE, ERROR_STATE,
...@@ -371,6 +369,7 @@ describe('RecorderLocalTestAudioAPI', function () { ...@@ -371,6 +369,7 @@ describe('RecorderLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_RECORDER_AudioRecorder_Start_API_0900', 0, async function (done) { it('SUB_MEDIA_RECORDER_AudioRecorder_Start_API_0900', 0, async function (done) {
initAudioRecorder(); initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, START_STATE, START_STATE, END_STATE); let mySteps = new Array(PRE_STATE, START_STATE, START_STATE, START_STATE, END_STATE);
...@@ -386,6 +385,7 @@ describe('RecorderLocalTestAudioAPI', function () { ...@@ -386,6 +385,7 @@ describe('RecorderLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_RECORDER_AudioRecorder_Stop_API_0100', 0, async function (done) { it('SUB_MEDIA_RECORDER_AudioRecorder_Stop_API_0100', 0, async function (done) {
initAudioRecorder(); initAudioRecorder();
let mySteps = new Array(STOP_STATE, ERROR_STATE, END_STATE); let mySteps = new Array(STOP_STATE, ERROR_STATE, END_STATE);
...@@ -401,6 +401,7 @@ describe('RecorderLocalTestAudioAPI', function () { ...@@ -401,6 +401,7 @@ describe('RecorderLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_RECORDER_AudioRecorder_Stop_API_0200', 0, async function (done) { it('SUB_MEDIA_RECORDER_AudioRecorder_Stop_API_0200', 0, async function (done) {
initAudioRecorder(); initAudioRecorder();
let mySteps = new Array(PRE_STATE, STOP_STATE, ERROR_STATE, END_STATE); let mySteps = new Array(PRE_STATE, STOP_STATE, ERROR_STATE, END_STATE);
...@@ -416,6 +417,7 @@ describe('RecorderLocalTestAudioAPI', function () { ...@@ -416,6 +417,7 @@ describe('RecorderLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_RECORDER_AudioRecorder_Stop_API_0300', 0, async function (done) { it('SUB_MEDIA_RECORDER_AudioRecorder_Stop_API_0300', 0, async function (done) {
initAudioRecorder(); initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, END_STATE); let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, END_STATE);
...@@ -431,6 +433,7 @@ describe('RecorderLocalTestAudioAPI', function () { ...@@ -431,6 +433,7 @@ describe('RecorderLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_RECORDER_AudioRecorder_Stop_API_0600', 0, async function (done) { it('SUB_MEDIA_RECORDER_AudioRecorder_Stop_API_0600', 0, async function (done) {
initAudioRecorder(); initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, STOP_STATE, ERROR_STATE, END_STATE); let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, STOP_STATE, ERROR_STATE, END_STATE);
...@@ -446,6 +449,7 @@ describe('RecorderLocalTestAudioAPI', function () { ...@@ -446,6 +449,7 @@ describe('RecorderLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_RECORDER_AudioRecorder_Stop_API_0800', 0, async function (done) { it('SUB_MEDIA_RECORDER_AudioRecorder_Stop_API_0800', 0, async function (done) {
initAudioRecorder(); initAudioRecorder();
let mySteps = new Array(PRE_STATE, STOP_STATE, ERROR_STATE, RESET_STATE, PRE_STATE, START_STATE, STOP_STATE, let mySteps = new Array(PRE_STATE, STOP_STATE, ERROR_STATE, RESET_STATE, PRE_STATE, START_STATE, STOP_STATE,
...@@ -462,6 +466,7 @@ describe('RecorderLocalTestAudioAPI', function () { ...@@ -462,6 +466,7 @@ describe('RecorderLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_RECORDER_AudioRecorder_Stop_API_0900', 0, async function (done) { it('SUB_MEDIA_RECORDER_AudioRecorder_Stop_API_0900', 0, async function (done) {
initAudioRecorder(); initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, STOP_STATE, ERROR_STATE, let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, STOP_STATE, ERROR_STATE,
...@@ -478,6 +483,7 @@ describe('RecorderLocalTestAudioAPI', function () { ...@@ -478,6 +483,7 @@ describe('RecorderLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_RECORDER_AudioRecorder_Reset_API_0100', 0, async function (done) { it('SUB_MEDIA_RECORDER_AudioRecorder_Reset_API_0100', 0, async function (done) {
initAudioRecorder(); initAudioRecorder();
let mySteps = new Array(RESET_STATE, END_STATE); let mySteps = new Array(RESET_STATE, END_STATE);
...@@ -493,6 +499,7 @@ describe('RecorderLocalTestAudioAPI', function () { ...@@ -493,6 +499,7 @@ describe('RecorderLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_RECORDER_AudioRecorder_Reset_API_0200', 0, async function (done) { it('SUB_MEDIA_RECORDER_AudioRecorder_Reset_API_0200', 0, async function (done) {
initAudioRecorder(); initAudioRecorder();
let mySteps = new Array(PRE_STATE, RESET_STATE, END_STATE); let mySteps = new Array(PRE_STATE, RESET_STATE, END_STATE);
...@@ -508,6 +515,7 @@ describe('RecorderLocalTestAudioAPI', function () { ...@@ -508,6 +515,7 @@ describe('RecorderLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_RECORDER_AudioRecorder_Reset_API_0300', 0, async function (done) { it('SUB_MEDIA_RECORDER_AudioRecorder_Reset_API_0300', 0, async function (done) {
initAudioRecorder(); initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, END_STATE); let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, END_STATE);
...@@ -523,6 +531,7 @@ describe('RecorderLocalTestAudioAPI', function () { ...@@ -523,6 +531,7 @@ describe('RecorderLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_RECORDER_AudioRecorder_Reset_API_0600', 0, async function (done) { it('SUB_MEDIA_RECORDER_AudioRecorder_Reset_API_0600', 0, async function (done) {
initAudioRecorder(); initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RESET_STATE, END_STATE); let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RESET_STATE, END_STATE);
...@@ -538,6 +547,7 @@ describe('RecorderLocalTestAudioAPI', function () { ...@@ -538,6 +547,7 @@ describe('RecorderLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_RECORDER_AudioRecorder_Reset_API_0800', 0, async function (done) { it('SUB_MEDIA_RECORDER_AudioRecorder_Reset_API_0800', 0, async function (done) {
initAudioRecorder(); initAudioRecorder();
let mySteps = new Array(PRE_STATE, RESET_STATE, PRE_STATE, START_STATE, RESET_STATE, PRE_STATE, START_STATE, let mySteps = new Array(PRE_STATE, RESET_STATE, PRE_STATE, START_STATE, RESET_STATE, PRE_STATE, START_STATE,
...@@ -554,6 +564,7 @@ describe('RecorderLocalTestAudioAPI', function () { ...@@ -554,6 +564,7 @@ describe('RecorderLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_RECORDER_AudioRecorder_Reset_API_0900', 0, async function (done) { it('SUB_MEDIA_RECORDER_AudioRecorder_Reset_API_0900', 0, async function (done) {
initAudioRecorder(); initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, RESET_STATE, RESET_STATE, END_STATE); let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, RESET_STATE, RESET_STATE, END_STATE);
...@@ -569,6 +580,7 @@ describe('RecorderLocalTestAudioAPI', function () { ...@@ -569,6 +580,7 @@ describe('RecorderLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_RECORDER_AudioRecorder_Release_API_0100', 0, async function (done) { it('SUB_MEDIA_RECORDER_AudioRecorder_Release_API_0100', 0, async function (done) {
initAudioRecorder(); initAudioRecorder();
let mySteps = new Array(RELEASE_STATE, END_STATE); let mySteps = new Array(RELEASE_STATE, END_STATE);
...@@ -584,6 +596,7 @@ describe('RecorderLocalTestAudioAPI', function () { ...@@ -584,6 +596,7 @@ describe('RecorderLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_RECORDER_AudioRecorder_Release_API_0200', 0, async function (done) { it('SUB_MEDIA_RECORDER_AudioRecorder_Release_API_0200', 0, async function (done) {
initAudioRecorder(); initAudioRecorder();
let mySteps = new Array(PRE_STATE, RELEASE_STATE, END_STATE); let mySteps = new Array(PRE_STATE, RELEASE_STATE, END_STATE);
...@@ -599,6 +612,7 @@ describe('RecorderLocalTestAudioAPI', function () { ...@@ -599,6 +612,7 @@ describe('RecorderLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_RECORDER_AudioRecorder_Release_API_0300', 0, async function (done) { it('SUB_MEDIA_RECORDER_AudioRecorder_Release_API_0300', 0, async function (done) {
initAudioRecorder(); initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, RELEASE_STATE, END_STATE); let mySteps = new Array(PRE_STATE, START_STATE, RELEASE_STATE, END_STATE);
...@@ -614,6 +628,7 @@ describe('RecorderLocalTestAudioAPI', function () { ...@@ -614,6 +628,7 @@ describe('RecorderLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_RECORDER_AudioRecorder_Release_API_0600', 0, async function (done) { it('SUB_MEDIA_RECORDER_AudioRecorder_Release_API_0600', 0, async function (done) {
initAudioRecorder(); initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE, END_STATE); let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE, END_STATE);
...@@ -629,6 +644,7 @@ describe('RecorderLocalTestAudioAPI', function () { ...@@ -629,6 +644,7 @@ describe('RecorderLocalTestAudioAPI', function () {
* @tc.type : Reliability * @tc.type : Reliability
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_RECORDER_AudioRecorder_Release_API_0700', 0, async function (done) { it('SUB_MEDIA_RECORDER_AudioRecorder_Release_API_0700', 0, async function (done) {
initAudioRecorder(); initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, RELEASE_STATE, END_STATE); let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, RELEASE_STATE, END_STATE);
......
...@@ -77,9 +77,10 @@ describe('RecorderLocalTestAudioFUNC', function () { ...@@ -77,9 +77,10 @@ describe('RecorderLocalTestAudioFUNC', function () {
console.info('afterAll case'); console.info('afterAll case');
}) })
function nextStep(mySteps) { function nextStep(mySteps,done) {
if (mySteps[0] == END_STATE) { if (mySteps[0] == END_STATE) {
isTimeOut = true; done();
console.info('case to done');
return; return;
} }
switch (mySteps[0]) { switch (mySteps[0]) {
...@@ -118,72 +119,59 @@ describe('RecorderLocalTestAudioFUNC', function () { ...@@ -118,72 +119,59 @@ describe('RecorderLocalTestAudioFUNC', function () {
break; break;
} }
} }
function setErrorCallback(mySteps) {
audioRecorder.on('error', (err) => {
console.info(`case error called,errName is ${err.name}`);
console.info(`case error called,errCode is ${err.code}`);
console.info(`case error called,errMessage is ${err.message}`);
mySteps.shift();
expect(mySteps[0]).assertEqual(ERROR_STATE);
mySteps.shift();
nextStep(mySteps);
});
}
function setCallback(mySteps, done) { function setCallback(mySteps, done) {
audioRecorder.on('prepare', () => { audioRecorder.on('prepare', () => {
console.info('setCallback prepare() case callback is called'); console.info('setCallback prepare() case callback is called');
mySteps.shift(); mySteps.shift();
nextStep(mySteps); nextStep(mySteps,done);
}); });
audioRecorder.on('start', () => { audioRecorder.on('start', () => {
console.info('setCallback start() case callback is called'); console.info('setCallback start() case callback is called');
sleep(RECORDER_TIME); sleep(RECORDER_TIME);
mySteps.shift(); mySteps.shift();
nextStep(mySteps); nextStep(mySteps,done);
}); });
audioRecorder.on('pause', () => { audioRecorder.on('pause', () => {
console.info('setCallback pause() case callback is called'); console.info('setCallback pause() case callback is called');
mySteps.shift(); mySteps.shift();
nextStep(mySteps); nextStep(mySteps,done);
}); });
audioRecorder.on('resume', () => { audioRecorder.on('resume', () => {
console.info('setCallback resume() case callback is called'); console.info('setCallback resume() case callback is called');
mySteps.shift(); mySteps.shift();
nextStep(mySteps); nextStep(mySteps,done);
}); });
audioRecorder.on('stop', () => { audioRecorder.on('stop', () => {
console.info('setCallback stop() case callback is called'); console.info('setCallback stop() case callback is called');
mySteps.shift(); mySteps.shift();
nextStep(mySteps); nextStep(mySteps,done);
}); });
audioRecorder.on('reset', () => { audioRecorder.on('reset', () => {
console.info('setCallback reset() case callback is called'); console.info('setCallback reset() case callback is called');
mySteps.shift(); mySteps.shift();
nextStep(mySteps); nextStep(mySteps,done);
}); });
audioRecorder.on('release', () => { audioRecorder.on('release', () => {
console.info('setCallback release() case callback is called'); console.info('setCallback release() case callback is called');
mySteps.shift(); mySteps.shift();
nextStep(mySteps); nextStep(mySteps,done);
}); });
audioRecorder.on('error', (err) => {
setErrorCallback(mySteps); console.info(`case error called,errName is ${err.name}`);
setTimeout(function() { console.info(`case error called,errCode is ${err.code}`);
if (!isTimeOut) { console.info(`case error called,errMessage is ${err.message}`);
console.info('case is time out!'); mySteps.shift();
expect(isTimeOut).assertTrue(); expect(mySteps[0]).assertEqual(ERROR_STATE);
} mySteps.shift();
mySteps = undefined; nextStep(mySteps,done);
done(); });
}, TIME_OUT);
} }
/* * /* *
...@@ -194,6 +182,7 @@ describe('RecorderLocalTestAudioFUNC', function () { ...@@ -194,6 +182,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
* @tc.type : Function * @tc.type : Function
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_RECORDER_Codec_AAC_Function_0100', 0, async function (done) { it('SUB_MEDIA_RECORDER_Codec_AAC_Function_0100', 0, async function (done) {
audioConfig.uri = BASIC_PATH + 'test1.m4a'; audioConfig.uri = BASIC_PATH + 'test1.m4a';
initAudioRecorder(); initAudioRecorder();
...@@ -210,6 +199,7 @@ describe('RecorderLocalTestAudioFUNC', function () { ...@@ -210,6 +199,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
* @tc.type : Function * @tc.type : Function
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_RECORDER_Codec_AAC_Function_0210', 0, async function (done) { it('SUB_MEDIA_RECORDER_Codec_AAC_Function_0210', 0, async function (done) {
audioConfig.uri = BASIC_PATH + 'test2.m4a'; audioConfig.uri = BASIC_PATH + 'test2.m4a';
audioConfig.numberOfChannels = CHANNEL_ONE; audioConfig.numberOfChannels = CHANNEL_ONE;
...@@ -227,6 +217,7 @@ describe('RecorderLocalTestAudioFUNC', function () { ...@@ -227,6 +217,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
* @tc.type : Function * @tc.type : Function
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_RECORDER_Codec_AAC_Function_0220', 0, async function (done) { it('SUB_MEDIA_RECORDER_Codec_AAC_Function_0220', 0, async function (done) {
audioConfig.uri = BASIC_PATH + 'test3.m4a'; audioConfig.uri = BASIC_PATH + 'test3.m4a';
audioConfig.numberOfChannels = CHANNEL_TWO; audioConfig.numberOfChannels = CHANNEL_TWO;
...@@ -244,6 +235,7 @@ describe('RecorderLocalTestAudioFUNC', function () { ...@@ -244,6 +235,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
* @tc.type : Function * @tc.type : Function
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_RECORDER_Codec_AAC_Function_0310', 0, async function (done) { it('SUB_MEDIA_RECORDER_Codec_AAC_Function_0310', 0, async function (done) {
audioConfig.uri = BASIC_PATH + 'test4.m4a'; audioConfig.uri = BASIC_PATH + 'test4.m4a';
audioConfig.audioSampleRate = 8000; // samplerate 8000 audioConfig.audioSampleRate = 8000; // samplerate 8000
...@@ -262,6 +254,7 @@ describe('RecorderLocalTestAudioFUNC', function () { ...@@ -262,6 +254,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
* @tc.type : Function * @tc.type : Function
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_RECORDER_Codec_AAC_Function_0320', 0, async function (done) { it('SUB_MEDIA_RECORDER_Codec_AAC_Function_0320', 0, async function (done) {
audioConfig.uri = BASIC_PATH + 'test5.mp4'; audioConfig.uri = BASIC_PATH + 'test5.mp4';
audioConfig.audioSampleRate = 32000; // samplerate 32000 audioConfig.audioSampleRate = 32000; // samplerate 32000
...@@ -281,6 +274,7 @@ describe('RecorderLocalTestAudioFUNC', function () { ...@@ -281,6 +274,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
* @tc.type : Function * @tc.type : Function
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_RECORDER_Codec_AAC_Function_0330', 0, async function (done) { it('SUB_MEDIA_RECORDER_Codec_AAC_Function_0330', 0, async function (done) {
audioConfig.uri = BASIC_PATH + 'test6.mp4'; audioConfig.uri = BASIC_PATH + 'test6.mp4';
audioConfig.audioSampleRate = 44100; // samplerate 44100 audioConfig.audioSampleRate = 44100; // samplerate 44100
...@@ -300,6 +294,7 @@ describe('RecorderLocalTestAudioFUNC', function () { ...@@ -300,6 +294,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
* @tc.type : Function * @tc.type : Function
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_RECORDER_Codec_AAC_Function_0340', 0, async function (done) { it('SUB_MEDIA_RECORDER_Codec_AAC_Function_0340', 0, async function (done) {
audioConfig.uri = BASIC_PATH + 'test7.m4a'; audioConfig.uri = BASIC_PATH + 'test7.m4a';
audioConfig.audioSampleRate = 64000; // samplerate 64000 audioConfig.audioSampleRate = 64000; // samplerate 64000
...@@ -319,6 +314,7 @@ describe('RecorderLocalTestAudioFUNC', function () { ...@@ -319,6 +314,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
* @tc.type : Function * @tc.type : Function
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_RECORDER_Codec_AAC_Function_0340', 0, async function (done) { it('SUB_MEDIA_RECORDER_Codec_AAC_Function_0340', 0, async function (done) {
audioConfig.uri = BASIC_PATH + 'test8.m4a'; audioConfig.uri = BASIC_PATH + 'test8.m4a';
audioConfig.audioSampleRate = 96000; // samplerate 96000 audioConfig.audioSampleRate = 96000; // samplerate 96000
...@@ -338,6 +334,7 @@ describe('RecorderLocalTestAudioFUNC', function () { ...@@ -338,6 +334,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
* @tc.type : Function * @tc.type : Function
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_RECORDER_Codec_AAC_Function_0410', 0, async function (done) { it('SUB_MEDIA_RECORDER_Codec_AAC_Function_0410', 0, async function (done) {
audioConfig.uri = BASIC_PATH + 'test9.mp4'; audioConfig.uri = BASIC_PATH + 'test9.mp4';
audioConfig.audioSampleRate = 22050; // samplerate 22050 audioConfig.audioSampleRate = 22050; // samplerate 22050
...@@ -358,6 +355,7 @@ describe('RecorderLocalTestAudioFUNC', function () { ...@@ -358,6 +355,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
* @tc.type : Function * @tc.type : Function
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_RECORDER_Codec_AAC_Function_0420', 0, async function (done) { it('SUB_MEDIA_RECORDER_Codec_AAC_Function_0420', 0, async function (done) {
audioConfig.uri = BASIC_PATH + 'test10.mp4'; audioConfig.uri = BASIC_PATH + 'test10.mp4';
audioConfig.audioSampleRate = 44100; // samplerate 44100 audioConfig.audioSampleRate = 44100; // samplerate 44100
...@@ -378,6 +376,7 @@ describe('RecorderLocalTestAudioFUNC', function () { ...@@ -378,6 +376,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
* @tc.type : Function * @tc.type : Function
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_RECORDER_Codec_AAC_Function_0430', 0, async function (done) { it('SUB_MEDIA_RECORDER_Codec_AAC_Function_0430', 0, async function (done) {
audioConfig.uri = BASIC_PATH + 'test11.m4a'; audioConfig.uri = BASIC_PATH + 'test11.m4a';
audioConfig.audioSampleRate = 44100; // samplerate 44100 audioConfig.audioSampleRate = 44100; // samplerate 44100
...@@ -398,6 +397,7 @@ describe('RecorderLocalTestAudioFUNC', function () { ...@@ -398,6 +397,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
* @tc.type : Function * @tc.type : Function
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_RECORDER_Codec_AAC_Function_0440', 0, async function (done) { it('SUB_MEDIA_RECORDER_Codec_AAC_Function_0440', 0, async function (done) {
audioConfig.uri = BASIC_PATH + 'test12.m4a'; audioConfig.uri = BASIC_PATH + 'test12.m4a';
audioConfig.audioSampleRate = 44100; // samplerate 44100 audioConfig.audioSampleRate = 44100; // samplerate 44100
...@@ -418,6 +418,7 @@ describe('RecorderLocalTestAudioFUNC', function () { ...@@ -418,6 +418,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
* @tc.type : Function * @tc.type : Function
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_RECORDER_Codec_AAC_Function_0450', 0, async function (done) { it('SUB_MEDIA_RECORDER_Codec_AAC_Function_0450', 0, async function (done) {
audioConfig.uri = BASIC_PATH + 'test13.m4a'; audioConfig.uri = BASIC_PATH + 'test13.m4a';
audioConfig.audioSampleRate = 44100; // samplerate 44100 audioConfig.audioSampleRate = 44100; // samplerate 44100
...@@ -438,6 +439,7 @@ describe('RecorderLocalTestAudioFUNC', function () { ...@@ -438,6 +439,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
* @tc.type : Function * @tc.type : Function
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_RECORDER_Format_MP4_Function_0200', 0, async function (done) { it('SUB_MEDIA_RECORDER_Format_MP4_Function_0200', 0, async function (done) {
audioConfig.uri = BASIC_PATH + 'test14.mp4'; audioConfig.uri = BASIC_PATH + 'test14.mp4';
audioConfig.audioEncodeBitRate = 22050; // samplerate 22050 audioConfig.audioEncodeBitRate = 22050; // samplerate 22050
...@@ -458,6 +460,7 @@ describe('RecorderLocalTestAudioFUNC', function () { ...@@ -458,6 +460,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
* @tc.type : Function * @tc.type : Function
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_RECORDER_Format_MP4_Function_0200', 0, async function (done) { it('SUB_MEDIA_RECORDER_Format_MP4_Function_0200', 0, async function (done) {
audioConfig.uri = BASIC_PATH + 'test15.m4a'; audioConfig.uri = BASIC_PATH + 'test15.m4a';
audioConfig.audioEncodeBitRate = 22050; // samplerate 22050 audioConfig.audioEncodeBitRate = 22050; // samplerate 22050
...@@ -478,6 +481,7 @@ describe('RecorderLocalTestAudioFUNC', function () { ...@@ -478,6 +481,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
* @tc.type : Function * @tc.type : Function
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_RECORDER_LOCAL_AUDIO_Function_06_0100', 0, async function (done) { it('SUB_MEDIA_RECORDER_LOCAL_AUDIO_Function_06_0100', 0, async function (done) {
audioConfig.uri = BASIC_PATH + 'test16.m4a'; audioConfig.uri = BASIC_PATH + 'test16.m4a';
audioConfig.fileFormat = FORMAT_M4A; audioConfig.fileFormat = FORMAT_M4A;
...@@ -495,6 +499,7 @@ describe('RecorderLocalTestAudioFUNC', function () { ...@@ -495,6 +499,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
* @tc.type : Function * @tc.type : Function
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_RECORDER_LOCAL_AUDIO_Function_06_0500', 0, async function (done) { it('SUB_MEDIA_RECORDER_LOCAL_AUDIO_Function_06_0500', 0, async function (done) {
audioConfig.uri = BASIC_PATH + 'test17.m4a'; audioConfig.uri = BASIC_PATH + 'test17.m4a';
audioConfig.fileFormat = FORMAT_M4A; audioConfig.fileFormat = FORMAT_M4A;
...@@ -512,6 +517,7 @@ describe('RecorderLocalTestAudioFUNC', function () { ...@@ -512,6 +517,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
* @tc.type : Function * @tc.type : Function
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_RECORDER_LOCAL_AUDIO_Function_06_1100', 0, async function (done) { it('SUB_MEDIA_RECORDER_LOCAL_AUDIO_Function_06_1100', 0, async function (done) {
audioConfig.uri = BASIC_PATH + 'test18.mp4'; audioConfig.uri = BASIC_PATH + 'test18.mp4';
audioConfig.fileFormat = FORMAT_MP4; audioConfig.fileFormat = FORMAT_MP4;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册