Bug 815441 - Make errors pre-empt emulator callback warning, r=mdas

This commit is contained in:
Jonathan Griffin 2012-11-27 13:58:58 -08:00
parent d2d56733bf
commit f601413333

View File

@ -305,12 +305,6 @@ function createExecuteContentSandbox(aWindow) {
sandbox.SpecialPowers = new SpecialPowers(aWindow);
sandbox.asyncComplete = function sandbox_asyncComplete(value, status) {
if (Object.keys(_emu_cbs).length) {
_emu_cbs = {};
value = "Emulator callback still pending when finish() called";
status = 500;
}
curWindow.removeEventListener("unload", errUnload, false);
/* clear all timeouts potentially generated by the script*/
@ -322,9 +316,17 @@ function createExecuteContentSandbox(aWindow) {
perf: elementManager.wrapValue(marionettePerf.getPerfData())});
marionetteLogObj.clearLogs();
marionettePerf.clearPerfData();
if (status == 0){
if (Object.keys(_emu_cbs).length) {
_emu_cbs = {};
sendError("Emulator callback still pending when finish() called",
500, null, asyncTestCommandId);
}
else {
sendResponse({value: elementManager.wrapValue(value), status: status}, asyncTestCommandId);
}
}
else {
sendError(value, status, null, asyncTestCommandId);
}