43 let
pb =
Cc[
"@mozilla.org/privatebrowsing;1"].
46 const testPageURL =
"http://localhost:8888/browser/" +
47 "browser/components/privatebrowsing/test/browser/browser_privatebrowsing_geoprompt_page.html";
50 let pageTab = gBrowser.addTab();
51 gBrowser.selectedTab = pageTab;
52 let pageBrowser = gBrowser.getBrowserForTab(pageTab);
53 pageBrowser.addEventListener(
"load",
function () {
54 pageBrowser.removeEventListener(
"load",
arguments.callee,
true);
58 let notificationBox = gBrowser.getNotificationBox(pageBrowser);
59 let notification = notificationBox.getNotificationWithValue(
"geolocation");
60 ok(notification,
"Notification box should be displaying outside of private browsing mode");
61 is(notification.getElementsByClassName(
"rememberChoice").length, 1,
62 "The remember control must be displayed outside of private browsing mode");
63 notificationBox.currentNotification.close();
65 gBrowser.removeTab(pageTab);
68 pb.privateBrowsingEnabled =
true;
70 pageTab = gBrowser.addTab();
71 gBrowser.selectedTab = pageTab;
72 pageBrowser = gBrowser.getBrowserForTab(pageTab);
73 pageBrowser.addEventListener(
"load",
function () {
74 pageBrowser.removeEventListener(
"load",
arguments.callee,
true);
78 let notificationBox = gBrowser.getNotificationBox(pageBrowser);
79 let notification = notificationBox.getNotificationWithValue(
"geolocation");
80 ok(notification,
"Notification box should be displaying outside of private browsing mode");
81 is(notification.getElementsByClassName(
"rememberChoice").length, 0,
82 "The remember control must not be displayed inside of private browsing mode");
83 notificationBox.currentNotification.close();
85 gBrowser.removeTab(pageTab);
88 pb.privateBrowsingEnabled =
false;
92 pageBrowser.contentWindow.location = testPageURL;
95 pageBrowser.contentWindow.location = testPageURL;
getService(Ci.sbIFaceplateManager)
aWindow setTimeout(function(){_this.restoreHistory(aWindow, aTabs, aTabData, aIdMap);}, 0)
return!aWindow arguments!aWindow arguments[0]