Bug 1264782 - Ensure xpcshell tests wait for calendar startup to complete. r=Fallen
authoraleth <aleth@instantbird.org>
Wed, 20 Apr 2016 21:42:52 +0200
changeset 24836 aaf73ae87441d3361d7656c6bbec41f949b304f7
parent 24835 1bb6fd6acf8487d0bb99458069ce46fc4b491e1f
child 24837 a5f12c8dc64f4061f86d1292208bd3a53c6d1c34
push id1657
push userclokep@gmail.com
push dateMon, 06 Jun 2016 19:50:21 +0000
treeherdercomm-beta@9fac989284b5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersFallen
bugs1264782
Bug 1264782 - Ensure xpcshell tests wait for calendar startup to complete. r=Fallen
calendar/test/unit/head_consts.js
--- a/calendar/test/unit/head_consts.js
+++ b/calendar/test/unit/head_consts.js
@@ -221,26 +221,28 @@ function do_load_calmgr(callback) {
         callback();
     }});
 }
 
 function do_calendar_startup(callback) {
     let obs = {
       observe: function() {
         Services.obs.removeObserver(this, "calendar-startup-done");
+        do_test_finished();
         do_execute_soon(callback);
       }
     };
 
     let ss = Components.classes['@mozilla.org/calendar/startup-service;1']
                        .getService(Components.interfaces.nsISupports).wrappedJSObject;
 
     if (ss.started) {
         callback();
     } else {
+        do_test_pending();
         Services.obs.addObserver(obs, "calendar-startup-done", false);
         if (_profileInitialized) {
             Services.obs.notifyObservers(null, "profile-after-change", "xpcshell-do-get-profile");
         } else {
             do_get_profile(true);
         }
     }
 }