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

!7163 媒体播放用例根据资源文件修改进行相应的逻辑改动

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