mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 759789 - Don't move on to the next test (or finishing) until we get all expected non-optional 'loadend' events. r=smaug
This commit is contained in:
parent
549c88c013
commit
a5de49366d
@ -45,9 +45,20 @@ function logEvent(evt) {
|
||||
}
|
||||
}
|
||||
|
||||
function stop(evt) {
|
||||
function hasPendingNonOptionalEvent(ev) {
|
||||
var i = 0;
|
||||
while (i < currentEvents.length) {
|
||||
if (!currentEvents[i].optional && currentEvents[i].type == ev)
|
||||
return true;
|
||||
++i;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function maybeStop(evt) {
|
||||
logEvent(evt);
|
||||
nextTest();
|
||||
if (!hasPendingNonOptionalEvent("loadend"))
|
||||
nextTest();
|
||||
}
|
||||
|
||||
function openXHR(xhr, method, url, privileged) {
|
||||
@ -83,7 +94,7 @@ function start(obj) {
|
||||
}
|
||||
xhr.onloadend =
|
||||
function (evt) {
|
||||
stop(evt);
|
||||
maybeStop(evt);
|
||||
}
|
||||
xhr.onloadstart =
|
||||
function (evt) {
|
||||
@ -121,7 +132,7 @@ function start(obj) {
|
||||
}
|
||||
xhr.upload.onloadend =
|
||||
function (evt) {
|
||||
logEvent(evt);
|
||||
maybeStop(evt);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user