提交 25ff84e7 编写于 作者: Anne_LXM's avatar Anne_LXM

test(create-inner-audio-context.test.js):调整waitFor时间

上级 2feae999
......@@ -20,7 +20,8 @@ describe('inner-audio', () => {
it('play-onPlay-onTimeUpdate', async () => {
await page.callMethod('play')
await page.waitFor(3000);
const waitTime = process.env.uniTestPlatformInfo.includes('chrome') ? 5000:3000
await page.waitFor(waitTime)
expect(await page.data('isPlaying')).toBeTruthy()
console.log("duration:",await page.data('duration'),"currentTime:",await page.data('currentTime'))
expect(await page.data('duration')).toBeCloseTo(175.109, 0);
......@@ -29,9 +30,14 @@ describe('inner-audio', () => {
// expect(await page.data('isPaused')).toBeFalsy();
});
it('screenshot', async () => {
expect(await program.screenshot()).toSaveImageSnapshot();
});
it('seek-onSeeking-onSeeked', async () => {
await page.callMethod('onchange',20)
await page.waitFor(500);
const waitTime = process.env.uniTestPlatformInfo.includes('chrome') ? 1500:500
await page.waitFor(waitTime)
console.log("seek-onSeeking-onSeeked:",await page.data())
expect(await page.data('onSeekingTest')).toBeTruthy();
// expect(await page.data('onWaitingTest')).toBeTruthy();
......
......@@ -159,6 +159,7 @@
// console.log('onTimeUpdate:音频播放进度更新事件,currentTime',this._audioContext!.currentTime);
if (this._isChanging === true) { return; }
this.currentTime = this._audioContext!.currentTime || 0;
console.log('currentTime', this.currentTime);
if (this.currentTime > this.buffered) {
console.log('缓冲不足');
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册