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
bd4b4c16
Commit
bd4b4c16
authored
Sep 06, 2013
by
Valera Rozuvan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #867 from edx/valera/video_single_yt_xhr_jasmine_test
Valera/video single yt xhr jasmine test
parents
faf1f548
b2c605a1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
211 additions
and
0 deletions
+211
-0
common/lib/xmodule/xmodule/js/fixtures/video_yt_multiple.html
+171
-0
common/lib/xmodule/xmodule/js/spec/video/general_spec.js
+40
-0
No files found.
common/lib/xmodule/xmodule/js/fixtures/video_yt_multiple.html
0 → 100644
View file @
bd4b4c16
<div
class=
"course-content"
>
<div
id=
"video_example1"
>
<div
id=
"example1"
>
<div
id=
"video_id1"
class=
"video"
data-streams=
"0.75:7tqY6eQzVhE,1.0:cogebirgzzM"
data-show-captions=
"true"
data-start=
""
data-end=
""
data-caption-asset-path=
"/static/subs/"
data-autoplay=
"False"
data-yt-test-timeout=
"1500"
data-yt-test-url=
"https://gdata.youtube.com/feeds/api/videos/"
>
<div
class=
"tc-wrapper"
>
<article
class=
"video-wrapper"
>
<div
class=
"video-player-pre"
></div>
<section
class=
"video-player"
>
<div
id=
"id1"
></div>
</section>
<div
class=
"video-player-post"
></div>
<section
class=
"video-controls"
>
<div
class=
"slider"
></div>
<div>
<ul
class=
"vcr"
>
<li><a
class=
"video_control"
href=
"#"
title=
"Play"
></a></li>
<li><div
class=
"vidtime"
>
0:00 / 0:00
</div></li>
</ul>
<div
class=
"secondary-controls"
>
<div
class=
"speeds"
>
<a
href=
"#"
>
<h3>
Speed
</h3>
<p
class=
"active"
></p>
</a>
<ol
class=
"video_speeds"
></ol>
</div>
<div
class=
"volume"
>
<a
href=
"#"
></a>
<div
class=
"volume-slider-container"
>
<div
class=
"volume-slider"
></div>
</div>
</div>
<a
href=
"#"
class=
"add-fullscreen"
title=
"Fill browser"
>
Fill Browser
</a>
<a
href=
"#"
class=
"quality_control"
title=
"HD"
>
HD
</a>
<a
href=
"#"
class=
"hide-subtitles"
title=
"Turn off captions"
>
Captions
</a>
</div>
</div>
</section>
</article>
<ol
class=
"subtitles"
><li></li></ol>
</div>
</div>
</div>
</div>
</div>
<div
class=
"course-content"
>
<div
id=
"video_example2"
>
<div
id=
"example2"
>
<div
id=
"video_id2"
class=
"video"
data-streams=
"0.75:7tqY6eQzVhE,1.0:cogebirgzzM"
data-show-captions=
"true"
data-start=
""
data-end=
""
data-caption-asset-path=
"/static/subs/"
data-autoplay=
"False"
data-yt-test-timeout=
"1500"
data-yt-test-url=
"https://gdata.youtube.com/feeds/api/videos/"
>
<div
class=
"tc-wrapper"
>
<article
class=
"video-wrapper"
>
<div
class=
"video-player-pre"
></div>
<section
class=
"video-player"
>
<div
id=
"id2"
></div>
</section>
<div
class=
"video-player-post"
></div>
<section
class=
"video-controls"
>
<div
class=
"slider"
></div>
<div>
<ul
class=
"vcr"
>
<li><a
class=
"video_control"
href=
"#"
title=
"Play"
></a></li>
<li><div
class=
"vidtime"
>
0:00 / 0:00
</div></li>
</ul>
<div
class=
"secondary-controls"
>
<div
class=
"speeds"
>
<a
href=
"#"
>
<h3>
Speed
</h3>
<p
class=
"active"
></p>
</a>
<ol
class=
"video_speeds"
></ol>
</div>
<div
class=
"volume"
>
<a
href=
"#"
></a>
<div
class=
"volume-slider-container"
>
<div
class=
"volume-slider"
></div>
</div>
</div>
<a
href=
"#"
class=
"add-fullscreen"
title=
"Fill browser"
>
Fill Browser
</a>
<a
href=
"#"
class=
"quality_control"
title=
"HD"
>
HD
</a>
<a
href=
"#"
class=
"hide-subtitles"
title=
"Turn off captions"
>
Captions
</a>
</div>
</div>
</section>
</article>
<ol
class=
"subtitles"
><li></li></ol>
</div>
</div>
</div>
</div>
</div>
<div
class=
"course-content"
>
<div
id=
"video_example3"
>
<div
id=
"example3"
>
<div
id=
"video_id3"
class=
"video"
data-streams=
"0.75:7tqY6eQzVhE,1.0:cogebirgzzM"
data-show-captions=
"true"
data-start=
""
data-end=
""
data-caption-asset-path=
"/static/subs/"
data-autoplay=
"False"
data-yt-test-timeout=
"1500"
data-yt-test-url=
"https://gdata.youtube.com/feeds/api/videos/"
>
<div
class=
"tc-wrapper"
>
<article
class=
"video-wrapper"
>
<div
class=
"video-player-pre"
></div>
<section
class=
"video-player"
>
<div
id=
"id3"
></div>
</section>
<div
class=
"video-player-post"
></div>
<section
class=
"video-controls"
>
<div
class=
"slider"
></div>
<div>
<ul
class=
"vcr"
>
<li><a
class=
"video_control"
href=
"#"
title=
"Play"
></a></li>
<li><div
class=
"vidtime"
>
0:00 / 0:00
</div></li>
</ul>
<div
class=
"secondary-controls"
>
<div
class=
"speeds"
>
<a
href=
"#"
>
<h3>
Speed
</h3>
<p
class=
"active"
></p>
</a>
<ol
class=
"video_speeds"
></ol>
</div>
<div
class=
"volume"
>
<a
href=
"#"
></a>
<div
class=
"volume-slider-container"
>
<div
class=
"volume-slider"
></div>
</div>
</div>
<a
href=
"#"
class=
"add-fullscreen"
title=
"Fill browser"
>
Fill Browser
</a>
<a
href=
"#"
class=
"quality_control"
title=
"HD"
>
HD
</a>
<a
href=
"#"
class=
"hide-subtitles"
title=
"Turn off captions"
>
Captions
</a>
</div>
</div>
</section>
</article>
<ol
class=
"subtitles"
><li></li></ol>
</div>
</div>
</div>
</div>
</div>
common/lib/xmodule/xmodule/js/spec/video/general_spec.js
View file @
bd4b4c16
...
...
@@ -186,6 +186,46 @@
});
});
describe
(
'multiple YT on page'
,
function
()
{
var
state1
,
state2
,
state3
;
beforeEach
(
function
()
{
loadFixtures
(
'video_yt_multiple.html'
);
spyOn
(
$
,
'ajaxWithPrefix'
);
$
.
ajax
.
calls
.
length
=
0
;
$
.
ajaxWithPrefix
.
calls
.
length
=
0
;
// Because several other tests have run, the variable
// that stores the value of the first ajax request must be
// cleared so that we test a pristine state of the video
// module.
Video
.
clearYoutubeXhr
();
state1
=
new
Video
(
'#example1'
);
state2
=
new
Video
(
'#example2'
);
state3
=
new
Video
(
'#example3'
);
});
it
(
'check for YT availability is performed only once'
,
function
()
{
var
numAjaxCalls
=
0
;
// Total ajax calls made.
numAjaxCalls
=
$
.
ajax
.
calls
.
length
;
// Subtract ajax calls to get captions.
numAjaxCalls
-=
$
.
ajaxWithPrefix
.
calls
.
length
;
// Subtract ajax calls to get metadata for each video.
numAjaxCalls
-=
3
;
// This should leave just one call. It was made to check
// for YT availability.
expect
(
numAjaxCalls
).
toBe
(
1
);
});
});
describe
(
'setSpeed'
,
function
()
{
describe
(
'YT'
,
function
()
{
beforeEach
(
function
()
{
...
...
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