提交 17957a1f 编写于 作者: F fulizhong

modify testcase Signed-off-by: FULIZHONG<fulizhong1@huawei.com>

Signed-off-by: Nfulizhong <fulizhong@huawei.com>
上级 c7e85cab
...@@ -268,7 +268,7 @@ describe('PlayerLocalTestAudioAPI', function () { ...@@ -268,7 +268,7 @@ describe('PlayerLocalTestAudioAPI', function () {
it('SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_SRC_API_0200', 0, async function (done) { it('SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_SRC_API_0200', 0, async function (done) {
mediaTestBase.isFileOpen(fileDescriptor, done); mediaTestBase.isFileOpen(fileDescriptor, done);
fileDescriptor.offset = 1; fileDescriptor.offset = 1;
let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, PLAY_STATE, END_STATE); let mySteps = new Array(ERROR_STATE, END_STATE);
initAudioPlayer(); initAudioPlayer();
setCallback(mySteps, done); setCallback(mySteps, done);
audioPlayer.fdSrc = fileDescriptor; audioPlayer.fdSrc = fileDescriptor;
...@@ -284,6 +284,8 @@ describe('PlayerLocalTestAudioAPI', function () { ...@@ -284,6 +284,8 @@ describe('PlayerLocalTestAudioAPI', function () {
*/ */
it('SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_SRC_API_0300', 0, async function (done) { it('SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_SRC_API_0300', 0, async function (done) {
mediaTestBase.isFileOpen(fileDescriptor, done); mediaTestBase.isFileOpen(fileDescriptor, done);
fileDescriptor.fd = fdNumber;
fileDescriptor.offset = 0;
fileDescriptor.length = -1; fileDescriptor.length = -1;
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();
...@@ -722,9 +724,9 @@ describe('PlayerLocalTestAudioAPI', function () { ...@@ -722,9 +724,9 @@ describe('PlayerLocalTestAudioAPI', function () {
it('SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_TIME_API_0200', 0, async function (done) { it('SUB_MULTIMEDIA_MEDIA_AUDIOPLAYER_TIME_API_0200', 0, async function (done) {
mediaTestBase.isFileOpen(fileDescriptor, done); mediaTestBase.isFileOpen(fileDescriptor, done);
initAudioPlayer(); initAudioPlayer();
audioPlayer.src = fdHead + fileDescriptor.fd; audioPlayer.src = fdPath;
mediaTestBase.msleep(PLAY_TIME); mediaTestBase.msleep(PLAY_TIME);
expect(audioPlayer.src).assertEqual(fdHead + fileDescriptor.fd); expect(audioPlayer.src).assertEqual(fdPath);
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('idle'); expect(audioPlayer.state).assertEqual('idle');
......
...@@ -105,7 +105,7 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -105,7 +105,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
switch (mySteps[0]) { switch (mySteps[0]) {
case SRC_STATE: case SRC_STATE:
console.info(`case to prepare`); console.info(`case to prepare`);
audioPlayer.src = fdHead + fileDescriptor.fd; audioPlayer.src = fdPath;
break; break;
case FDSRC_STATE: case FDSRC_STATE:
console.info(`case to prepare`); console.info(`case to prepare`);
...@@ -323,7 +323,7 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -323,7 +323,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
DURATION_TIME / 2, SEEK_STATE, DURATION_TIME, FINISH_STATE, RELEASE_STATE, END_STATE); DURATION_TIME / 2, SEEK_STATE, DURATION_TIME, FINISH_STATE, RELEASE_STATE, END_STATE);
initAudioPlayer(); initAudioPlayer();
setCallback(mySteps, done); setCallback(mySteps, done);
audioPlayer.src = fdHead + fileDescriptor.fd; audioPlayer.src = fdPath;
}) })
/* * /* *
...@@ -339,7 +339,7 @@ describe('PlayerLocalTestAudioFUNC', function () { ...@@ -339,7 +339,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
let mySteps = new Array(SRC_STATE, GETDESCRIPTION_PROMISE, GETDESCRIPTION_CALLBACK, RELEASE_STATE, END_STATE); let mySteps = new Array(SRC_STATE, GETDESCRIPTION_PROMISE, GETDESCRIPTION_CALLBACK, RELEASE_STATE, END_STATE);
initAudioPlayer(); initAudioPlayer();
setCallback(mySteps, done); setCallback(mySteps, done);
audioPlayer.src = fdHead + fileDescriptor.fd; audioPlayer.src = fdPath;
}) })
/* * /* *
......
...@@ -418,7 +418,7 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -418,7 +418,7 @@ describe('VideoPlayerAPICallbackTest', function () {
fileDescriptor.offset = -1; fileDescriptor.offset = -1;
let videoPlayer = null; let videoPlayer = null;
let mySteps = new Array(CREATE_EVENT, SETFDSRC_EVENT, SETSURFACE_EVENT, let mySteps = new Array(CREATE_EVENT, SETFDSRC_EVENT, SETSURFACE_EVENT,
PREPARE_EVENT, PLAY_EVENT, PAUSE_EVENT, RELEASE_EVENT, END_EVENT); PREPARE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}) })
......
...@@ -605,7 +605,7 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -605,7 +605,7 @@ describe('VideoPlayerFuncCallbackTest', function () {
}); });
eventEmitter.on('test_setSurface', () => { eventEmitter.on('test_setSurface', () => {
videoPlayer.url = fdHead + fileDescriptor.fd; videoPlayer.url = fdPath;
videoPlayer.setDisplaySurface(surfaceID, (err) => { videoPlayer.setDisplaySurface(surfaceID, (err) => {
if (err == null) { if (err == null) {
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
...@@ -690,7 +690,6 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -690,7 +690,6 @@ describe('VideoPlayerFuncCallbackTest', function () {
it('SUB_MULTIMEDIA_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_BASE_0100', 0, async function (done) { it('SUB_MULTIMEDIA_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_BASE_0100', 0, async function (done) {
mediaTestBase.isFileOpen(fileDescriptor, done); mediaTestBase.isFileOpen(fileDescriptor, done);
let videoPlayer = null; let videoPlayer = null;
let fdPath = fdHead + fileDescriptor.fd;
let mySteps = new Array(CREATE_EVENT, SETFDSOURCE_EVENT, fileDescriptor, SETSURFACE_EVENT, 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, 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, PREPARE_EVENT, SETLOOP_EVENT, true, PLAY_EVENT, SEEK_EVENT, DURATION_TIME / 2, SEEK_EVENT, 0,
......
...@@ -318,7 +318,7 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -318,7 +318,7 @@ describe('VideoPlayerFuncPromiseTest', function () {
} }
}, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback); }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
videoPlayer.url = fdHead + fileDescriptor.fd; videoPlayer.url = fdPath;
await videoPlayer.setDisplaySurface(surfaceID).then(() => { await videoPlayer.setDisplaySurface(surfaceID).then(() => {
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
console.info('case setDisplaySurface success'); console.info('case setDisplaySurface success');
...@@ -494,7 +494,7 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -494,7 +494,7 @@ describe('VideoPlayerFuncPromiseTest', function () {
} }
}, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback); }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
videoPlayer.url = fdHead + fileDescriptor.fd; videoPlayer.url = fdPath;
await videoPlayer.setDisplaySurface(surfaceID).then(() => { await videoPlayer.setDisplaySurface(surfaceID).then(() => {
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
console.info('case setDisplaySurface success'); console.info('case setDisplaySurface success');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册