diff --git a/common/lib/xmodule/xmodule/js/src/video/09_video_caption.js b/common/lib/xmodule/xmodule/js/src/video/09_video_caption.js index d5d895530a75..04a4ab27f30d 100644 --- a/common/lib/xmodule/xmodule/js/src/video/09_video_caption.js +++ b/common/lib/xmodule/xmodule/js/src/video/09_video_caption.js @@ -34,13 +34,13 @@ 'handleKeypress', 'handleKeypressLink', 'openLanguageMenu', 'closeLanguageMenu', 'previousLanguageMenuItem', 'nextLanguageMenuItem', 'handleCaptionToggle', 'showClosedCaptions', 'hideClosedCaptions', 'toggleClosedCaptions', - 'updateCaptioningCookie', 'handleCaptioningCookie', 'handleTranscriptToggle', + 'handleTranscriptToggle', 'listenForDragDrop' ); this.state = state; this.state.videoCaption = this; this.renderElements(); - this.handleCaptioningCookie(); + this.hideClosedCaptions(); this.listenForDragDrop(); return $.Deferred().resolve().promise(); @@ -1146,31 +1146,14 @@ } }, - handleCaptioningCookie: function() { - if ($.cookie('show_closed_captions') === 'true') { - this.state.showClosedCaptions = true; - this.showClosedCaptions(); - - // keep it going until turned off - $.cookie('show_closed_captions', 'true', { - expires: 3650, - path: '/' - }); - } else { - this.hideClosedCaptions(); - } - }, - toggleClosedCaptions: function(event) { event.preventDefault(); if (this.state.el.hasClass('has-captions')) { this.state.showClosedCaptions = false; - this.updateCaptioningCookie(false); this.hideClosedCaptions(); } else { this.state.showClosedCaptions = true; - this.updateCaptioningCookie(true); this.showClosedCaptions(); } }, @@ -1212,19 +1195,6 @@ this.state.el.trigger('captions:hide'); }, - updateCaptioningCookie: function(method) { - if (method) { - $.cookie('show_closed_captions', 'true', { - expires: 3650, - path: '/' - }); - } else { - $.cookie('show_closed_captions', null, { - path: '/' - }); - } - }, - listenForDragDrop: function() { var captions = document.querySelector('.closed-captions'), draggable; diff --git a/common/test/acceptance/tests/video/test_video_module.py b/common/test/acceptance/tests/video/test_video_module.py index 05c88ae2878c..4bca2f692547 100644 --- a/common/test/acceptance/tests/video/test_video_module.py +++ b/common/test/acceptance/tests/video/test_video_module.py @@ -246,18 +246,24 @@ def test_cc_button(self): self.assets.append('chinese_transcripts.srt') self.navigate_to_video() - # Show captions and make sure they're visible and cookie is set + # Captions should not be visible by default + self.assertFalse(self.video.is_closed_captions_visible()) + + # Show captions and make sure they're visible and reset after page reload self.video.show_closed_captions() self.video.wait_for_closed_captions() - self.assertTrue(self.video.is_closed_captions_visible) + self.assertTrue(self.video.is_closed_captions_visible()) self.video.reload_page() - self.assertTrue(self.video.is_closed_captions_visible) + self.assertFalse(self.video.is_closed_captions_visible()) + + # Now show captions again + self.video.show_closed_captions() + self.video.wait_for_closed_captions() + self.assertTrue(self.video.is_closed_captions_visible()) - # Hide captions and make sure they're hidden and cookie is unset + # Hide captions and make sure they're hidden self.video.hide_closed_captions() self.video.wait_for_closed_captions_to_be_hidden() - self.video.reload_page() - self.video.wait_for_closed_captions_to_be_hidden() def test_transcript_button_transcripts_and_sub_fields_empty(self): """