Call correct quit function and wait request sending.
This commit is contained in:
parent
70ce3a88a1
commit
339f8f0ac9
@ -352,9 +352,16 @@ function snapshotCurrentPage(task, failure) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function sendQuitRequest() {
|
function sendQuitRequest(cb) {
|
||||||
var r = new XMLHttpRequest();
|
var r = new XMLHttpRequest();
|
||||||
r.open('POST', '/tellMeToQuit?path=' + escape(appPath), false);
|
r.open('POST', '/tellMeToQuit?path=' + escape(appPath), false);
|
||||||
|
r.onreadystatechange = function sendQuitRequestOnreadystatechange(e) {
|
||||||
|
if (r.readyState == 4) {
|
||||||
|
if (cb) {
|
||||||
|
cb();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
r.send(null);
|
r.send(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -362,12 +369,13 @@ function quitApp() {
|
|||||||
log('Done !');
|
log('Done !');
|
||||||
document.body.innerHTML = 'Tests are finished. <h1>CLOSE ME!</h1>' +
|
document.body.innerHTML = 'Tests are finished. <h1>CLOSE ME!</h1>' +
|
||||||
document.body.innerHTML;
|
document.body.innerHTML;
|
||||||
if (window.SpecialPowers) {
|
sendQuitRequest(function () {
|
||||||
SpecialPowers.quitApplication();
|
if (window.SpecialPowers) {
|
||||||
} else {
|
SpecialPowers.quit();
|
||||||
sendQuitRequest();
|
} else {
|
||||||
window.close();
|
window.close();
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function done() {
|
function done() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user