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

!4329 修改测试用例用于适配开发代码逻辑修改

Merge pull request !4329 from FULIZHONG/0714test
......@@ -39,7 +39,7 @@ export function playAudioSource(src, duration, playTime, checkSeekTime, done) {
}
audioPlayer.on('dataLoad', () => {
console.info('case set source success');
expect(audioPlayer.state).assertEqual('paused');
expect(audioPlayer.state).assertEqual('idle');
expect(audioPlayer.currentTime).assertEqual(0);
expect(audioPlayer.duration).assertClose(duration, 500);
// step 0: dataLoad -> play
......
......@@ -147,7 +147,7 @@ describe('PlayerLocalTestAudioAPI', function () {
console.info(`case dataLoad called`);
expect(audioPlayer.currentTime).assertEqual(0);
expect(audioPlayer.duration).assertEqual(DURATION_TIME);
expect(audioPlayer.state).assertEqual('paused');
expect(audioPlayer.state).assertEqual('idle');
nextStep(mySteps,done);
});
audioPlayer.on('play', () => {
......@@ -736,7 +736,7 @@ describe('PlayerLocalTestAudioAPI', function () {
expect(audioPlayer.src).assertEqual(fdHead + fileDescriptor.fd);
expect(audioPlayer.currentTime).assertEqual(0);
expect(audioPlayer.duration).assertEqual(DURATION_TIME);
expect(audioPlayer.state).assertEqual('paused');
expect(audioPlayer.state).assertEqual('idle');
expect(audioPlayer.loop).assertEqual(false);
done();
})
......
......@@ -193,7 +193,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
console.info(`case dataLoad called`);
expect(audioPlayer.currentTime).assertEqual(0);
expect(audioPlayer.duration).assertEqual(DURATION_TIME);
expect(audioPlayer.state).assertEqual('paused');
expect(audioPlayer.state).assertEqual('idle');
nextStep(mySteps, done);
});
audioPlayer.on('play', () => {
......@@ -341,7 +341,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
testAudioPlayer.on('dataLoad', () => {
expect(testAudioPlayer.duration).assertEqual(DURATION_TIME);
expect(testAudioPlayer.state).assertEqual('paused');
expect(testAudioPlayer.state).assertEqual('idle');
testAudioPlayer.play();
});
testAudioPlayer.on('play', () => {
......
......@@ -50,7 +50,7 @@ describe('PlayerLocalTestAudioFormat', function () {
})
audioPlayer.on('dataLoad', () => {
console.info('case set source success');
expect(audioPlayer.state).assertEqual('paused');
expect(audioPlayer.state).assertEqual('idle');
expect(audioPlayer.currentTime).assertEqual(0);
audioPlayer.play();
});
......
......@@ -419,7 +419,7 @@ describe('RecorderLocalTestAudioAPI', function () {
*/
it('SUB_MEDIA_RECORDER_AudioRecorder_Start_API_0400', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, RESUME_STATE, START_STATE,
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, RESUME_STATE, START_STATE, ERROR_STATE,
RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
......@@ -484,7 +484,8 @@ describe('RecorderLocalTestAudioAPI', function () {
*/
it('SUB_MEDIA_RECORDER_AudioRecorder_Start_API_0900', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, START_STATE, START_STATE, RELEASE_STATE, END_STATE);
let mySteps = new Array(PRE_STATE, START_STATE, START_STATE, ERROR_STATE,
START_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
......@@ -608,8 +609,8 @@ describe('RecorderLocalTestAudioAPI', function () {
*/
it('SUB_MEDIA_RECORDER_AudioRecorder_Pause_API_0900', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, PAUSE_STATE, PAUSE_STATE,
RELEASE_STATE, END_STATE);
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE, PAUSE_STATE, ERROR_STATE,
PAUSE_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
......@@ -654,7 +655,7 @@ describe('RecorderLocalTestAudioAPI', function () {
*/
it('SUB_MEDIA_RECORDER_AudioRecorder_Resume_API_0300', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, RESUME_STATE, RELEASE_STATE, END_STATE);
let mySteps = new Array(PRE_STATE, START_STATE, RESUME_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
......@@ -716,8 +717,9 @@ describe('RecorderLocalTestAudioAPI', function () {
*/
it('SUB_MEDIA_RECORDER_AudioRecorder_Resume_API_0800', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, RESUME_STATE, PAUSE_STATE, RESUME_STATE, STOP_STATE,
RESUME_STATE, ERROR_STATE, RESET_STATE, RESUME_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
let mySteps = new Array(PRE_STATE, START_STATE, RESUME_STATE, ERROR_STATE,
PAUSE_STATE, RESUME_STATE, STOP_STATE, RESUME_STATE, ERROR_STATE,
RESET_STATE, RESUME_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
......@@ -733,7 +735,7 @@ describe('RecorderLocalTestAudioAPI', function () {
it('SUB_MEDIA_RECORDER_AudioRecorder_Resume_API_0900', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, PAUSE_STATE,
RESUME_STATE, RESUME_STATE, RESUME_STATE, RELEASE_STATE, END_STATE);
RESUME_STATE, RESUME_STATE, ERROR_STATE, RESUME_STATE, ERROR_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
......@@ -979,8 +981,8 @@ describe('RecorderLocalTestAudioAPI', function () {
*/
it('SUB_MEDIA_RECORDER_AudioRecorder_Reset_API_0900', 0, async function (done) {
initAudioRecorder();
let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, RESET_STATE, RESET_STATE,
RELEASE_STATE, END_STATE);
let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE,
RESET_STATE, RESET_STATE, RELEASE_STATE, END_STATE);
setCallback(mySteps, done);
audioRecorder.prepare(audioConfig);
})
......
......@@ -620,7 +620,7 @@ describe('VideoPlayerAPICallbackTest', function () {
mediaTestBase.isFileOpen(fileDescriptor, done);
let videoPlayer = null;
let mySteps = new Array(CREATE_EVENT, SETURL_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, GETDESCRIPTION,
PREPARE_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
})
......@@ -636,7 +636,7 @@ describe('VideoPlayerAPICallbackTest', function () {
mediaTestBase.isFileOpen(fileDescriptor, done);
let videoPlayer = null;
let mySteps = new Array(CREATE_EVENT, SETURL_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PREPARE_EVENT,
PREPARE_EVENT, RELEASE_EVENT, END_EVENT);
ERROR_EVENT, PREPARE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
})
......@@ -827,7 +827,7 @@ describe('VideoPlayerAPICallbackTest', function () {
mediaTestBase.isFileOpen(fileDescriptor, done);
let videoPlayer = null;
let mySteps = new Array(CREATE_EVENT, SETURL_EVENT, SETSURFACE_EVENT,
PREPARE_EVENT, PLAY_EVENT, PLAY_EVENT, PLAY_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, PLAY_EVENT, ERROR_EVENT, PLAY_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
})
......@@ -1018,7 +1018,8 @@ describe('VideoPlayerAPICallbackTest', function () {
mediaTestBase.isFileOpen(fileDescriptor, done);
let videoPlayer = null;
let mySteps = new Array(CREATE_EVENT, SETURL_EVENT, SETSURFACE_EVENT,
PREPARE_EVENT, PLAY_EVENT, PAUSE_EVENT, PAUSE_EVENT, PAUSE_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, PAUSE_EVENT, PAUSE_EVENT, ERROR_EVENT,
PAUSE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
})
......@@ -1209,7 +1210,8 @@ describe('VideoPlayerAPICallbackTest', function () {
mediaTestBase.isFileOpen(fileDescriptor, done);
let videoPlayer = null;
let mySteps = new Array(CREATE_EVENT, SETURL_EVENT, SETSURFACE_EVENT,
PREPARE_EVENT, PLAY_EVENT, STOP_EVENT, STOP_EVENT, STOP_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, STOP_EVENT,
STOP_EVENT, ERROR_EVENT, STOP_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
})
......@@ -1400,7 +1402,7 @@ describe('VideoPlayerAPICallbackTest', function () {
mediaTestBase.isFileOpen(fileDescriptor, done);
let videoPlayer = null;
let mySteps = new Array(CREATE_EVENT, SETURL_EVENT, SETSURFACE_EVENT,
PREPARE_EVENT, RESET_EVENT, RESET_EVENT, RESET_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);
})
......
......@@ -166,7 +166,7 @@ describe('VideoPlayerFuncPromiseTest', function () {
expect(videoPlayer.height).assertEqual(HEIGHT_VALUE);
console.info('case prepare called!!');
}, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
videoPlayer.audioInterruptMode = audio.InterruptMode.INDEPENDENT_MODE; // 1
let startTime = videoPlayer.currentTime;
await videoPlayer.play().then(() => {
console.info('case play called!!');
......
......@@ -482,7 +482,7 @@ describe('VideoRecorderAPICallbackTest', function () {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, PAUSE_EVENT, RESUME_EVENT,
START_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
START_EVENT, ERROR_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
......@@ -542,7 +542,7 @@ describe('VideoRecorderAPICallbackTest', function () {
it('SUB_MEDIA_VIDEO_RECORDER_START_CALLBACK_0800', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, START_EVENT, START_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
START_EVENT, START_EVENT, ERROR_EVENT, START_EVENT, ERROR_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
......@@ -661,7 +661,8 @@ describe('VideoRecorderAPICallbackTest', function () {
it('SUB_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0800', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, PAUSE_EVENT, PAUSE_EVENT, PAUSE_EVENT, CLOSE_STREAM, RELEASE_EVENT, END_EVENT);
START_EVENT, PAUSE_EVENT, PAUSE_EVENT, ERROR_EVENT, PAUSE_EVENT, ERROR_EVENT,
CLOSE_STREAM, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
......@@ -704,7 +705,7 @@ describe('VideoRecorderAPICallbackTest', function () {
it('SUB_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0300', 0, async function (done) {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, RESUME_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
START_EVENT, RESUME_EVENT, ERROR_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
......@@ -781,7 +782,8 @@ describe('VideoRecorderAPICallbackTest', function () {
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
START_EVENT, PAUSE_EVENT,
RESUME_EVENT, RESUME_EVENT, RESUME_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
RESUME_EVENT, RESUME_EVENT, ERROR_EVENT, RESUME_EVENT, ERROR_EVENT,
RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册