Commit 4622b24a by Muhammad Ammar Committed by GitHub

Merge pull request #15385 from edx/ammar/fix-video-flaky-test

fix video flaky test
parents b2663002 4d609f80
......@@ -380,22 +380,18 @@ function(VideoPlayer, HLS) {
});
describe('when the video is playing', function() {
beforeEach(function(done) {
it('call runTimer in seekTo on player', function(done) {
state.videoPlayer.play();
jasmine.waitUntil(function() {
return state.videoPlayer.isPlaying();
}).done(done);
});
it('call runTimer in seekTo on player', function() {
spyOn(state.videoPlayer, 'stopTimer').and.callThrough();
spyOn(state.videoPlayer, 'runTimer').and.callThrough();
state.videoPlayer.seekTo(10);
expect(state.videoPlayer.currentTime).toBe(10);
expect(state.videoPlayer.stopTimer).toHaveBeenCalled();
expect(state.videoPlayer.runTimer).toHaveBeenCalled();
}).then(function() {
spyOn(state.videoPlayer, 'stopTimer').and.callThrough();
spyOn(state.videoPlayer, 'runTimer').and.callThrough();
state.videoPlayer.seekTo(10);
expect(state.videoPlayer.currentTime).toBe(10);
expect(state.videoPlayer.stopTimer).toHaveBeenCalled();
expect(state.videoPlayer.runTimer).toHaveBeenCalled();
}).always(done);
});
it('seek the player', function() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment