Bug 741175 - Document skipping Places tests because the Private Browsing service is unavailable. r=mak
authorPaolo Amadini <paolo.mozmail@amadzone.org>
Thu, 12 Apr 2012 12:27:45 +0200
changeset 94845 6a4d396a3c438d0279544a1e21a7cb7e1535678c
parent 94844 27616988a4a1489faac211601cd6494b699b0a1b
child 94846 05aa7f1962a3bb16c07baa1efa8aa0a0ba40d7f9
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs741175
milestone14.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 741175 - Document skipping Places tests because the Private Browsing service is unavailable. r=mak
toolkit/components/places/tests/favicons/test_setAndFetchFaviconForPage.js
toolkit/components/places/tests/favicons/test_setAndFetchFaviconForPage_failures.js
toolkit/components/places/tests/unit/test_download_history.js
--- a/toolkit/components/places/tests/favicons/test_setAndFetchFaviconForPage.js
+++ b/toolkit/components/places/tests/favicons/test_setAndFetchFaviconForPage.js
@@ -49,16 +49,17 @@ add_test(function test_aboutURI_bookmark
                           PlacesUtils.unfiledBookmarksFolderId, pageURI,
                           PlacesUtils.bookmarks.DEFAULT_INDEX, pageURI.spec);
   PlacesUtils.favicons.setAndFetchFaviconForPage(pageURI, FAVICON_URI, true);
 });
 
 add_test(function test_privateBrowsing_bookmarked()
 {
   if (!("@mozilla.org/privatebrowsing;1" in Cc)) {
+    do_log_info("Private Browsing service is not available, bail out.");
     run_next_test();
     return;
   }
 
   let pageURI = NetUtil.newURI("http://example.com/privateBrowsing_bookmarked");
   waitForFaviconChanged(pageURI, FAVICON_URI,
                         function test_privateBrowsing_bookmarked_callback() {
     checkFaviconDataForPage(pageURI, FAVICON_MIMETYPE, FAVICON_DATA,
--- a/toolkit/components/places/tests/favicons/test_setAndFetchFaviconForPage_failures.js
+++ b/toolkit/components/places/tests/favicons/test_setAndFetchFaviconForPage_failures.js
@@ -82,16 +82,17 @@ add_test(function test_aboutURI()
                        FAVICON_URI, true);
 
   run_next_test();
 });
 
 add_test(function test_privateBrowsing_nonBookmarkedURI()
 {
   if (!("@mozilla.org/privatebrowsing;1" in Cc)) {
+    do_log_info("Private Browsing service is not available, bail out.");
     run_next_test();
     return;
   }
 
   let pageURI = NetUtil.newURI("http://example.com/privateBrowsing");
   addVisits({ uri: pageURI, transitionType: TRANSITION_TYPED }, function () {
     let pb = Cc["@mozilla.org/privatebrowsing;1"]
              .getService(Ci.nsIPrivateBrowsingService);
--- a/toolkit/components/places/tests/unit/test_download_history.js
+++ b/toolkit/components/places/tests/unit/test_download_history.js
@@ -119,46 +119,50 @@ add_test(function test_dh_addDownload_re
     uri: REFERRER_URI,
     visits: [{
       transitionType: Ci.nsINavHistoryService.TRANSITION_TYPED,
       visitDate: Date.now() * 1000
     }]
   });
 });
 
-if ("@mozilla.org/privatebrowsing;1" in Cc) {
-  add_test(function test_dh_addDownload_privateBrowsing()
-  {
-    waitForOnVisit(function DHAD_onVisit(aURI) {
-      // We should only receive the notification for the non-private URI.  This
-      // test is based on the assumption that visit notifications are received
-      // in the same order of the addDownload calls, which is currently true
-      // because database access is serialized on the same worker thread.
-      do_check_true(aURI.equals(DOWNLOAD_URI));
+add_test(function test_dh_addDownload_privateBrowsing()
+{
+  if (!("@mozilla.org/privatebrowsing;1" in Cc)) {
+    do_log_info("Private Browsing service is not available, bail out.");
+    run_next_test();
+    return;
+  }
 
-      uri_in_db(DOWNLOAD_URI, true);
-      uri_in_db(PRIVATE_URI, false);
+  waitForOnVisit(function DHAD_onVisit(aURI) {
+    // We should only receive the notification for the non-private URI.  This
+    // test is based on the assumption that visit notifications are received
+    // in the same order of the addDownload calls, which is currently true
+    // because database access is serialized on the same worker thread.
+    do_check_true(aURI.equals(DOWNLOAD_URI));
 
-      waitForClearHistory(run_next_test);
-    });
+    uri_in_db(DOWNLOAD_URI, true);
+    uri_in_db(PRIVATE_URI, false);
+
+    waitForClearHistory(run_next_test);
+  });
 
-    let pb = Cc["@mozilla.org/privatebrowsing;1"]
-             .getService(Ci.nsIPrivateBrowsingService);
-    Services.prefs.setBoolPref("browser.privatebrowsing.keep_current_session",
-                               true);
-    pb.privateBrowsingEnabled = true;
-    gDownloadHistory.addDownload(PRIVATE_URI, REFERRER_URI, Date.now() * 1000);
+  let pb = Cc["@mozilla.org/privatebrowsing;1"]
+           .getService(Ci.nsIPrivateBrowsingService);
+  Services.prefs.setBoolPref("browser.privatebrowsing.keep_current_session",
+                             true);
+  pb.privateBrowsingEnabled = true;
+  gDownloadHistory.addDownload(PRIVATE_URI, REFERRER_URI, Date.now() * 1000);
 
-    // The addDownload functions calls CanAddURI synchronously, thus we can
-    // exit Private Browsing Mode immediately.
-    pb.privateBrowsingEnabled = false;
-    Services.prefs.clearUserPref("browser.privatebrowsing.keep_current_session");
-    gDownloadHistory.addDownload(DOWNLOAD_URI, REFERRER_URI, Date.now() * 1000);
-  });
-}
+  // The addDownload functions calls CanAddURI synchronously, thus we can
+  // exit Private Browsing Mode immediately.
+  pb.privateBrowsingEnabled = false;
+  Services.prefs.clearUserPref("browser.privatebrowsing.keep_current_session");
+  gDownloadHistory.addDownload(DOWNLOAD_URI, REFERRER_URI, Date.now() * 1000);
+});
 
 add_test(function test_dh_addDownload_disabledHistory()
 {
   waitForOnVisit(function DHAD_onVisit(aURI) {
     // We should only receive the notification for the non-private URI.  This
     // test is based on the assumption that visit notifications are received in
     // the same order of the addDownload calls, which is currently true because
     // database access is serialized on the same worker thread.