Merge pull request #1490 from arturadib/fix-test-duplicates

Fix ordering of test snapshots
This commit is contained in:
Yury Delendik 2012-04-05 07:36:58 -07:00
commit 1a067ccf40

View File

@ -248,8 +248,11 @@ function done() {
}
}
function sendTaskResult(snapshot, task, failure) {
var result = { browser: browser,
function sendTaskResult(snapshot, task, failure, result) {
// Optional result argument is for retrying XHR requests - see below
if (!result) {
result = JSON.stringify({
browser: browser,
id: task.id,
numPages: task.pdfDoc ?
(task.pageLimit || task.pdfDoc.numPages) : 0,
@ -257,7 +260,9 @@ function sendTaskResult(snapshot, task, failure) {
file: task.file,
round: task.round,
page: task.pageNum,
snapshot: snapshot };
snapshot: snapshot
});
}
var r = new XMLHttpRequest();
// (The POST URI is ignored atm.)
@ -268,11 +273,11 @@ function sendTaskResult(snapshot, task, failure) {
inFlightRequests--;
// Retry until successful
if (r.status !== 200)
sendTaskResult(snapshot, task, failure);
sendTaskResult(null, null, null, result);
}
};
document.getElementById('inFlightCount').innerHTML = inFlightRequests++;
r.send(JSON.stringify(result));
r.send(result);
}
function clear(ctx) {