a98b7946 by Alex Rubin

Simplified test

1 parent b10e15b4
...@@ -1111,16 +1111,17 @@ test('resets the switching algorithm if a request times out', function() { ...@@ -1111,16 +1111,17 @@ test('resets the switching algorithm if a request times out', function() {
1111 'reset to the lowest bitrate playlist'); 1111 'reset to the lowest bitrate playlist');
1112 }); 1112 });
1113 1113
1114 test('handles xhr timeouts correctly', function (assert) { 1114 test('handles xhr timeouts correctly', function () {
1115 expect(1); 1115 var error;
1116 var clock = sinon.useFakeTimers(); 1116 var clock = sinon.useFakeTimers();
1117 videojs.Hls.xhr({ 1117 videojs.Hls.xhr({
1118 url: 'http://example.com', 1118 url: 'http://example.com',
1119 timeout: 1 1119 timeout: 1
1120 }, function(error) { 1120 }, function(innerError) {
1121 assert.strictEqual(error, 'timeout', 'called with timeout error'); 1121 error = innerError;
1122 }); 1122 });
1123 clock.tick(1); 1123 clock.tick(1);
1124 strictEqual(error, 'timeout', 'called with timeout error');
1124 clock.restore(); 1125 clock.restore();
1125 }); 1126 });
1126 1127
......