Skip to content

Commit

Permalink
Add test expectations
Browse files Browse the repository at this point in the history
  • Loading branch information
joeyparrish committed Nov 4, 2022
1 parent 4035220 commit ba4445a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion test/hls/hls_parser_unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ describe('HlsParser', () => {
let parser;
/** @type {!jasmine.Spy} */
let onEventSpy;
/** @type {!jasmine.Spy} */
let newDrmInfoSpy;
/** @type {shaka.extern.ManifestParser.PlayerInterface} */
let playerInterface;
/** @type {shaka.extern.ManifestConfiguration} */
Expand Down Expand Up @@ -86,6 +88,7 @@ describe('HlsParser', () => {

config = shaka.util.PlayerConfiguration.createDefault().manifest;
onEventSpy = jasmine.createSpy('onEvent');
newDrmInfoSpy = jasmine.createSpy('newDrmInfo');
playerInterface = {
modifyManifestRequest: (request, manifestInfo) => {},
modifySegmentRequest: (request, segmentInfo) => {},
Expand All @@ -99,7 +102,7 @@ describe('HlsParser', () => {
isAutoLowLatencyMode: () => false,
enableLowLatencyMode: () => {},
updateDuration: () => {},
newDrmInfo: (stream) => {},
newDrmInfo: shaka.test.Util.spyFunc(newDrmInfoSpy),
};

parser = new shaka.hls.HlsParser();
Expand Down Expand Up @@ -2764,6 +2767,7 @@ describe('HlsParser', () => {
});

await testHlsParser(master, media, manifest);
expect(newDrmInfoSpy).toHaveBeenCalled();
});

it('constructs DrmInfo for PlayReady', async () => {
Expand Down Expand Up @@ -2804,6 +2808,7 @@ describe('HlsParser', () => {
});

await testHlsParser(master, media, manifest);
expect(newDrmInfoSpy).toHaveBeenCalled();
});

it('constructs DrmInfo for FairPlay', async () => {
Expand Down Expand Up @@ -2841,6 +2846,7 @@ describe('HlsParser', () => {
});

await testHlsParser(master, media, manifest);
expect(newDrmInfoSpy).toHaveBeenCalled();
});

it('constructs DrmInfo for ClearKey with explicit KEYFORMAT', async () => {
Expand Down Expand Up @@ -2875,6 +2881,7 @@ describe('HlsParser', () => {
});

await testHlsParser(master, media, manifest);
expect(newDrmInfoSpy).toHaveBeenCalled();
});

it('constructs DrmInfo for ClearKey without explicit KEYFORMAT', async () => {
Expand Down Expand Up @@ -2908,6 +2915,7 @@ describe('HlsParser', () => {
});

await testHlsParser(master, media, manifest);
expect(newDrmInfoSpy).toHaveBeenCalled();
});

it('falls back to mp4 if HEAD request fails', async () => {
Expand Down

0 comments on commit ba4445a

Please sign in to comment.