Bug 431130 xpcshell test test_nsIDownloadHistory.js fails on Thunderbird. r=sdwilsh
authorMark Banner <bugzilla@standard8.plus.com>
Thu, 17 Jul 2008 15:04:27 +0100
changeset 16010 b71578e7622ace13f38187e11849cb6c74eab20e
parent 16009 b87bb120312e2202ee5e429ef9d30accec046aa4
child 16011 bee72059de1597d0f4d8428a55a002effc710e53
child 16013 0d58f04be0ddb8e77e54031ab3f2676700c2690f
push idunknown
push userunknown
push dateunknown
reviewerssdwilsh
bugs431130
milestone1.9.1a1pre
Bug 431130 xpcshell test test_nsIDownloadHistory.js fails on Thunderbird. r=sdwilsh
docshell/test/unit/test_nsIDownloadHistory.js
--- a/docshell/test/unit/test_nsIDownloadHistory.js
+++ b/docshell/test/unit/test_nsIDownloadHistory.js
@@ -69,13 +69,23 @@ function testLinkVistedObserver()
   do_check_true(topicReceived);
   do_check_true(gh.isVisited(testURI));
 }
 
 var tests = [testLinkVistedObserver];
 
 function run_test()
 {
+  // Not everyone uses/defines an nsGlobalHistory* service. Especially if
+  // MOZ_PLACES is not defined. If getService fails, then abort gracefully.
+  try {
+    Cc["@mozilla.org/browser/global-history;2"].
+      getService(Ci.nsIGlobalHistory2);
+  }
+  catch (ex) {
+    return;
+  }
+
   for (var i = 0; i < tests.length; i++)
     tests[i]();
 
   cleanup();
 }