Fix tests
All seek-to-live type tests require setting readyState now
Showing
1 changed file
with
7 additions
and
0 deletions
... | @@ -335,6 +335,8 @@ test('autoplay seeks to the live point after playlist load', function() { | ... | @@ -335,6 +335,8 @@ test('autoplay seeks to the live point after playlist load', function() { |
335 | type: 'application/vnd.apple.mpegurl' | 335 | type: 'application/vnd.apple.mpegurl' |
336 | }); | 336 | }); |
337 | openMediaSource(player); | 337 | openMediaSource(player); |
338 | player.tech_.readyState = 3; | ||
339 | player.tech_.trigger('play'); | ||
338 | standardXHRResponse(requests.shift()); | 340 | standardXHRResponse(requests.shift()); |
339 | clock.tick(1); | 341 | clock.tick(1); |
340 | 342 | ||
... | @@ -355,6 +357,8 @@ test('autoplay seeks to the live point after media source open', function() { | ... | @@ -355,6 +357,8 @@ test('autoplay seeks to the live point after media source open', function() { |
355 | clock.tick(1); | 357 | clock.tick(1); |
356 | standardXHRResponse(requests.shift()); | 358 | standardXHRResponse(requests.shift()); |
357 | openMediaSource(player); | 359 | openMediaSource(player); |
360 | player.tech_.readyState = 3; | ||
361 | player.tech_.trigger('play'); | ||
358 | clock.tick(1); | 362 | clock.tick(1); |
359 | 363 | ||
360 | notEqual(currentTime, 0, 'seeked on autoplay'); | 364 | notEqual(currentTime, 0, 'seeked on autoplay'); |
... | @@ -406,6 +410,7 @@ test('calls `remove` on sourceBuffer to when loading a live segment', function() | ... | @@ -406,6 +410,7 @@ test('calls `remove` on sourceBuffer to when loading a live segment', function() |
406 | player.tech_.hls.playlists.trigger('loadedmetadata'); | 410 | player.tech_.hls.playlists.trigger('loadedmetadata'); |
407 | player.tech_.trigger('canplay'); | 411 | player.tech_.trigger('canplay'); |
408 | player.tech_.paused = function() { return false; }; | 412 | player.tech_.paused = function() { return false; }; |
413 | player.tech_.readyState = 3; | ||
409 | player.tech_.trigger('play'); | 414 | player.tech_.trigger('play'); |
410 | 415 | ||
411 | clock.tick(1); | 416 | clock.tick(1); |
... | @@ -1683,6 +1688,7 @@ test('live playlist starts three target durations before live', function() { | ... | @@ -1683,6 +1688,7 @@ test('live playlist starts three target durations before live', function() { |
1683 | equal(requests.length, 0, 'no outstanding segment request'); | 1688 | equal(requests.length, 0, 'no outstanding segment request'); |
1684 | 1689 | ||
1685 | player.tech_.paused = function() { return false; }; | 1690 | player.tech_.paused = function() { return false; }; |
1691 | player.tech_.readyState = 3; | ||
1686 | player.tech_.trigger('play'); | 1692 | player.tech_.trigger('play'); |
1687 | clock.tick(1); | 1693 | clock.tick(1); |
1688 | mediaPlaylist = player.tech_.hls.playlists.media(); | 1694 | mediaPlaylist = player.tech_.hls.playlists.media(); |
... | @@ -1703,6 +1709,7 @@ test('live playlist starts with correct currentTime value', function() { | ... | @@ -1703,6 +1709,7 @@ test('live playlist starts with correct currentTime value', function() { |
1703 | player.tech_.hls.playlists.trigger('loadedmetadata'); | 1709 | player.tech_.hls.playlists.trigger('loadedmetadata'); |
1704 | 1710 | ||
1705 | player.tech_.paused = function() { return false; }; | 1711 | player.tech_.paused = function() { return false; }; |
1712 | player.tech_.readyState = 3; | ||
1706 | player.tech_.trigger('play'); | 1713 | player.tech_.trigger('play'); |
1707 | clock.tick(1); | 1714 | clock.tick(1); |
1708 | 1715 | ... | ... |
-
Please register or sign in to post a comment