followup to Bug 431558 - implement preventive maintenance for places.sqlite, remove observer on test finish, r=sdwilsh
authorMarco Bonardo <mak77@bonardo.net>
Wed, 10 Dec 2008 11:44:01 +0100
changeset 22562 9952fee851dae674ede7e4a25ee667ebea43a3ff
parent 22561 89a175c70c25df9a47519fa6967e9f4214acaa6d
child 22563 ee854712776851b3697fb6b6a2b2929d7c1a7d2b
push idunknown
push userunknown
push dateunknown
reviewerssdwilsh
bugs431558
milestone1.9.2a1pre
followup to Bug 431558 - implement preventive maintenance for places.sqlite, remove observer on test finish, r=sdwilsh
toolkit/components/places/tests/unit/test_preventive_maintenance.js
--- a/toolkit/components/places/tests/unit/test_preventive_maintenance.js
+++ b/toolkit/components/places/tests/unit/test_preventive_maintenance.js
@@ -1096,18 +1096,20 @@ let observer = {
       catch (ex){ do_throw(ex);}
       cleanDatabase();
       if (tests.length) {
         current_test = tests.shift();
         dump("\nExecuting test: " + current_test.name + "\n" + "*** " + current_test.desc + "\n");
         current_test.setup();
         PlacesDBUtils.maintenanceOnIdle();
       }
-      else
+      else {
+        os.removeObserver(this, FINISHED_MAINTANANCE_NOTIFICATION_TOPIC);
         do_test_finished();
+      }
     }
   }
 }
 os.addObserver(observer, FINISHED_MAINTANANCE_NOTIFICATION_TOPIC, false);
 
 
 // main
 function run_test() {