@ -2286,6 +2286,9 @@ QUnit.test('switches off subtitles on subtitle errors', function(assert) {
assert . equal ( textTracks [ 1 ] . kind , 'subtitles' , 'kind is subtitles' ) ;
assert . equal ( textTracks [ 1 ] . kind , 'subtitles' , 'kind is subtitles' ) ;
textTracks [ 1 ] . mode = 'showing' ;
textTracks [ 1 ] . mode = 'showing' ;
// Wait for VTT segment to be requested
this . clock . tick ( 1 ) ;
assert . equal ( this . requests . length , 1 , 'made a request' ) ;
assert . equal ( this . requests . length , 1 , 'made a request' ) ;
assert . equal ( textTracks [ 1 ] . mode , 'showing' , 'text track still showing' ) ;
assert . equal ( textTracks [ 1 ] . mode , 'showing' , 'text track still showing' ) ;
@ -2302,6 +2305,9 @@ QUnit.test('switches off subtitles on subtitle errors', function(assert) {
// re-enable first text track
// re-enable first text track
textTracks [ 1 ] . mode = 'showing' ;
textTracks [ 1 ] . mode = 'showing' ;
// Wait for VTT segment request to be made
this . clock . tick ( 1 ) ;
assert . equal ( this . requests . length , 1 , 'made a request' ) ;
assert . equal ( this . requests . length , 1 , 'made a request' ) ;
assert . equal ( textTracks [ 1 ] . mode , 'showing' , 'text track still showing' ) ;
assert . equal ( textTracks [ 1 ] . mode , 'showing' , 'text track still showing' ) ;
@ -2360,6 +2366,9 @@ QUnit.test('pauses subtitle segment loader on tech errors', function(assert) {
assert . equal ( textTracks [ 1 ] . kind , 'subtitles' , 'kind is subtitles' ) ;
assert . equal ( textTracks [ 1 ] . kind , 'subtitles' , 'kind is subtitles' ) ;
textTracks [ 1 ] . mode = 'showing' ;
textTracks [ 1 ] . mode = 'showing' ;
// Wait for VTT segment request to be made
this . clock . tick ( 1 ) ;
let pauseCount = 0 ;
let pauseCount = 0 ;
masterPlaylistController . subtitleSegmentLoader_ . pause = ( ) => pauseCount ++ ;
masterPlaylistController . subtitleSegmentLoader_ . pause = ( ) => pauseCount ++ ;
@ -2421,6 +2430,9 @@ QUnit.test('disposes subtitle loaders on dispose', function(assert) {
assert . equal ( textTracks [ 1 ] . kind , 'subtitles' , 'kind is subtitles' ) ;
assert . equal ( textTracks [ 1 ] . kind , 'subtitles' , 'kind is subtitles' ) ;
textTracks [ 1 ] . mode = 'showing' ;
textTracks [ 1 ] . mode = 'showing' ;
// Wait for VTT segment request to be made
this . clock . tick ( 1 ) ;
assert . ok ( masterPlaylistController . mediaTypes_ . SUBTITLES . activePlaylistLoader ,
assert . ok ( masterPlaylistController . mediaTypes_ . SUBTITLES . activePlaylistLoader ,
'has a subtitle playlist loader' ) ;
'has a subtitle playlist loader' ) ;
assert . ok ( masterPlaylistController . subtitleSegmentLoader_ ,
assert . ok ( masterPlaylistController . subtitleSegmentLoader_ ,
@ -2468,6 +2480,9 @@ QUnit.test('subtitle segment loader resets on seeks', function(assert) {
assert . equal ( textTracks [ 1 ] . kind , 'subtitles' , 'kind is subtitles' ) ;
assert . equal ( textTracks [ 1 ] . kind , 'subtitles' , 'kind is subtitles' ) ;
textTracks [ 1 ] . mode = 'showing' ;
textTracks [ 1 ] . mode = 'showing' ;
// Wait for VTT segment request to be made
this . clock . tick ( 1 ) ;
let resetCount = 0 ;
let resetCount = 0 ;
let abortCount = 0 ;
let abortCount = 0 ;
let loadCount = 0 ;
let loadCount = 0 ;