43 let
pb =
Cc[
"@mozilla.org/privatebrowsing;1"].
45 let
bhist =
Cc[
"@mozilla.org/browser/global-history;2"].
47 let
histsvc =
Cc[
"@mozilla.org/browser/nav-history-service;1"].
50 let
cm =
Cc[
"@mozilla.org/cookiemanager;1"].
54 const TEST_URL =
"http://localhost:8888/browser/browser/components/privatebrowsing/test/browser/title.sjs";
58 bhist.removeAllPages();
70 onVisit:
function(aURI, aVisitID, aTime, aSessionId, aReferringId,
71 aTransitionType, _added) {
76 switch (this.pass++) {
78 is(aPageTitle,
"No Cookie",
"The page should be loaded without any cookie for the first time");
79 gBrowser.selectedTab = gBrowser.addTab(
TEST_URL);
82 is(aPageTitle,
"Cookie",
"The page should be loaded with a cookie for the second time");
84 gBrowser.selectedTab = gBrowser.addTab(
TEST_URL);
87 is(aPageTitle,
"No Cookie",
"The page should be loaded without any cookie again");
89 pb.privateBrowsingEnabled =
true;
90 gBrowser.selectedTab = gBrowser.addTab(
TEST_URL);
91 executeSoon(
function() {
92 histsvc.removeObserver(observer);
93 pb.privateBrowsingEnabled =
false;
94 while (gBrowser.browsers.length > 1)
95 gBrowser.removeCurrentTab();
101 ok(
false,
"Unexpected pass: " + (this.pass - 1));
115 if (iid.equals(
Ci.nsINavHistoryObserver) ||
116 iid.equals(
Ci.nsISupports)) {
119 throw Cr.NS_ERROR_NO_INTERFACE;
122 histsvc.addObserver(observer,
false);
124 gBrowser.selectedTab = gBrowser.addTab(
TEST_URL);
onPageChanged onEndUpdateBatch
onPageChanged onBeforeDeleteURI
sbOSDControlService prototype QueryInterface
getService(Ci.sbIFaceplateManager)
onPageChanged onPageExpired
onPageChanged onBeginUpdateBatch
onPageChanged onTitleChanged
onPageChanged onDeleteURI
onPageChanged onClearHistory