video-js-hls_test.js
1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
(function(window) {
/*
======== A Handy Little QUnit Reference ========
http://api.qunitjs.com/
Test methods:
module(name, {[setup][ ,teardown]})
test(name, callback)
expect(numberOfAssertions)
stop(increment)
start(decrement)
Test assertions:
ok(value, [message])
equal(actual, expected, [message])
notEqual(actual, expected, [message])
deepEqual(actual, expected, [message])
notDeepEqual(actual, expected, [message])
strictEqual(actual, expected, [message])
notStrictEqual(actual, expected, [message])
throws(block, [expected], [message])
*/
var parser;
module('environment');
test('is sane', function() {
expect(1);
ok(true);
});
module('segment parser', {
setup: function() {
parser = new window.videojs.hls.SegmentParser();
}
});
test('creates an flv header', function() {
var header = parser.getFlvHeader();
ok(header, 'the header is truthy');
equal(9 + 4, header.byteLength, 'the header length is correct');
equal(header[0], 'F'.charCodeAt(0), 'the signature is correct');
equal(header[1], 'L'.charCodeAt(0), 'the signature is correct');
equal(header[2], 'V'.charCodeAt(0), 'the signature is correct');
});
test('parses the first bipbop segment', function() {
parser.parseSegmentBinaryData(window.testSegment);
ok(parser.tagsAvailable(), 'tags should be available');
});
})(this);