diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 1dcf960e0e..064d4ec741 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,12 +6,12 @@ in roughly chronological order, most recent first. Add your entries at or near the top. Include a label indicating the component affected. Blades: Video player improvements: - - Disable edX controls for iPhone (native controls are used). - - Disable volume and speed controls for iPad. - - controls becomes visible after click on video or play placeholder to avoid - issues with YouTube API. + - Disable edX controls on iPhone/iPod (native controls are used). + - Disable unsupported controls (volume, playback rate) on iPad/Android. + - Controls becomes visible after click on video or play placeholder to avoid + issues with YouTube API on iPad/Android. - Captions becomes visible just after full initialization of video player. - - Fix blinking of captions after video player initialization. BLD-206. + - Fix blinking of captions after initialization of video player. BLD-206. LMS: Fix answer distribution download for small courses. LMS-922, LMS-811 diff --git a/common/lib/xmodule/xmodule/js/spec/video/video_caption_spec.js b/common/lib/xmodule/xmodule/js/spec/video/video_caption_spec.js index bdc903b191..3be31f458c 100644 --- a/common/lib/xmodule/xmodule/js/spec/video/video_caption_spec.js +++ b/common/lib/xmodule/xmodule/js/spec/video/video_caption_spec.js @@ -209,34 +209,15 @@ }); describe('mouse movement', function () { - // We will store default window.setTimeout() function here. - var oldSetTimeout = null; - beforeEach(function () { - // Store original window.setTimeout() function. If we do not do - // this, then all other tests that rely on code which uses - // window.setTimeout() function might (and probably will) fail. - oldSetTimeout = window.setTimeout; - // Redefine window.setTimeout() function as a spy. - window.setTimeout = jasmine.createSpy().andCallFake( - function (callback, timeout) { - return 5; - } - ); - window.setTimeout.andReturn(100); + jasmine.Clock.useMock(); spyOn(window, 'clearTimeout'); }); - afterEach(function () { - // Reset the default window.setTimeout() function. If we do not - // do this, then all other tests that rely on code which uses - // window.setTimeout() function might (and probably will) fail. - window.setTimeout = oldSetTimeout; - }); - describe('when cursor is outside of the caption box', function () { beforeEach(function () { $(window).trigger(jQuery.Event('mousemove')); + jasmine.Clock.tick(state.config.captionsFreezeTime); }); it('does not set freezing timeout', function () { @@ -246,11 +227,14 @@ describe('when cursor is in the caption box', function () { beforeEach(function () { + spyOn(videoCaption, 'onMouseLeave'); $('.subtitles').trigger(jQuery.Event('mouseenter')); + jasmine.Clock.tick(state.config.captionsFreezeTime); }); it('set the freezing timeout', function () { - expect(videoCaption.frozen).toEqual(100); + expect(videoCaption.frozen).not.toBeFalsy(); + expect(videoCaption.onMouseLeave).toHaveBeenCalled(); }); describe('when the cursor is moving', function () { @@ -259,7 +243,7 @@ }); it('reset the freezing timeout', function () { - expect(window.clearTimeout).toHaveBeenCalledWith(100); + expect(window.clearTimeout).toHaveBeenCalled(); }); }); @@ -269,7 +253,7 @@ }); it('reset the freezing timeout', function () { - expect(window.clearTimeout).toHaveBeenCalledWith(100); + expect(window.clearTimeout).toHaveBeenCalled(); }); }); }); diff --git a/common/lib/xmodule/xmodule/js/spec/video/video_progress_slider_spec.js b/common/lib/xmodule/xmodule/js/spec/video/video_progress_slider_spec.js index 10e46c79aa..5535f2543e 100644 --- a/common/lib/xmodule/xmodule/js/spec/video/video_progress_slider_spec.js +++ b/common/lib/xmodule/xmodule/js/spec/video/video_progress_slider_spec.js @@ -152,28 +152,14 @@ }); describe('onStop', function() { - // We will store default window.setTimeout() function here. - var oldSetTimeout = null; beforeEach(function() { - // Store original window.setTimeout() function. If we do not do - // this, then all other tests that rely on code which uses - // window.setTimeout() function might (and probably will) fail. - oldSetTimeout = window.setTimeout; - // Redefine window.setTimeout() function as a spy. - window.setTimeout = jasmine.createSpy().andReturn(100); + jasmine.Clock.useMock(); initialize(); spyOn(videoPlayer, 'onSlideSeek').andCallThrough(); }); - afterEach(function () { - // Reset the default window.setTimeout() function. If we do not - // do this, then all other tests that rely on code which uses - // window.setTimeout() function might (and probably will) fail. - window.setTimeout = oldSetTimeout; - }); - it('freeze the slider', function() { videoProgressSlider.onStop( jQuery.Event('stop'), { value: 20 } @@ -195,10 +181,8 @@ jQuery.Event('stop'), { value: 20 } ); - expect(window.setTimeout).toHaveBeenCalledWith( - jasmine.any(Function), 200 - ); - window.setTimeout.mostRecentCall.args[0](); + jasmine.Clock.tick(200); + expect(videoProgressSlider.frozen).toBeFalsy(); }); });