-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add functional test for Annex I reporting (#4669)
- Loading branch information
Showing
4 changed files
with
74 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import Constants from '../../src/Constants.js'; | ||
import Utils from '../../src/Utils.js'; | ||
|
||
import { | ||
checkIsPlaying, | ||
checkIsProgressing, | ||
checkNoCriticalErrors, | ||
initializeDashJsAdapter | ||
} from '../common/common.js'; | ||
import {expect} from 'chai'; | ||
|
||
const TESTCASE = Constants.TESTCASES.FEATURE_SUPPORT.ANNEX_I; | ||
|
||
Utils.getTestvectorsForTestcase(TESTCASE).forEach((item) => { | ||
const mpd = item.url; | ||
|
||
describe(`${TESTCASE} - ${item.name} - ${mpd}`, () => { | ||
let playerAdapter; | ||
|
||
before(() => { | ||
if (!item.testdata || !item.testdata.annexI || !item.testdata.annexI.mediaTypes || item.testdata.annexI.mediaTypes.length === 0 || !item.testdata.annexI.expectedQueryString) { | ||
this.skip(); | ||
} | ||
playerAdapter = initializeDashJsAdapter(item, mpd); | ||
}) | ||
|
||
after(() => { | ||
playerAdapter.destroy(); | ||
}) | ||
|
||
it(`Checking playing state`, async () => { | ||
await checkIsPlaying(playerAdapter, true); | ||
}) | ||
|
||
it(`Checking progressing state`, async () => { | ||
await checkIsProgressing(playerAdapter); | ||
}); | ||
|
||
|
||
it(`Expect requests to have Annex I query parameters`, async () => { | ||
for (const mediaType of item.testdata.annexI.mediaTypes) { | ||
const eventPayload = await playerAdapter.waitForMediaSegmentDownload(Constants.TEST_TIMEOUT_THRESHOLDS.EVENT_WAITING_TIME, mediaType) | ||
expect(eventPayload.request).to.not.be.undefined; | ||
expect(eventPayload.request.url).to.not.be.undefined; | ||
const requestUrl = eventPayload.request.url; | ||
const url = new URL(requestUrl); | ||
const queryParameterString = url.search; | ||
expect(queryParameterString).to.be.equal(item.testdata.annexI.expectedQueryString); | ||
} | ||
}) | ||
|
||
it(`Expect no critical errors to be thrown`, () => { | ||
checkNoCriticalErrors(playerAdapter); | ||
}) | ||
|
||
}) | ||
}) |