43 let prefBranch =
Cc[
"@mozilla.org/preferences-service;1"].
45 prefBranch.setBoolPref(
"browser.privatebrowsing.keep_current_session",
true);
46 let
pb =
Cc[
"@mozilla.org/privatebrowsing;1"].
50 const kTestSearchString =
"privatebrowsing";
51 let searchBar = BrowserSearch.searchBar;
52 searchBar.value = kTestSearchString;
55 pb.privateBrowsingEnabled =
true;
57 is(searchBar.value, kTestSearchString,
58 "entering the private browsing mode should not clear the search bar");
59 ok(searchBar.textbox.editor.transactionManager.numberOfUndoItems > 0,
60 "entering the private browsing mode should not reset the undo list of the searchbar control");
63 searchBar.value =
"something else";
66 pb.privateBrowsingEnabled =
false;
68 is(searchBar.value, kTestSearchString,
69 "leaving the private browsing mode should restore the search bar contents");
70 is(searchBar.textbox.editor.transactionManager.numberOfUndoItems, 1,
71 "leaving the private browsing mode should only leave 1 item in the undo list of the searchbar control");
74 prefBranch.clearUserPref(
"browser.privatebrowsing.keep_current_session");
getService(Ci.sbIFaceplateManager)