Bug 470707 - [SeaMonkey] test_download_history.js fails now, r=dietrich

This commit is contained in:
Marco Bonardo 2008-12-30 22:42:23 +01:00
parent 6ea54f586c
commit 663e1d48ad

View File

@ -50,9 +50,6 @@ var dh = Cc["@mozilla.org/browser/download-history;1"].
getService(Ci.nsIDownloadHistory); getService(Ci.nsIDownloadHistory);
// Test that this nsIDownloadHistory is the one places implements. // Test that this nsIDownloadHistory is the one places implements.
do_check_true(dh instanceof Ci.nsINavHistoryService); do_check_true(dh instanceof Ci.nsINavHistoryService);
var pb = Cc["@mozilla.org/privatebrowsing;1"].
getService(Ci.nsIPrivateBrowsingService);
const NS_LINK_VISITED_EVENT_TOPIC = "link-visited"; const NS_LINK_VISITED_EVENT_TOPIC = "link-visited";
const DISABLE_HISTORY_PREF = "browser.history_expire_days"; const DISABLE_HISTORY_PREF = "browser.history_expire_days";
@ -94,6 +91,15 @@ function test_dh() {
} }
function test_dh_privateBrowsing() { function test_dh_privateBrowsing() {
var pb = null;
try {
// PrivateBrowsing component is not always available to Places implementers.
pb = Cc["@mozilla.org/privatebrowsing;1"].
getService(Ci.nsIPrivateBrowsingService);
} catch (ex) {
// Skip this test.
return;
}
prefs.setBoolPref(PB_KEEP_SESSION_PREF, true); prefs.setBoolPref(PB_KEEP_SESSION_PREF, true);
pb.privateBrowsingEnabled = true; pb.privateBrowsingEnabled = true;