43 let
pb =
Cc[
"@mozilla.org/privatebrowsing;1"].
45 let obs =
Cc[
"@mozilla.org/observer-service;1"].
47 let
ww =
Cc[
"@mozilla.org/embedcomp/window-watcher;1"].
50 function runTest(aPBMode, aCallBack) {
51 const kTestURL1 =
"data:text/html,Test Page 1";
52 let
tab1 = gBrowser.addTab();
53 gBrowser.selectedTab =
tab1;
54 let browser1 = gBrowser.getBrowserForTab(tab1);
55 browser1.addEventListener(
"load",
function() {
56 browser1.removeEventListener(
"load",
arguments.callee,
true);
61 obs.removeObserver(
this,
"page-info-dialog-loaded");
63 const kTestURL2 =
"data:text/plain,Test Page 2";
64 let
tab2 = gBrowser.addTab();
65 gBrowser.selectedTab =
tab2;
66 let browser2 = gBrowser.getBrowserForTab(tab2);
67 browser2.addEventListener(
"load",
function () {
68 browser2.removeEventListener(
"load",
arguments.callee,
true);
73 obs.removeObserver(
this,
"page-info-dialog-loaded");
75 ww.registerNotification({
77 is(aTopic,
"domwindowclosed",
"We should only receive window closed notifications");
78 let
win = aSubject.QueryInterface(
Ci.nsIDOMWindow);
79 if (win == pageInfo1) {
80 ok(
true,
"Page info 1 being closed as expected");
83 else if (win == pageInfo2) {
84 ok(
true,
"Page info 2 being closed as expected");
88 ok(
false,
"The closed window should be one of the two page info windows");
90 if (!pageInfo1 && !pageInfo2) {
91 ww.unregisterNotification(
this);
98 pb.privateBrowsingEnabled = aPBMode;
100 },
"page-info-dialog-loaded",
false);
102 browser2.loadURI(kTestURL2);
104 },
"page-info-dialog-loaded",
false);
106 browser1.loadURI(kTestURL1);
111 gBrowser.removeCurrentTab();
112 gBrowser.removeCurrentTab();
function BrowserPageInfo(doc, initialTab, imageElement)
getService(Ci.sbIFaceplateManager)
return!aWindow arguments!aWindow arguments[0]
_updateTextAndScrollDataForFrame aData
sbDeviceFirmwareAutoCheckForUpdate prototype observe