From 01ee8c8c766dd6504bba024229cb3612f6a8d0b9 Mon Sep 17 00:00:00 2001 From: Pawel Bartkowiak Date: Fri, 30 Jun 2023 11:11:46 +0200 Subject: [PATCH] Change seek positions for dynamic source --- src/mediaTests.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/mediaTests.js b/src/mediaTests.js index 8e392c9..7848946 100644 --- a/src/mediaTests.js +++ b/src/mediaTests.js @@ -38,7 +38,7 @@ function waitForEvent(video, runner, event, predicate = null, maxWaitTimeMs = 10 function eventHandler() { if (harnessConfig.debug) { - runner.log("current time: " + video.currentTime) + runner.log("current time: " + video.currentTime); } if (!predicate || predicate(video)) { receivedEvents += 1; @@ -224,7 +224,8 @@ var testSetPosition = new TestTemplate("Seek", function (video, runner) { const hasVideoTrack = this.content.video; var positions = [0, 20, 45]; if (this.content.dynamic) { - positions = [video.currentTime - 10, video.currentTime + 10, video.currentTime]; + let curTime = video.currentTime; + positions = [curTime - 40, curTime - 20, curTime]; } const makeSeekTest = function (position) { @@ -232,8 +233,9 @@ var testSetPosition = new TestTemplate("Seek", function (video, runner) { return new Promise((resolve, _) => { runner.log("Changing position to " + position); seek(video, runner, position).then(() => { - runner.checkGE(video.currentTime, position, "currentTime should be greater or equal to seek point"); - runner.checkGr(position + 10, video.currentTime, "currentTime should be less than seek point + 10s"); + let curTime = video.currentTime; + runner.checkGE(curTime, position, "currentTime should be greater or equal to seek point"); + runner.checkGr(position + 10, curTime, "currentTime should be less than seek point + 10s"); checkVideoFramesIncreasing(video, runner, hasVideoTrack).then(resolve); }); });