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

!4782 媒体子系统测试用例根据开发代码修改同步修改

Merge pull request !4782 from FULIZHONG/0803master
...@@ -39,7 +39,7 @@ export function playAudioSource(src, duration, playTime, checkSeekTime, done) { ...@@ -39,7 +39,7 @@ export function playAudioSource(src, duration, playTime, checkSeekTime, done) {
} }
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('idle');
expect(audioPlayer.currentTime).assertEqual(0); expect(audioPlayer.currentTime).assertEqual(0);
expect(audioPlayer.duration).assertClose(duration, 500); expect(audioPlayer.duration).assertClose(duration, 500);
// step 0: dataLoad -> play // step 0: dataLoad -> play
......
...@@ -148,7 +148,7 @@ describe('PlayerLocalTestAudioAPI', function () { ...@@ -148,7 +148,7 @@ describe('PlayerLocalTestAudioAPI', function () {
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('idle');
nextStep(mySteps,done); nextStep(mySteps,done);
}); });
audioPlayer.on('play', () => { audioPlayer.on('play', () => {
...@@ -735,7 +735,7 @@ describe('PlayerLocalTestAudioAPI', function () { ...@@ -735,7 +735,7 @@ describe('PlayerLocalTestAudioAPI', function () {
expect(audioPlayer.src).assertEqual(fdHead + fileDescriptor.fd); expect(audioPlayer.src).assertEqual(fdHead + fileDescriptor.fd);
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('idle');
expect(audioPlayer.loop).assertEqual(false); expect(audioPlayer.loop).assertEqual(false);
done(); done();
}) })
......
...@@ -194,7 +194,7 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -194,7 +194,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
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('idle');
nextStep(mySteps, done); nextStep(mySteps, done);
}); });
audioPlayer.on('play', () => { audioPlayer.on('play', () => {
...@@ -316,7 +316,40 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -316,7 +316,40 @@ describe('PlayerLocalTestAudioFUNC', function () {
VOLUME_STATE, MAX_VOLUME, RESET_STATE, RELEASE_STATE, END_STATE); VOLUME_STATE, MAX_VOLUME, RESET_STATE, RELEASE_STATE, END_STATE);
initAudioPlayer(); initAudioPlayer();
setCallback(mySteps, done); setCallback(mySteps, done);
audioPlayer.src = fdPath; audioPlayer.src = fdPath;
})
/* *
* @tc.number : SUB_MEDIA_PLAYER_LOCAL_AUDIO_FUNCTION_SEEK
* @tc.name : 001.test seek mode 0 / 0.5 * duration/ duration
* @tc.desc : Audio playback control test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_FUNCTION_SEEK', 0, async function (done) {
mediaTestBase.isFileOpen(fileDescriptor, done);
let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, 0, SEEK_STATE,
DURATION_TIME / 2, SEEK_STATE, DURATION_TIME, FINISH_STATE, RELEASE_STATE, END_STATE);
initAudioPlayer();
setCallback(mySteps, done);
audioPlayer.src = fdHead + fileDescriptor.fd;
})
/* *
* @tc.number : SUB_MEDIA_PLAYER_LOCAL_AUDIO_FUNCTION_GETTRECKDESCRIPTION
* @tc.name : 001.test getTrackDescription
* @tc.desc : Audio playback control test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_FUNCTION_GETTRECKDESCRIPTION', 0, async function (done) {
mediaTestBase.isFileOpen(fileDescriptor, done);
let mySteps = new Array(SRC_STATE, GETDESCRIPTION_PROMISE, GETDESCRIPTION_CALLBACK, RELEASE_STATE, END_STATE);
initAudioPlayer();
setCallback(mySteps, done);
audioPlayer.src = fdHead + fileDescriptor.fd;
}) })
/* * /* *
...@@ -342,7 +375,7 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -342,7 +375,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
testAudioPlayer.on('dataLoad', () => { testAudioPlayer.on('dataLoad', () => {
expect(testAudioPlayer.duration).assertEqual(DURATION_TIME); expect(testAudioPlayer.duration).assertEqual(DURATION_TIME);
expect(testAudioPlayer.state).assertEqual('paused'); expect(testAudioPlayer.state).assertEqual('idle');
testAudioPlayer.play(); testAudioPlayer.play();
}); });
testAudioPlayer.on('play', () => { testAudioPlayer.on('play', () => {
......
...@@ -18,7 +18,7 @@ import * as mediaTestBase from '../../../../../MediaTestBase.js'; ...@@ -18,7 +18,7 @@ import * as mediaTestBase from '../../../../../MediaTestBase.js';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
describe('RecorderLocalTestAudioAPI', function () { describe('RecorderLocalTestAudioAPI', function () {
let audioRecorder = media.createAudioRecorder(); let audioRecorder = null;
const END_STATE = 0; const END_STATE = 0;
const PRE_STATE = 1; const PRE_STATE = 1;
const START_STATE = 2; const START_STATE = 2;
...@@ -42,9 +42,9 @@ describe('RecorderLocalTestAudioAPI', function () { ...@@ -42,9 +42,9 @@ describe('RecorderLocalTestAudioAPI', function () {
fileFormat : media.ContainerFormatType.CFT_MPEG_4A, fileFormat : media.ContainerFormatType.CFT_MPEG_4A,
} }
function initAudioRecorder() { function initAudioRecorder() {
if (typeof (audioRecorder) != 'undefined') { if (audioRecorder != null) {
audioRecorder.release(); audioRecorder.release();
audioRecorder = undefined; audioRecorder = null;
} }
audioRecorder = media.createAudioRecorder(); audioRecorder = media.createAudioRecorder();
} }
...@@ -83,7 +83,7 @@ describe('RecorderLocalTestAudioAPI', function () { ...@@ -83,7 +83,7 @@ describe('RecorderLocalTestAudioAPI', function () {
case RELEASE_STATE: case RELEASE_STATE:
console.info('case to release'); console.info('case to release');
audioRecorder.release(); audioRecorder.release();
audioRecorder = undefined; audioRecorder = null;
break; break;
case ERROR_STATE: case ERROR_STATE:
console.info('case to wait error callback'); console.info('case to wait error callback');
...@@ -138,9 +138,7 @@ describe('RecorderLocalTestAudioAPI', function () { ...@@ -138,9 +138,7 @@ describe('RecorderLocalTestAudioAPI', function () {
nextStep(mySteps,done); nextStep(mySteps,done);
}); });
audioRecorder.on('error', (err) => { 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,errCode is ${err.code}`);
console.info(`case error called,errMessage is ${err.message}`);
mySteps.shift(); mySteps.shift();
expect(mySteps[0]).assertEqual(ERROR_STATE); expect(mySteps[0]).assertEqual(ERROR_STATE);
mySteps.shift(); mySteps.shift();
...@@ -168,36 +166,6 @@ describe('RecorderLocalTestAudioAPI', function () { ...@@ -168,36 +166,6 @@ describe('RecorderLocalTestAudioAPI', function () {
console.info('afterAll case'); console.info('afterAll case');
}) })
/* *
* @tc.number : SUB_MEDIA_RECORDER_createAudioRecorder_API_0100
* @tc.name : Create an AudioRecoder Object by function of createAudioRecorder
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MEDIA_RECORDER_createAudioRecorder_API_0100', 0, async function (done) {
let testAudioRecorder = undefined;
testAudioRecorder= media.createAudioRecorder();
expect(testAudioRecorder != undefined).assertTrue();
done();
})
/* *
* @tc.number : SUB_MEDIA_RECORDER_AudioRecorder_Prepare_API_0100
* @tc.name : 01.creatAudioRecorder->prepare
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MEDIA_RECORDER_AudioRecorder_Prepare_API_0100', 0, async function (done) {
let testAudioRecorder= media.createAudioRecorder();
expect(testAudioRecorder != null).assertTrue();
testAudioRecorder.prepare(audioConfig);
done();
})
/* * /* *
* @tc.number : SUB_MEDIA_RECORDER_AudioRecorder_Prepare_API_0200 * @tc.number : SUB_MEDIA_RECORDER_AudioRecorder_Prepare_API_0200
* @tc.name : 02.start->prepare * @tc.name : 02.start->prepare
...@@ -1000,7 +968,7 @@ describe('RecorderLocalTestAudioAPI', function () { ...@@ -1000,7 +968,7 @@ describe('RecorderLocalTestAudioAPI', function () {
let mySteps = new Array(RELEASE_STATE, END_STATE); let mySteps = new Array(RELEASE_STATE, END_STATE);
setCallback(mySteps, done); setCallback(mySteps, done);
audioRecorder.release(); audioRecorder.release();
audioRecorder = undefined; audioRecorder = null;
}) })
/* * /* *
......
...@@ -19,7 +19,7 @@ import * as videoRecorderBase from '../../../../../VideoRecorderTestBase.js'; ...@@ -19,7 +19,7 @@ import * as videoRecorderBase from '../../../../../VideoRecorderTestBase.js';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
describe('RecorderLocalTestAudioFUNC', function () { describe('RecorderLocalTestAudioFUNC', function () {
let audioRecorder = media.createAudioRecorder(); let audioRecorder = null;
const END_STATE = 0; const END_STATE = 0;
const PRE_STATE = 1; const PRE_STATE = 1;
const START_STATE = 2; const START_STATE = 2;
...@@ -52,9 +52,9 @@ describe('RecorderLocalTestAudioFUNC', function () { ...@@ -52,9 +52,9 @@ describe('RecorderLocalTestAudioFUNC', function () {
} }
function initAudioRecorder() { function initAudioRecorder() {
if (typeof (audioRecorder) != 'undefined') { if (audioRecorder != null) {
audioRecorder.release(); audioRecorder.release();
audioRecorder = undefined; audioRecorder = null;
} }
audioRecorder = media.createAudioRecorder(); audioRecorder = media.createAudioRecorder();
} }
...@@ -110,7 +110,7 @@ describe('RecorderLocalTestAudioFUNC', function () { ...@@ -110,7 +110,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
case RELEASE_STATE: case RELEASE_STATE:
console.info('case to release'); console.info('case to release');
audioRecorder.release(); audioRecorder.release();
audioRecorder = undefined; audioRecorder = null;
break; break;
case CHECK_STATE: case CHECK_STATE:
mySteps.shift(); mySteps.shift();
...@@ -174,9 +174,7 @@ describe('RecorderLocalTestAudioFUNC', function () { ...@@ -174,9 +174,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
nextStep(mySteps, done); nextStep(mySteps, done);
}); });
audioRecorder.on('error', (err) => { 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,errCode is ${err.code}`);
console.info(`case error called,errMessage is ${err.message}`);
mySteps.shift(); mySteps.shift();
expect(mySteps[0]).assertEqual(ERROR_STATE); expect(mySteps[0]).assertEqual(ERROR_STATE);
mySteps.shift(); mySteps.shift();
...@@ -345,7 +343,7 @@ describe('RecorderLocalTestAudioFUNC', function () { ...@@ -345,7 +343,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
* @tc.type : Function * @tc.type : Function
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_RECORDER_CODEC_AAC_0340', 0, async function (done) { it('SUB_MEDIA_RECORDER_CODEC_AAC_0350', 0, async function (done) {
fdObject = await mediaTestBase.getAudioFd('audio_08.m4a'); fdObject = await mediaTestBase.getAudioFd('audio_08.m4a');
fdPath = "fd://" + fdObject.fdNumber.toString(); fdPath = "fd://" + fdObject.fdNumber.toString();
audioConfig.uri = fdPath; audioConfig.uri = fdPath;
......
...@@ -40,6 +40,7 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -40,6 +40,7 @@ describe('VideoPlayerAPICallbackTest', function () {
const SEEK_MODE_EVENT = 'seekMode'; const SEEK_MODE_EVENT = 'seekMode';
const SETVOLUME_EVENT = 'volume'; const SETVOLUME_EVENT = 'volume';
const SETSPEED_EVENT = 'speed'; const SETSPEED_EVENT = 'speed';
const FINISH_EVENT = 'finish';
const ERROR_EVENT = 'error'; const ERROR_EVENT = 'error';
const END_EVENT = 'end'; const END_EVENT = 'end';
const VOLUME_VALUE = 1; const VOLUME_VALUE = 1;
...@@ -105,6 +106,7 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -105,6 +106,7 @@ describe('VideoPlayerAPICallbackTest', function () {
function setOnCallback(videoPlayer, steps, done) { function setOnCallback(videoPlayer, steps, done) {
videoPlayer.on('playbackCompleted', () => { videoPlayer.on('playbackCompleted', () => {
console.info('case playbackCompleted success'); console.info('case playbackCompleted success');
toNextStep(videoPlayer, steps, done);
}); });
videoPlayer.on('bufferingUpdate', (infoType, value) => { videoPlayer.on('bufferingUpdate', (infoType, value) => {
...@@ -381,6 +383,11 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -381,6 +383,11 @@ describe('VideoPlayerAPICallbackTest', function () {
}); });
}); });
eventEmitter.on(FINISH_EVENT, (videoPlayer, steps, done) => {
steps.shift();
console.info('case wait for playbackCompleted');
});
/* * /* *
* @tc.number : SUB_MEDIA_VIDEO_PLAYER_fdSrc_CALLBACK_0100 * @tc.number : SUB_MEDIA_VIDEO_PLAYER_fdSrc_CALLBACK_0100
* @tc.name : fd is wrong * @tc.name : fd is wrong
...@@ -641,6 +648,22 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -641,6 +648,22 @@ describe('VideoPlayerAPICallbackTest', function () {
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}) })
/* *
* @tc.number : SUB_MEDIA_VIDEO_PLAYER_PREPARE_CALLBACK_1300
* @tc.name : 13.finish -> prepare
* @tc.desc : Video playback control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MEDIA_VIDEO_PLAYER_PREPARE_CALLBACK_1300', 0, async function (done) {
mediaTestBase.isFileOpen(fileDescriptor, done);
let videoPlayer = null;
let mySteps = new Array(CREATE_EVENT, SETURL_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT,
SEEK_EVENT, DURATION_TIME, FINISH_EVENT, PREPARE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
})
/* * /* *
* @tc.number : SUB_MEDIA_VIDEO_PLAYER_PLAY_CALLBACK_0100 * @tc.number : SUB_MEDIA_VIDEO_PLAYER_PLAY_CALLBACK_0100
* @tc.name : 01.create->play * @tc.name : 01.create->play
...@@ -832,6 +855,22 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -832,6 +855,22 @@ describe('VideoPlayerAPICallbackTest', function () {
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}) })
/* *
* @tc.number : SUB_MEDIA_VIDEO_PLAYER_PLAY_CALLBACK_1300
* @tc.name : 13.finish -> play
* @tc.desc : Video playback control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MEDIA_VIDEO_PLAYER_PLAY_CALLBACK_1300', 0, async function (done) {
mediaTestBase.isFileOpen(fileDescriptor, done);
let videoPlayer = null;
let mySteps = new Array(CREATE_EVENT, SETURL_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT,
SEEK_EVENT, DURATION_TIME, FINISH_EVENT, PLAY_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
})
/* * /* *
* @tc.number : SUB_MEDIA_VIDEO_PLAYER_PAUSE_CALLBACK_0100 * @tc.number : SUB_MEDIA_VIDEO_PLAYER_PAUSE_CALLBACK_0100
* @tc.name : 01.create->pause * @tc.name : 01.create->pause
...@@ -1024,6 +1063,23 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1024,6 +1063,23 @@ describe('VideoPlayerAPICallbackTest', function () {
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}) })
/* *
* @tc.number : SUB_MEDIA_VIDEO_PLAYER_PAUSE_CALLBACK_1300
* @tc.name : 13.finish -> pause
* @tc.desc : Video playback control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MEDIA_VIDEO_PLAYER_PAUSE_CALLBACK_1300', 0, async function (done) {
mediaTestBase.isFileOpen(fileDescriptor, done);
let videoPlayer = null;
let mySteps = new Array(CREATE_EVENT, SETURL_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT,
SEEK_EVENT, DURATION_TIME, FINISH_EVENT, PAUSE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
})
/* * /* *
* @tc.number : SUB_MEDIA_VIDEO_PLAYER_STOP_CALLBACK_0100 * @tc.number : SUB_MEDIA_VIDEO_PLAYER_STOP_CALLBACK_0100
* @tc.name : 001.create->stop * @tc.name : 001.create->stop
...@@ -1211,8 +1267,24 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1211,8 +1267,24 @@ describe('VideoPlayerAPICallbackTest', function () {
mediaTestBase.isFileOpen(fileDescriptor, done); mediaTestBase.isFileOpen(fileDescriptor, done);
let videoPlayer = null; let videoPlayer = null;
let mySteps = new Array(CREATE_EVENT, SETURL_EVENT, SETSURFACE_EVENT, let mySteps = new Array(CREATE_EVENT, SETURL_EVENT, SETSURFACE_EVENT,
PREPARE_EVENT, PLAY_EVENT, STOP_EVENT, PREPARE_EVENT, PLAY_EVENT, STOP_EVENT, STOP_EVENT, ERROR_EVENT,
STOP_EVENT, ERROR_EVENT, STOP_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT); STOP_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
})
/* *
* @tc.number : SUB_MEDIA_VIDEO_PLAYER_STOP_CALLBACK_1300
* @tc.name : 13.finish -> stop
* @tc.desc : Video playback control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MEDIA_VIDEO_PLAYER_STOP_CALLBACK_1300', 0, async function (done) {
mediaTestBase.isFileOpen(fileDescriptor, done);
let videoPlayer = null;
let mySteps = new Array(CREATE_EVENT, SETURL_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT,
SEEK_EVENT, DURATION_TIME, FINISH_EVENT, STOP_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}) })
...@@ -1403,7 +1475,25 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1403,7 +1475,25 @@ describe('VideoPlayerAPICallbackTest', function () {
mediaTestBase.isFileOpen(fileDescriptor, done); mediaTestBase.isFileOpen(fileDescriptor, done);
let videoPlayer = null; let videoPlayer = null;
let mySteps = new Array(CREATE_EVENT, SETURL_EVENT, SETSURFACE_EVENT, let mySteps = new Array(CREATE_EVENT, SETURL_EVENT, SETSURFACE_EVENT,
PREPARE_EVENT, RESET_EVENT, RESET_EVENT, ERROR_EVENT, RESET_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT); PREPARE_EVENT, RESET_EVENT, RESET_EVENT, ERROR_EVENT,
RESET_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
})
/* *
* @tc.number : SUB_MEDIA_VIDEO_PLAYER_RESET_CALLBACK_1300
* @tc.name : 13.finish -> reset
* @tc.desc : Video playback control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MEDIA_VIDEO_PLAYER_RESET_CALLBACK_1300', 0, async function (done) {
mediaTestBase.isFileOpen(fileDescriptor, done);
let videoPlayer = null;
let mySteps = new Array(CREATE_EVENT, SETURL_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT,
SEEK_EVENT, DURATION_TIME, FINISH_EVENT, RESET_EVENT, SETURL_EVENT,
PREPARE_EVENT, PLAY_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}) })
...@@ -1597,6 +1687,22 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1597,6 +1687,22 @@ describe('VideoPlayerAPICallbackTest', function () {
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}) })
/* *
* @tc.number : SUB_MEDIA_VIDEO_PLAYER_RELEASE_CALLBACK_1300
* @tc.name : 13.finish -> RELEASE
* @tc.desc : Video playback control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MEDIA_VIDEO_PLAYER_RELEASE_CALLBACK_1300', 0, async function (done) {
mediaTestBase.isFileOpen(fileDescriptor, done);
let videoPlayer = null;
let mySteps = new Array(CREATE_EVENT, SETURL_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT,
SEEK_EVENT, DURATION_TIME, FINISH_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
})
/* * /* *
* @tc.number : SUB_MEDIA_VIDEO_PLAYER_SEEK_CALLBACK_0100 * @tc.number : SUB_MEDIA_VIDEO_PLAYER_SEEK_CALLBACK_0100
* @tc.name : 01.create->seek * @tc.name : 01.create->seek
...@@ -1758,6 +1864,23 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1758,6 +1864,23 @@ describe('VideoPlayerAPICallbackTest', function () {
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}) })
/* *
* @tc.number : SUB_MEDIA_VIDEO_PLAYER_SEEK_CALLBACK_1100
* @tc.name : 11.seek 3 times
* @tc.desc : Video playback control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MEDIA_VIDEO_PLAYER_SEEK_CALLBACK_1100', 0, async function (done) {
mediaTestBase.isFileOpen(fileDescriptor, done);
let videoPlayer = null;
let mySteps = new Array(CREATE_EVENT, SETURL_EVENT, SETSURFACE_EVENT,
PREPARE_EVENT, PLAY_EVENT, SEEK_EVENT, SEEK_TIME, SEEK_EVENT, SEEK_TIME,
SEEK_EVENT, SEEK_TIME, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
})
/* * /* *
* @tc.number : SUB_MEDIA_VIDEO_PLAYER_SEEK_CALLBACK_1300 * @tc.number : SUB_MEDIA_VIDEO_PLAYER_SEEK_CALLBACK_1300
* @tc.name : 13.seek(-1) * @tc.name : 13.seek(-1)
...@@ -1790,6 +1913,22 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1790,6 +1913,22 @@ describe('VideoPlayerAPICallbackTest', function () {
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}) })
/* *
* @tc.number : SUB_MEDIA_VIDEO_PLAYER_SEEK_CALLBACK_1500
* @tc.name : 13.finish -> seek
* @tc.desc : Video playback control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MEDIA_VIDEO_PLAYER_SEEK_CALLBACK_1500', 0, async function (done) {
mediaTestBase.isFileOpen(fileDescriptor, done);
let videoPlayer = null;
let mySteps = new Array(CREATE_EVENT, SETURL_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT,
SEEK_EVENT, DURATION_TIME, FINISH_EVENT, SEEK_EVENT, 0, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
})
/* * /* *
* @tc.number : SUB_MEDIA_VIDEO_PLAYER_SETVOLUME_CALLBACK_0100 * @tc.number : SUB_MEDIA_VIDEO_PLAYER_SETVOLUME_CALLBACK_0100
* @tc.name : 01.create->setvolume * @tc.name : 01.create->setvolume
...@@ -2000,6 +2139,22 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -2000,6 +2139,22 @@ describe('VideoPlayerAPICallbackTest', function () {
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}) })
/* *
* @tc.number : SUB_MEDIA_VIDEO_PLAYER_SETVOLUME_CALLBACK_1500
* @tc.name : 15.finish -> setvolume
* @tc.desc : Video playback control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MEDIA_VIDEO_PLAYER_SETVOLUME_CALLBACK_1500', 0, async function (done) {
mediaTestBase.isFileOpen(fileDescriptor, done);
let videoPlayer = null;
let mySteps = new Array(CREATE_EVENT, SETURL_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT,
SEEK_EVENT, DURATION_TIME, FINISH_EVENT, SETVOLUME_EVENT, 1, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
})
/* * /* *
* @tc.number : SUB_MEDIA_VIDEO_PLAYER_SETSPEED_CALLBACK_0100 * @tc.number : SUB_MEDIA_VIDEO_PLAYER_SETSPEED_CALLBACK_0100
* @tc.name : 01.create->setspeed * @tc.name : 01.create->setspeed
...@@ -2211,5 +2366,21 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -2211,5 +2366,21 @@ describe('VideoPlayerAPICallbackTest', function () {
PREPARE_EVENT, PLAY_EVENT, SETSPEED_EVENT, 5, ERROR_EVENT, RELEASE_EVENT, END_EVENT); PREPARE_EVENT, PLAY_EVENT, SETSPEED_EVENT, 5, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}) })
/* *
* @tc.number : SUB_MEDIA_VIDEO_PLAYER_SETSPEED_CALLBACK_1500
* @tc.name : 15.finish -> setspeed
* @tc.desc : Video playback control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it('SUB_MEDIA_VIDEO_PLAYER_SETSPEED_CALLBACK_1500', 0, async function (done) {
mediaTestBase.isFileOpen(fileDescriptor, done);
let videoPlayer = null;
let mySteps = new Array(CREATE_EVENT, SETURL_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT,
SEEK_EVENT, DURATION_TIME, FINISH_EVENT, SETSPEED_EVENT, 4, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
})
}) })
} }
...@@ -522,6 +522,23 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -522,6 +522,23 @@ describe('VideoPlayerFuncCallbackTest', function () {
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}) })
/* *
* @tc.number : SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_SEEKMODE
* @tc.name : 001.test seek mode SEEK_PREV_SYNC/SEEK_NEXT_SYNC (callback)
* @tc.desc : Video playback control test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_SEEKMODE', 0, async function (done) {
mediaTestBase.isFileOpen(fileDescriptor, done);
let videoPlayer = null;
let mySteps = new Array(CREATE_EVENT, SETFDSOURCE_EVENT, fileDescriptor, SETSURFACE_EVENT,
PREPARE_EVENT, PLAY_EVENT, SEEK_MODE_EVENT, SEEK_TIME, media.SeekMode.SEEK_NEXT_SYNC,
SEEK_MODE_EVENT, SEEK_TIME, media.SeekMode.SEEK_PREV_SYNC,RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
})
/* * /* *
* @tc.number : SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_CALLBACK * @tc.number : SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_CALLBACK
* @tc.name : 001.test callback bufferingUpdate/videoSizeChanged/startRenderFrame/playbackCompleted * @tc.name : 001.test callback bufferingUpdate/videoSizeChanged/startRenderFrame/playbackCompleted
...@@ -628,6 +645,22 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -628,6 +645,22 @@ describe('VideoPlayerFuncCallbackTest', function () {
eventEmitter.emit('test_create'); eventEmitter.emit('test_create');
}) })
/* *
* @tc.number : SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_GETTRECKDESCRIPTION
* @tc.name : 001.test getTrackDescription (callback)
* @tc.desc : Video playback control test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_GETTRECKDESCRIPTION', 0, async function (done) {
mediaTestBase.isFileOpen(fileDescriptor, done);
let videoPlayer = null;
let mySteps = new Array(CREATE_EVENT, SETFDSOURCE_EVENT, fileDescriptor, SETSURFACE_EVENT,
PREPARE_EVENT, GETDESCRIPTION, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
})
/* * /* *
* @tc.number : SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_LOOP * @tc.number : SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_LOOP
* @tc.name : 001.test LOOP (callback) * @tc.name : 001.test LOOP (callback)
...@@ -645,5 +678,24 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -645,5 +678,24 @@ describe('VideoPlayerFuncCallbackTest', function () {
SEEK_EVENT, DURATION_TIME, WAIT_EVENT, SETLOOP_EVENT, false, RELEASE_EVENT, END_EVENT); SEEK_EVENT, DURATION_TIME, WAIT_EVENT, SETLOOP_EVENT, false, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}) })
/* *
* @tc.number : SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_BASE
* @tc.name : 001.test video playe (callback)
* @tc.desc : Video playback control test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_BASE', 0, async function (done) {
mediaTestBase.isFileOpen(fileDescriptor, done);
let videoPlayer = null;
let fdPath = fdHead + fileDescriptor.fd;
let mySteps = new Array(CREATE_EVENT, SETFDSOURCE_EVENT, fileDescriptor, SETSURFACE_EVENT,
PREPARE_EVENT, PLAY_EVENT, PAUSE_EVENT, PLAY_EVENT, STOP_EVENT, RESET_EVENT, SETSOURCE_EVENT, fdPath,
PREPARE_EVENT, SETLOOP_EVENT, true, PLAY_EVENT, SEEK_EVENT, DURATION_TIME / 2, SEEK_EVENT, 0,
SEEK_EVENT, DURATION_TIME, WAIT_EVENT, SETLOOP_EVENT, false, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
})
}) })
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册