b10e15b4 by Alex Rubin

Updated test

1 parent f7632439
...@@ -1111,21 +1111,17 @@ test('resets the switching algorithm if a request times out', function() { ...@@ -1111,21 +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 asyncTest('handles xhr timeouts correctly', function (assert) { 1114 test('handles xhr timeouts correctly', function (assert) {
1115 var testTimeout = setTimeout(function() { 1115 expect(1);
1116 // since we are faking xhr, the test will hang if we don't 1116 var clock = sinon.useFakeTimers();
1117 // manually end it (ontimeout will never be called)
1118 ok(false, 'request was not completed');
1119 start();
1120 }, 10 * 1000);
1121 videojs.Hls.xhr({ 1117 videojs.Hls.xhr({
1122 url: 'http://example.com', 1118 url: 'http://example.com',
1123 timeout: 1 1119 timeout: 1
1124 }, function(error) { 1120 }, function(error) {
1125 assert.strictEqual(error, 'timeout', 'called with timeout error'); 1121 assert.strictEqual(error, 'timeout', 'called with timeout error');
1126 clearTimeout(testTimeout);
1127 start();
1128 }); 1122 });
1123 clock.tick(1);
1124 clock.restore();
1129 }); 1125 });
1130 1126
1131 test('disposes the playlist loader', function() { 1127 test('disposes the playlist loader', function() {
......