42 let
pb =
Cc[
"@mozilla.org/privatebrowsing;1"].
45 const kTestURL =
"data:text/plain,test";
46 let
tab = gBrowser.addTab();
47 gBrowser.selectedTab =
tab;
48 let
browser = gBrowser.getBrowserForTab(tab);
49 browser.addEventListener(
"load",
function() {
50 browser.removeEventListener(
"load",
arguments.callee,
true);
54 isnot(document.commandDispatcher.focusedElement, gURLBar.inputField,
55 "URL Bar should not be focused before entering the private browsing mode");
57 isnot(gURLBar.value,
"",
"URL Bar should no longer be empty after leaving the private browsing mode");
60 pb.privateBrowsingEnabled =
true;
61 tab = gBrowser.selectedTab;
62 browser = gBrowser.getBrowserForTab(tab);
63 browser.addEventListener(
"load",
function() {
67 is(document.commandDispatcher.focusedElement, gURLBar.inputField,
68 "URL Bar should be focused inside the private browsing mode");
70 is(gURLBar.value,
"",
"URL Bar should be empty inside the private browsing mode");
73 pb.privateBrowsingEnabled =
false;
74 tab = gBrowser.selectedTab;
75 browser = gBrowser.getBrowserForTab(tab);
76 browser.addEventListener(
"load",
function() {
78 isnot(document.commandDispatcher.focusedElement, gURLBar.inputField,
79 "URL Bar should no longer be focused after leaving the private browsing mode");
81 isnot(gURLBar.value,
"",
"URL Bar should no longer be empty after leaving the private browsing mode");
83 gBrowser.removeTab(tab);
89 browser.contentWindow.location = kTestURL;
getService(Ci.sbIFaceplateManager)
aWindow setTimeout(function(){_this.restoreHistory(aWindow, aTabs, aTabData, aIdMap);}, 0)
return!aWindow arguments!aWindow arguments[0]