Skip to content
This repository was archived by the owner on Jan 12, 2019. It is now read-only.

Commit

Permalink
add vod test for expired
Browse files Browse the repository at this point in the history
  • Loading branch information
mjneil committed Apr 27, 2017
1 parent e381762 commit 26c5e1a
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions test/sync-controller.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -397,4 +397,72 @@ QUnit.test('Correctly calculates expired time', function(assert) {
expired = this.syncController.getExpiredTime(playlist, Infinity);

assert.equal(expired, 100.8, 'estimated expired time using segmentSync');

playlist = {
targetDuration: 10,
discontinuityStarts: [],
mediaSequence: 100,
endList: true,
segments: [
{
duration: 10,
uri: '0.ts'
},
{
duration: 10,
uri: '1.ts'
},
{
duration: 10,
uri: '2.ts'
},
{
duration: 10,
uri: '3.ts'
},
{
duration: 10,
uri: '4.ts'
}
]
};

expired = this.syncController.getExpiredTime(playlist, 50);

assert.equal(expired, 0, 'estimated expired time using segmentSync');

playlist = {
targetDuration: 10,
discontinuityStarts: [],
mediaSequence: 100,
endList: true,
segments: [
{
start: 0.006,
duration: 10,
uri: '0.ts',
end: 9.982
},
{
duration: 10,
uri: '1.ts'
},
{
duration: 10,
uri: '2.ts'
},
{
duration: 10,
uri: '3.ts'
},
{
duration: 10,
uri: '4.ts'
}
]
};

expired = this.syncController.getExpiredTime(playlist, 50);

assert.equal(expired, 0, 'estimated expired time using segmentSync');
});

0 comments on commit 26c5e1a

Please sign in to comment.