Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
brainfood
/
videojs-contrib-hls
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
e64ce8ac
authored
2014-10-06 13:28:04 -0700
by
Alex Rubin
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Moved XHR test to separate file
1 parent
044200b7
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
14 deletions
test/videojs-hls.html
test/videojs-hls_test.js
test/xhr_test.js
test/videojs-hls.html
View file @
e64ce8a
...
...
@@ -58,6 +58,7 @@
<script
src=
"m3u8_test.js"
></script>
<script
src=
"playlist-loader_test.js"
></script>
<script
src=
"decrypter_test.js"
></script>
<script
src=
"xhr_test.js"
></script>
</head>
<body>
<div
id=
"qunit"
></div>
...
...
test/videojs-hls_test.js
View file @
e64ce8a
...
...
@@ -1108,20 +1108,6 @@ test('resets the switching algorithm if a request times out', function() {
'reset to the lowest bitrate playlist'
);
});
test
(
'handles xhr timeouts correctly'
,
function
()
{
var
error
;
var
clock
=
sinon
.
useFakeTimers
();
videojs
.
Hls
.
xhr
({
url
:
'http://example.com'
,
timeout
:
1
},
function
(
innerError
)
{
error
=
innerError
;
});
clock
.
tick
(
1
);
strictEqual
(
error
,
'timeout'
,
'called with timeout error'
);
clock
.
restore
();
});
test
(
'disposes the playlist loader'
,
function
()
{
var
disposes
=
0
,
player
,
loaderDispose
;
player
=
createPlayer
();
...
...
test/xhr_test.js
0 → 100644
View file @
e64ce8a
(
function
(
window
,
videojs
,
undefined
)
{
'use strict'
;
/*
XHR test suite
*/
var
xhr
;
module
(
'XHR'
,
{
setup
:
function
()
{
xhr
=
sinon
.
useFakeXMLHttpRequest
();
},
teardown
:
function
()
{
xhr
.
restore
();
}
});
test
(
'handles xhr timeouts correctly'
,
function
()
{
var
error
;
var
clock
=
sinon
.
useFakeTimers
();
videojs
.
Hls
.
xhr
({
url
:
'http://example.com'
,
timeout
:
1
},
function
(
innerError
)
{
error
=
innerError
;
});
clock
.
tick
(
1
);
strictEqual
(
error
,
'timeout'
,
'called with timeout error'
);
clock
.
restore
();
});
})(
window
,
window
.
videojs
);
Please
register
or
sign in
to post a comment