Bug 711937 - [SeaMonkey] xpcshell: "TEST-UNEXPECTED-FAIL | [...]/test_clearHistory_shutdown.js | places-expiration-finished == places-connection-closed". r=Neil f=sgautherie a=InvisibleSmiley
authorJens Hatlak <jh@junetz.de>
Wed, 04 Jan 2012 11:43:04 +0100
changeset 10217 fe9451243610c73294b2dbb3228e303a75914dea
parent 10216 94b36719e8dfc0bd890d6e2d478c478ef58cadda
child 10218 3a8256a08f2d7c88c7c19f421b60df3e47b5e07b
push idunknown
push userunknown
push dateunknown
reviewersNeil, InvisibleSmiley
bugs711937
Bug 711937 - [SeaMonkey] xpcshell: "TEST-UNEXPECTED-FAIL | [...]/test_clearHistory_shutdown.js | places-expiration-finished == places-connection-closed". r=Neil f=sgautherie a=InvisibleSmiley
suite/common/places/tests/unit/test_clearHistory_shutdown.js
--- a/suite/common/places/tests/unit/test_clearHistory_shutdown.js
+++ b/suite/common/places/tests/unit/test_clearHistory_shutdown.js
@@ -118,16 +118,18 @@ function run_test() {
   Services.prefs.setBoolPref("privacy.item.passwords", true);
   Services.prefs.setBoolPref("privacy.item.downloads", true);
   Services.prefs.setBoolPref("privacy.item.cookies", true);
   Services.prefs.setBoolPref("privacy.item.cache", true);
   Services.prefs.setBoolPref("privacy.item.sessions", true);
   Services.prefs.setBoolPref("privacy.item.offlineApps", true);
 
   Services.prefs.setBoolPref("privacy.sanitize.sanitizeOnShutdown", true);
+  // Unlike Firefox, SeaMonkey still supports the confirmation dialog
+  // which is called from Sanitizer's init method checkSettings().
   Services.prefs.setBoolPref("privacy.sanitize.promptOnSanitize", false);
 
   print("Add visits.");
   URIS.forEach(function(aUrl) {
     PlacesUtils.history.addVisit(uri(aUrl), timeInMicroseconds++, null,
                                  PlacesUtils.history.TRANSITION_TYPED,
                                  false, 0);
   });
@@ -135,16 +137,21 @@ function run_test() {
   storeCache(URL, "testData");
 
   print("Simulate and wait shutdown.");
   getDistinctNotifications().forEach(
     function (topic)
       Services.obs.addObserver(notificationsObserver, topic, false)
   );
 
+  // Simulate an exit so that Sanitizer's init method checkSettings() is called.
+  print("Simulate 'quit-application-granted' too for SeaMonkey.");
+  Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService).
+  notifyObservers(null, "quit-application-granted", null);
+
   shutdownPlaces();
 }
 
 function getDistinctNotifications() {
   let ar = EXPECTED_NOTIFICATIONS.concat(UNEXPECTED_NOTIFICATIONS);
   return [ar[i] for (i in ar) if (ar.slice(0, i).indexOf(ar[i]) == -1)];
 }