B2G/gecko/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_urlbarundo.js
// leaving the private browsing mode.
leaving the private browsing mode.
leaving the private browsing mode .
function test() {
  Services.prefs.setBoolPref("browser.privatebrowsing.keep_current_session", true);
  let pb = Cc["@mozilla.org/privatebrowsing;1"].
           getService(Ci.nsIPrivateBrowsingService);
  pb.privateBrowsingEnabled = true;
  gURLBar.value = "some test value";
  ok(gURLBar.editor.transactionManager.numberOfUndoItems > 0,
     "The undo history for the URL bar should not be empty");
  pb.privateBrowsingEnabled = false;
  is(gURLBar.editor.transactionManager.numberOfUndoItems, 0,
     "The undo history of the URL bar should be cleared after leaving the private browsing mode");
  Services.prefs.clearUserPref("browser.privatebrowsing.keep_current_session");
}
function test ( ) { Services . prefs . setBoolPref ( "browser.privatebrowsing.keep_current_session" , true ) ; let pb = Cc [ "@mozilla.org/privatebrowsing;1" ] . getService ( Ci . nsIPrivateBrowsingService ) ; pb . privateBrowsingEnabled = true ; gURLBar . value = "some test value" ; ok ( gURLBar . editor . transactionManager . numberOfUndoItems > 0 , "The undo history for the URL bar should not be empty" ) ; pb . privateBrowsingEnabled = false ; is ( gURLBar . editor . transactionManager . numberOfUndoItems , 0 , "The undo history of the URL bar should be cleared after leaving the private browsing mode" ) ; Services . prefs . clearUserPref ( "browser.privatebrowsing.keep_current_session" ) ; }
leaving the private browsing mode.
leaving the private browsing mode .
// initialization // enter private browsing mode // fill in the URL bar with something // leave private browsing mode // cleanup