Skip to content

Commit

Permalink
test: Fix test expectations in StreamingEngine integration
Browse files Browse the repository at this point in the history
This test case was to show that we don't seek when the app suppresses
gap jumping.  However, it set expectations based on time, and on Xbox
One, the platform plays all the way through the gap.  This broke our
time exepctations.

Instead of _inferring_ that we don't seek based on time, we should
directly measure seeking.  This is more robust to platform
differences.

Change-Id: I8a5227d3d33e9e87cab9872e3a61aa47ed1b332c
  • Loading branch information
joeyparrish committed Mar 30, 2021
1 parent 572e512 commit 95371df
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions test/media/streaming_engine_integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -522,13 +522,20 @@ describe('StreamingEngine', () => {
// readyState is 0.
await waiter.timeoutAfter(5).waitForEvent(video, 'loadeddata');

let seekCount = 0;
eventManager.listen(video, 'seeking', () => {
seekCount++;
});

video.currentTime = 8;
video.play();

await shaka.test.Util.delay(5);
// IE/Edge somehow plays inside the gap. Just make sure we
// don't jump the gap.
expect(video.currentTime).toBeLessThan(20);

// IE/Edge somehow plays _into_ the gap, and Xbox One plays _through_ the
// gap. Just make sure _we_ don't jump the gap by seeking. One seek is
// required to start playback at time 8.
expect(seekCount).toBe(1);
});

/**
Expand Down

0 comments on commit 95371df

Please sign in to comment.