Bug 831428 test fixup in test_bug429785 - don't remove the listener until it has received the console messages, r=bz
authorBenjamin Smedberg <benjamin@smedbergs.us>
Tue, 29 Jan 2013 11:02:56 -0500
changeset 130109 5c5b63581fc2d1006e6e5813dcaf8c027c5bfd55
parent 130108 783ea16377776e5e538c8ad2492311a7a34d5bcb
child 130110 f8b0ebdfe845f2195159c281e88c82d69c13ca38
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs831428, 429785
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 831428 test fixup in test_bug429785 - don't remove the listener until it has received the console messages, r=bz
content/base/test/chrome/test_bug429785.xul
--- a/content/base/test/chrome/test_bug429785.xul
+++ b/content/base/test/chrome/test_bug429785.xul
@@ -30,38 +30,32 @@ https://bugzilla.mozilla.org/show_bug.cg
 	return this;
       },
       observe : function (msg) { errorLogged = true; }
     };
 
     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);
 
     }
 
     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");
+
+    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);
-    }
+    // 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>