Support onload/onerror events on XMLHttpRequest.

This commit is contained in:
Hristo Deshev
2015-06-15 14:28:16 +03:00
parent acfb51bba2
commit f109cbe80b
3 changed files with 37 additions and 3 deletions

View File

@ -598,3 +598,21 @@ export var test_XMLHttpRequest_requestShouldBePossibleAfterAbort = function (don
xhr.send(JSON.stringify({ MyVariableOne: "ValueOne", MyVariableTwo: "ValueTwo" }));
};
export function test_raises_onload_Event(done) {
let xhr = new XMLHttpRequest();
xhr.onload = () => {
done(null);
}
xhr.open("GET", "https://httpbin.org/get");
xhr.send();
}
export function test_raises_onerror_Event(done) {
let xhr = new XMLHttpRequest();
xhr.onerror = () => {
done(null);
}
xhr.open("GET", "https://no-such-domain-httpbin.org");
xhr.send();
}