(event)
| 327 | } |
| 328 | }; |
| 329 | var onReadyStateChange = function (event) { |
| 330 | if (xhr != undefined) { // Opera 12 |
| 331 | if (xhr.readyState === 4) { |
| 332 | if (!("onload" in xhr) || !("onerror" in xhr) || !("onabort" in xhr)) { |
| 333 | onFinish(xhr.responseText === "" ? "error" : "load", event); |
| 334 | } |
| 335 | } else if (xhr.readyState === 3) { |
| 336 | if (!("onprogress" in xhr)) { // testing XMLHttpRequest#responseText too many times is too slow in IE 11 |
| 337 | // and in Firefox 3.6 |
| 338 | onProgress(); |
| 339 | } |
| 340 | } else if (xhr.readyState === 2) { |
| 341 | onStart(); |
| 342 | } |
| 343 | } |
| 344 | }; |
| 345 | var onTimeout = function () { |
| 346 | timeout = setTimeout(function () { |
| 347 | onTimeout(); |
no test coverage detected