Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
peaBerberian committed Oct 13, 2023
1 parent 4f5ed70 commit 10d633f
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions tests/integration/utils/launch_tests_for_content.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ export default function launchTestsForContent(manifestInfos) {
manifestLoaderCalledTimes++;
callbacks.fallback();
};
const segmentLoader = (info) => {
const segmentLoader = (info, callbacks) => {
requestedSegments.push(info.url);
callbacks.fallback();
// do nothing else
};

Expand All @@ -94,8 +95,9 @@ export default function launchTestsForContent(manifestInfos) {
expect(manifestLoaderCalledTimes).to.equal(1);

expect(player.getPlayerState()).to.equal("LOADING");
await sleep(50);
expect(player.getPlayerState()).to.equal("LOADED");
const loadingTime = performance.now();
await waitForLoadedStateAfterLoadVideo(player);
expect(performance.now() - loadingTime).to.be.at.most(1000);

const firstPeriodAdaptationsInfos = periodsInfos[firstPeriodIndex]
.adaptations;
Expand Down Expand Up @@ -148,17 +150,19 @@ export default function launchTestsForContent(manifestInfos) {
});

if (transport === "dash" || transport === "smooth") {
it("should not do the initial manifest request if an `initialManifest` option is set as a string", async function () {
it.only("should not do the initial manifest request if an `initialManifest` option is set as a string", async function () {
const initialManifest = await (
(await fetch(manifestInfos.url))
.text());
let manifestLoaderCalledTimes = 0;
let segmentLoaderLoaderCalledTimes = 0;
const manifestLoader = () => {
const manifestLoader = (_, callbacks) => {
manifestLoaderCalledTimes++;
callbacks.fallback();
};
const segmentLoader = () => {
const segmentLoader = (_, callbacks) => {
segmentLoaderLoaderCalledTimes++;
callbacks.fallback();
};
player.loadVideo({
url: manifestInfos.url,
Expand All @@ -168,7 +172,9 @@ export default function launchTestsForContent(manifestInfos) {
segmentLoader,
});

await sleep(100);
await waitForLoadedStateAfterLoadVideo(player);
console.warn("!!!!!!", player.getPlayerState());
console.warn("!!!!!!", player.getError());
expect(manifestLoaderCalledTimes).to.equal(0);
expect(segmentLoaderLoaderCalledTimes).to.be.at.least(1);
});
Expand Down

0 comments on commit 10d633f

Please sign in to comment.