Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
8b06916e
Commit
8b06916e
authored
May 29, 2013
by
Anto Stupak
Committed by
Vasyl Nakvasiuk
Jun 06, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tests for firefox
parent
7eb18fe0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
28 deletions
+26
-28
common/lib/xmodule/xmodule/js/spec/video/display/video_caption_spec.coffee
+14
-17
common/lib/xmodule/xmodule/js/spec/video/display/video_player_spec.coffee
+1
-1
common/lib/xmodule/xmodule/js/spec/video/display/video_speed_control_spec.coffee
+10
-9
common/lib/xmodule/xmodule/js/src/video/display/video_player.coffee
+1
-1
No files found.
common/lib/xmodule/xmodule/js/spec/video/display/video_caption_spec.coffee
View file @
8b06916e
...
...
@@ -55,12 +55,11 @@ describe 'VideoCaption', ->
@
caption
=
@
player
.
caption
it
'render the caption'
,
->
expect
(
$
(
'.subtitles'
).
html
()).
toMatch
new
RegExp
(
'''
<li data-index="0" data-start="0">Caption at 0</li>
<li data-index="1" data-start="10000">Caption at 10000</li>
<li data-index="2" data-start="20000">Caption at 20000</li>
<li data-index="3" data-start="30000">Caption at 30000</li>
'''
.
replace
(
/\n/g
,
''
))
captionsData
=
jasmine
.
stubbedCaption
$
(
'.subtitles li[data-index]'
).
each
(
index
,
link
)
=>
expect
(
$
(
link
)).
toHaveData
'index'
,
index
expect
(
$
(
link
)).
toHaveData
'start'
,
captionsData
.
start
[
index
]
expect
(
$
(
link
)).
toHaveText
captionsData
.
text
[
index
]
it
'add a padding element to caption'
,
->
expect
(
$
(
'.subtitles li:first'
)).
toBe
'.spacing'
...
...
@@ -179,12 +178,11 @@ describe 'VideoCaption', ->
@
caption
.
play
()
it
'render the caption'
,
->
expect
(
$
(
'.subtitles'
).
html
()).
toMatch
new
RegExp
(
'''<li data-index="0" data-start="0">Caption at 0</li>'''
+
'''<li data-index="1" data-start="10000">Caption at 10000</li>'''
+
'''<li data-index="2" data-start="20000">Caption at 20000</li>'''
+
'''<li data-index="3" data-start="30000">Caption at 30000</li>'''
)
captionsData
=
jasmine
.
stubbedCaption
$
(
'.subtitles li[data-index]'
).
each
(
index
,
link
)
=>
expect
(
$
(
link
)).
toHaveData
'index'
,
index
expect
(
$
(
link
)).
toHaveData
'start'
,
captionsData
.
start
[
index
]
expect
(
$
(
link
)).
toHaveText
captionsData
.
text
[
index
]
it
'add a padding element to caption'
,
->
expect
(
$
(
'.subtitles li:first'
)).
toBe
'.spacing'
...
...
@@ -268,13 +266,12 @@ describe 'VideoCaption', ->
@
caption
.
resize
()
it
'set the height of caption container'
,
->
expect
(
parseInt
(
$
(
'.subtitles'
).
css
(
'maxHeight'
))).
toBeCloseTo
$
(
'.video-wrapper'
).
height
(),
5
expect
(
parseInt
(
$
(
'.subtitles'
).
css
(
'maxHeight'
))).
toBeCloseTo
$
(
'.video-wrapper'
).
height
(),
2
it
'set the height of caption spacing'
,
->
expect
(
parseInt
(
$
(
'.subtitles .spacing:first'
).
css
(
'height'
))).
toEqual
(
$
(
'.video-wrapper'
).
height
()
/
2
-
$
(
'.subtitles li:not(.spacing):first'
).
height
()
/
2
)
expect
(
parseInt
(
$
(
'.subtitles .spacing:last'
).
css
(
'height'
))).
toEqual
(
$
(
'.video-wrapper'
).
height
()
/
2
-
$
(
'.subtitles li:not(.spacing):last'
).
height
()
/
2
)
expect
(
Math
.
abs
(
parseInt
(
$
(
'.subtitles .spacing:first'
).
css
(
'height'
))
-
@
caption
.
topSpacingHeight
())).
toBeLessThan
1
expect
(
Math
.
abs
(
parseInt
(
$
(
'.subtitles .spacing:last'
).
css
(
'height'
))
-
@
caption
.
bottomSpacingHeight
())).
toBeLessThan
1
it
'scroll caption to new position'
,
->
expect
(
$
.
fn
.
scrollTo
).
toHaveBeenCalled
()
...
...
common/lib/xmodule/xmodule/js/spec/video/display/video_player_spec.coffee
View file @
8b06916e
...
...
@@ -86,7 +86,7 @@ describe 'VideoPlayer', ->
expect
(
$
(
@
player
.
volumeControl
)).
toHandleWith
'volumeChange'
,
@
player
.
onVolumeChange
it
'bind to key press'
,
->
expect
(
$
(
document
)).
toHandleWith
'keyup'
,
@
player
.
bindExitFullScreen
expect
(
$
(
document
.
documentElement
)).
toHandleWith
'keyup'
,
@
player
.
bindExitFullScreen
it
'bind to fullscreen switching button'
,
->
expect
(
$
(
'.add-fullscreen'
)).
toHandleWith
'click'
,
@
player
.
toggleFullScreen
...
...
common/lib/xmodule/xmodule/js/spec/video/display/video_speed_control_spec.coffee
View file @
8b06916e
...
...
@@ -10,15 +10,16 @@ describe 'VideoSpeedControl', ->
@
speedControl
=
new
VideoSpeedControl
el
:
$
(
'.secondary-controls'
),
speeds
:
@
video
.
speeds
,
currentSpeed
:
'1.0'
it
'add the video speed control to player'
,
->
expect
(
$
(
'.secondary-controls'
).
html
()).
toContain
'''
<div class="speeds">
<a href="#">
<h3>Speed</h3>
<p class="active">1.0x</p>
</a>
<ol class="video_speeds"><li data-speed="1.0" class="active"><a href="#">1.0x</a></li><li data-speed="0.75"><a href="#">0.75x</a></li></ol>
</div>
'''
secondaryControls
=
$
(
'.secondary-controls'
)
li
=
secondaryControls
.
find
(
'.video_speeds li'
)
expect
(
secondaryControls
).
toContain
'.speeds'
expect
(
secondaryControls
).
toContain
'.video_speeds'
expect
(
secondaryControls
.
find
(
'p.active'
).
text
()).
toBe
'1.0x'
expect
(
li
.
filter
(
'.active'
)).
toHaveData
'speed'
,
@
speedControl
.
currentSpeed
expect
(
li
.
length
).
toBe
@
speedControl
.
speeds
.
length
$
.
each
li
.
toArray
().
reverse
(),
(
index
,
link
)
=>
expect
(
$
(
link
)).
toHaveData
'speed'
,
@
speedControl
.
speeds
[
index
]
expect
(
$
(
link
).
find
(
'a'
).
text
()).
toBe
@
speedControl
.
speeds
[
index
]
+
'x'
it
'bind to change video speed link'
,
->
expect
(
$
(
'.video_speeds a'
)).
toHandleWith
'click'
,
@
speedControl
.
changeVideoSpeed
...
...
common/lib/xmodule/xmodule/js/src/video/display/video_player.coffee
View file @
8b06916e
...
...
@@ -15,7 +15,7 @@ class @VideoPlayer extends Subview
$
(
@
progressSlider
).
bind
(
'seek'
,
@
onSeek
)
if
@
volumeControl
$
(
@
volumeControl
).
bind
(
'volumeChange'
,
@
onVolumeChange
)
$
(
document
).
keyup
@
bindExitFullScreen
$
(
document
.
documentElement
).
keyup
@
bindExitFullScreen
@
$
(
'.add-fullscreen'
).
click
@
toggleFullScreen
@
addToolTip
()
unless
onTouchBasedDevice
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment