Bug 831428 test fixup in test_bug429785 - don't remove the listener until it has received the console messages, r=bz

This commit is contained in:
Benjamin Smedberg 2013-01-29 11:02:56 -05:00
parent 2fecbd6cc7
commit 3515cc5926

View File

@ -35,12 +35,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=429785
function step2() {
is(errorLogged, false, "Should be no errors");
serv.registerListener(listener);
try {
serv.logStringMessage("This is a test");
} finally {
serv.unregisterListener(listener);
}
serv.logStringMessage("This is a test");
setTimeout(step3, 0);
@ -48,20 +43,19 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=429785
function step3() {
is(errorLogged, true, "Should see errors when they happen");
serv.unregisterListener(listener);
SimpleTest.finish();
}
serv.registerListener(listener);
try {
var p = new DOMParser();
p.parseFromString("<root/>", "application/xml");
// nsConsoleService notifies its listeners via async proxies, so we need
// to wait to see whether there was an error reported.
setTimeout(step2, 0);
} finally {
serv.unregisterListener(listener);
}
var p = new DOMParser();
p.parseFromString("<root/>", "application/xml");
// nsConsoleService notifies its listeners via async proxies, so we need
// to wait to see whether there was an error reported.
setTimeout(step2, 0);
]]></script>
</window>