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 findBox = gFindBar.getElement(
"findbar-textbox");
52 gFindBar.startFind(gFindBar.FIND_NORMAL);
55 is(findBox.editor.transactionManager.numberOfUndoItems, 0,
56 "No items in the undo list of the findbar control");
58 "findbar text is empty");
60 findBox.value = kTestSearchString;
63 pb.privateBrowsingEnabled =
true;
65 is(findBox.value, kTestSearchString,
66 "entering the private browsing mode should not clear the findbar");
67 ok(findBox.editor.transactionManager.numberOfUndoItems > 0,
68 "entering the private browsing mode should not reset the undo list of the findbar control");
71 findBox.value =
"something else";
74 pb.privateBrowsingEnabled =
false;
76 is(findBox.value, kTestSearchString,
77 "leaving the private browsing mode should restore the findbar contents");
78 is(findBox.editor.transactionManager.numberOfUndoItems, 1,
79 "leaving the private browsing mode should only leave 1 item in the undo list of the findbar control");
82 prefBranch.clearUserPref(
"browser.privatebrowsing.keep_current_session");
getService(Ci.sbIFaceplateManager)