Bug 1115222 - Only call performTest once the appropriate load event is received for webconsole response header test;r=past

This commit is contained in:
Brian Grinstead 2015-01-07 09:16:12 -08:00
Родитель 59bd93c975
Коммит eacd9aa1ee
1 изменённых файлов: 5 добавлений и 6 удалений

Просмотреть файл

@ -16,12 +16,6 @@ function performTest(aRequest, aConsole)
{
let deferred = promise.defer();
loads++;
ok(aRequest, "page load was logged");
if (loads != 2) {
return;
}
let headers = null;
function readHeader(aName)
@ -64,6 +58,11 @@ function performTest(aRequest, aConsole)
function waitForRequest() {
let deferred = promise.defer();
HUDService.lastFinishedRequest.callback = (req, console) => {
loads++;
ok(req, "page load was logged");
if (loads != 2) {
return;
}
performTest(req, console).then(deferred.resolve);
};
return deferred.promise;