提交 1bdb34e1 编写于 作者: L ling990

modify testcases Signed-off-by: ling990 <liling96@huawei.com>

Signed-off-by: Nling990 <ling990@qq.com>
上级 8c020e07
...@@ -748,10 +748,11 @@ describe('AudioDecoderFuncCallback', function () { ...@@ -748,10 +748,11 @@ describe('AudioDecoderFuncCallback', function () {
}) })
}); });
eventEmitter.on('start', () => { eventEmitter.on('start', () => {
audioDecodeProcessor.start((err) => { audioDecodeProcessor.start(async(err) => {
expect(err).assertUndefined(); expect(err).assertUndefined();
console.info(`case start 1`); console.info(`case start 1`);
setTimeout(() => {eventEmitter.emit('flush')},2000) await sleep(2000);
eventEmitter.emit('flush');
}) })
}); });
eventEmitter.on('flush', () => { eventEmitter.on('flush', () => {
...@@ -759,7 +760,7 @@ describe('AudioDecoderFuncCallback', function () { ...@@ -759,7 +760,7 @@ describe('AudioDecoderFuncCallback', function () {
outputQueue = []; outputQueue = [];
audioDecodeProcessor.flush((err) => { audioDecodeProcessor.flush((err) => {
expect(err).assertUndefined(); expect(err).assertUndefined();
console.info(`case flush after 2s`); console.info(`case flush after 2s success`);
}) })
}); });
media.createAudioDecoderByMime('audio/mp4a-latm', (err, processor) => { media.createAudioDecoderByMime('audio/mp4a-latm', (err, processor) => {
......
...@@ -582,10 +582,11 @@ describe('AudioEncoderFuncCallback', function () { ...@@ -582,10 +582,11 @@ describe('AudioEncoderFuncCallback', function () {
}) })
}); });
eventEmitter.on('start', () => { eventEmitter.on('start', () => {
audioEncodeProcessor.start((err) => { audioEncodeProcessor.start(async(err) => {
expect(err).assertUndefined(); expect(err).assertUndefined();
console.info(`case start 1`); console.info(`case start 1`);
setTimeout(() => {eventEmitter.emit('flush')},5000) await sleep(2000);
eventEmitter.emit('flush');
}) })
}); });
eventEmitter.on('flush', () => { eventEmitter.on('flush', () => {
...@@ -593,7 +594,7 @@ describe('AudioEncoderFuncCallback', function () { ...@@ -593,7 +594,7 @@ describe('AudioEncoderFuncCallback', function () {
outputQueue = []; outputQueue = [];
audioEncodeProcessor.flush((err) => { audioEncodeProcessor.flush((err) => {
expect(err).assertUndefined(); expect(err).assertUndefined();
console.info(`case flush after 5s`); console.info(`case flush after 2s success`);
}) })
}); });
media.createAudioEncoderByMime('audio/mp4a-latm', (err, processor) => { media.createAudioEncoderByMime('audio/mp4a-latm', (err, processor) => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册