Skip to content

Commit

Permalink
Corrected all isues found during refactoring #2.
Browse files Browse the repository at this point in the history
Added missing file.~
Undid a mistake.
Copied Python tests from video_alpha1.
moves TestLogic to __init__.py
reorginizes xmodule logic tests
adds docstrings for poll tests
adds docstring for word cloud and conditional tests
adds docstrings for video alpha tests
adds videoalphafactory for tests, not finished
adds imports
Bug fixing.
fix video/videoalpha tests
Updated lettuce test. Now it is aware of the fact that Video and Video Alpha players have different base CSS classes.
Removed REFACTOR comments.
Turn off autoplay for Video Alpha in Studio.
Carry over fix for bug where in Firefox changing to speed 1.0 has no effect.
Carry over JavaScript Jasmine tests from jmclaus/videoalpha2_js branch.
Exporting state object from main function of Video Alpha.
More stuff from jmclaus/videoalpha2_js branch.
Specs in html5_video.js all pass except ten of them. Cleaned code a bit and moved it out of display_spec.js
One more spec passes
Fixed remaning tests in spec/../html5_video.js test suite. Removed test video files.
Added JavaScript Jasmine tests for main of Video Alpha 2.
adds test for volume control and updates helper file for videoalpha
  • Loading branch information
Valera Rozuvan authored and auraz committed Jul 22, 2013
1 parent 6ca6568 commit b90cb10
Show file tree
Hide file tree
Showing 45 changed files with 2,976 additions and 2,443 deletions.
2 changes: 1 addition & 1 deletion common/lib/xmodule/xmodule/js/fixtures/videoalpha.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div id="example">
<div
id="video_id"
class="video"
class="videoalpha"
data-streams="0.75:slowerSpeedYoutubeId,1.0:normalSpeedYoutubeId"
data-show-captions="true"
data-start=""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div id="example">
<div
id="video_id"
class="video"
class="videoalpha"
data-show-captions="true"
data-start=""
data-end=""
Expand Down
23 changes: 23 additions & 0 deletions common/lib/xmodule/xmodule/js/fixtures/videoalpha_no_captions.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<div class="course-content">
<div id="video_example">
<div id="example">
<div
id="video_id"
class="videoalpha"
data-streams="0.75:slowerSpeedYoutubeId,1.0:normalSpeedYoutubeId"
data-show-captions="false"
data-start=""
data-end=""
data-caption-asset-path="/static/subs/">
<div class="tc-wrapper">
<article class="video-wrapper">
<section class="video-player">
<div id="id"></div>
</section>
<section class="video-controls"></section>
</article>
</div>
</div>
</div>
</div>
</div>
2 changes: 2 additions & 0 deletions common/lib/xmodule/xmodule/js/spec/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
*.js

# Tests for videoalpha are written in pure JavaScript.
!videoalpha/*.js
27 changes: 23 additions & 4 deletions common/lib/xmodule/xmodule/js/spec/helper.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,26 @@ window.YT =
BUFFERING: 3
CUED: 5

window.TYPES =
'undefined' : 'undefined'
'number' : 'number'
'boolean' : 'boolean'
'string' : 'string'
'[object Function]': 'function'
'[object RegExp]' : 'regexp'
'[object Array]' : 'array'
'[object Date]' : 'date'
'[object Error]' : 'error'

window.TOSTRING = Object.prototype.toString
window.STATUS = window.YT.PlayerState

window.whatType = (o) ->
TYPES[typeof o] || TYPES[TOSTRING.call(o)] || (o ? 'object' : 'null');

# Time waitsFor() should wait for before failing a test.
window.WAIT_TIMEOUT = 1000

jasmine.getFixtures().fixturesPath = 'xmodule/js/fixtures'

jasmine.stubbedMetadata =
Expand Down Expand Up @@ -78,7 +98,8 @@ jasmine.stubVideoPlayer = (context, enableParts, createPlayer=true) ->
if createPlayer
return new VideoPlayer(video: context.video)

jasmine.stubVideoPlayerAlpha = (context, enableParts, createPlayer=true, html5=false) ->
jasmine.stubVideoPlayerAlpha = (context, enableParts, html5=false) ->
console.log('stubVideoPlayerAlpha called')
suite = context.suite
currentPartName = suite.description while suite = suite.parentSuite
if html5 == false
Expand All @@ -88,10 +109,8 @@ jasmine.stubVideoPlayerAlpha = (context, enableParts, createPlayer=true, html5=f
jasmine.stubRequests()
YT.Player = undefined
window.OldVideoPlayerAlpha = undefined
context.video = new VideoAlpha '#example', '.75:slowerSpeedYoutubeId,1.0:normalSpeedYoutubeId'
jasmine.stubYoutubePlayer()
if createPlayer
return new VideoPlayerAlpha(video: context.video)
return new VideoAlpha '#example', '.75:slowerSpeedYoutubeId,1.0:normalSpeedYoutubeId'


# Stub jQuery.cookie
Expand Down
Loading

0 comments on commit b90cb10

Please sign in to comment.