Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
harisha-swaminathan committed Jul 10, 2023
1 parent 1656fe4 commit 550103f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
3 changes: 0 additions & 3 deletions src/util/time.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,6 @@ export const getProgramTime = ({
programTimeObject.programDateTime = programTime.toISOString();
}

// eslint-disable-next-line
console.log(',,,,2', programTimeObject);

return callback(null, programTimeObject);
};

Expand Down
14 changes: 7 additions & 7 deletions test/segment-loader.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4563,23 +4563,23 @@ QUnit.module('SegmentLoader', function(hooks) {
const playlist1Start = new Date('2021-01-01T00:00:00.000-05:00').getTime();

playlist1.segments[0].programDateTime = playlist1Start;
playlist1.segments[1].programDateTime = new Date(playlist1Start + segmentDurationMs);
playlist1.segments[1].programDateTime = new Date(playlist1Start + segmentDurationMs).getTime();
// jump of 0.5 seconds after disco (0.5 seconds of missing real world time, e.g.,
// an encoder went down briefly), should have a PDT mapping difference of -3.5
// seconds from first mapping
playlist1.segments[2].programDateTime = new Date(playlist1.segments[1].programDateTime + segmentDurationMs + 500);
playlist1.segments[3].programDateTime = new Date(playlist1.segments[2].programDateTime + segmentDurationMs);
playlist1.segments[2].programDateTime = new Date(playlist1.segments[1].programDateTime + segmentDurationMs + 500).getTime();
playlist1.segments[3].programDateTime = new Date(playlist1.segments[2].programDateTime + segmentDurationMs).getTime();

// offset by 0.25 seconds from playlist1
const playlist2Start = new Date('2021-01-01T00:00:00.250-05:00');

playlist2.segments[0].programDateTime = playlist2Start;
playlist2.segments[1].programDateTime = new Date(playlist2Start + segmentDurationMs);
playlist2.segments[0].programDateTime = playlist2Start.getTime();
playlist2.segments[1].programDateTime = new Date(playlist2Start + segmentDurationMs).getTime();
// jump of 0.5 seconds after disco (0.5 seconds of missing real world time, e.g.,
// an encoder went down briefly), should have a PDT mapping difference of -3.5
// seconds from first mapping
playlist2.segments[2].programDateTime = new Date(playlist2.segments[1].programDateTime + segmentDurationMs + 500);
playlist2.segments[3].programDateTime = new Date(playlist2.segments[2].programDateTime + segmentDurationMs);
playlist2.segments[2].programDateTime = new Date(playlist2.segments[1].programDateTime + segmentDurationMs + 500).getTime();
playlist2.segments[3].programDateTime = new Date(playlist2.segments[2].programDateTime + segmentDurationMs).getTime();

const {
mediaSource_: mediaSource,
Expand Down
2 changes: 1 addition & 1 deletion test/util/time.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ QUnit.test('returns programDateTime parsed from media segment tags', function(as
assert.equal(err, null, 'no error');
assert.equal(
programTime.programDateTime,
playlist.segments[0].programDateTime,
new Date(playlist.segments[0].programDateTime).toISOString(),
'uses programDateTime found in media segments'
);
done();
Expand Down

0 comments on commit 550103f

Please sign in to comment.