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
ce8eaa71
Commit
ce8eaa71
authored
Oct 09, 2013
by
Jay Zoldak
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1284 from edx/zoldak/fix-video-js-test
Fix intermittently failing video js tests
parents
838f4df6
ac4ac23d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
31 deletions
+32
-31
common/lib/xmodule/xmodule/js/spec/helper.coffee
+1
-1
common/lib/xmodule/xmodule/js/spec/video/html5_video_spec.js
+31
-30
No files found.
common/lib/xmodule/xmodule/js/spec/helper.coffee
View file @
ce8eaa71
...
...
@@ -58,7 +58,7 @@ window.jQuery.ajaxWithPrefix = (url, settings) ->
oldAjaxWithPrefix
.
apply
@
,
arguments
# Time waitsFor() should wait for before failing a test.
window
.
WAIT_TIMEOUT
=
1
000
window
.
WAIT_TIMEOUT
=
5
000
jasmine
.
getFixtures
().
fixturesPath
+=
'fixtures'
...
...
common/lib/xmodule/xmodule/js/spec/video/html5_video_spec.js
View file @
ce8eaa71
...
...
@@ -16,7 +16,7 @@
});
afterEach
(
function
()
{
YT
.
Player
=
void
0
;
state
=
undefined
;
$
.
fn
.
scrollTo
.
reset
();
$
(
'.subtitles'
).
remove
();
$
(
'source'
).
remove
();
...
...
@@ -40,10 +40,7 @@
expect
(
player
.
video
.
play
).
toHaveBeenCalled
();
});
// Temporarily disabled due to intermittent failures
// Fails with "timeout: timed out after 1000 msec waiting for Player state should be changed"
// on Firefox
xit
(
'player state was changed'
,
function
()
{
it
(
'player state was changed'
,
function
()
{
waitsFor
(
function
()
{
return
player
.
getPlayerState
()
!==
STATUS
.
PAUSED
;
},
'Player state should be changed'
,
WAIT_TIMEOUT
);
...
...
@@ -63,36 +60,36 @@
});
});
});
});
describe
(
'when player is played
'
,
function
()
{
beforeEach
(
function
()
{
spyOn
(
player
.
video
,
'pause'
).
andCallThrough
();
player
.
playerState
=
STATUS
.
PLAYING
;
$
(
player
.
videoEl
).
trigger
(
'click'
);
});
describe
(
'when player is playing
'
,
function
()
{
beforeEach
(
function
()
{
spyOn
(
player
.
video
,
'pause'
).
andCallThrough
();
player
.
playerState
=
STATUS
.
PLAYING
;
$
(
player
.
videoEl
).
trigger
(
'click'
);
});
it
(
'native event was called'
,
function
()
{
expect
(
player
.
video
.
pause
).
toHaveBeenCalled
();
});
it
(
'native event was called'
,
function
()
{
expect
(
player
.
video
.
pause
).
toHaveBeenCalled
();
});
it
(
'player state was changed'
,
function
()
{
waitsFor
(
function
()
{
return
player
.
getPlayerState
()
!==
STATUS
.
PLAYING
;
},
'Player state should be changed'
,
WAIT_TIMEOUT
);
it
(
'player state was changed'
,
function
()
{
waitsFor
(
function
()
{
return
player
.
getPlayerState
()
!==
STATUS
.
PLAYING
;
},
'Player state should be changed'
,
WAIT_TIMEOUT
);
runs
(
function
()
{
expect
(
player
.
getPlayerState
()).
toBe
(
STATUS
.
PAUSED
);
runs
(
function
()
{
expect
(
player
.
getPlayerState
()).
toBe
(
STATUS
.
PAUSED
);
});
});
});
it
(
'callback was called'
,
function
()
{
waitsFor
(
function
()
{
return
player
.
getPlayerState
()
!==
STATUS
.
PLAYING
;
},
'Player state should be changed'
,
WAIT_TIMEOUT
);
it
(
'callback was called'
,
function
()
{
waitsFor
(
function
()
{
return
player
.
getPlayerState
()
!==
STATUS
.
PLAYING
;
},
'Player state should be changed'
,
WAIT_TIMEOUT
);
runs
(
function
()
{
expect
(
player
.
callStateChangeCallback
).
toHaveBeenCalled
();
runs
(
function
()
{
expect
(
player
.
callStateChangeCallback
).
toHaveBeenCalled
();
});
});
});
});
...
...
@@ -132,7 +129,11 @@
describe
(
'pause'
,
function
()
{
beforeEach
(
function
()
{
spyOn
(
player
.
video
,
'pause'
).
andCallThrough
();
player
.
playerState
=
STATUS
.
UNSTARTED
;
player
.
playVideo
();
waitsFor
(
function
()
{
return
player
.
getPlayerState
()
!==
STATUS
.
UNSTARTED
;
},
'Video never started playing'
,
WAIT_TIMEOUT
);
player
.
pauseVideo
();
});
...
...
@@ -142,7 +143,7 @@
it
(
'player state was changed'
,
function
()
{
waitsFor
(
function
()
{
return
player
.
getPlayerState
()
!==
STATUS
.
UNSTARTED
;
return
player
.
getPlayerState
()
!==
STATUS
.
PLAYING
;
},
'Player state should be changed'
,
WAIT_TIMEOUT
);
runs
(
function
()
{
...
...
@@ -152,7 +153,7 @@
it
(
'callback was called'
,
function
()
{
waitsFor
(
function
()
{
return
player
.
getPlayerState
()
!==
STATUS
.
UNSTARTED
;
return
player
.
getPlayerState
()
!==
STATUS
.
PLAYING
;
},
'Player state should be changed'
,
WAIT_TIMEOUT
);
runs
(
function
()
{
expect
(
player
.
callStateChangeCallback
).
toHaveBeenCalled
();
...
...
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