5 var validPage =
'http://example.com/';
6 var
testPage =
'data:text/html,<frameset cols="400,400"><frame src="' + validPage +
'"><frame src="' +
invalidPage +
'"></frameset>';
22 var newTab = gBrowser.addTab();
23 gBrowser.selectedTab = newTab;
24 newBrowser = gBrowser.getBrowserForTab(newTab);
32 if(
newBrowser.contentWindow.frames.length < 2 ||
39 var badFrame =
newBrowser.contentWindow.frames[1];
40 document.popupNode = badFrame.document.firstChild;
42 var contentAreaContextMenu = document.getElementById(
"contentAreaContextMenu");
43 var contextMenu =
new nsContextMenu(contentAreaContextMenu, gBrowser);
46 contextMenu.showOnlyThisFrame();
60 is(
newBrowser.contentDocument.location.href,
invalidPage,
"Should navigate to page url, not about:neterror");
63 gBrowser.addEventListener(
"load",
test2Setup,
true);
68 if(
newBrowser.contentWindow.frames.length < 2 ||
73 gBrowser.removeEventListener(
"load",
test2Setup,
true);
76 newBrowser = gBrowser.getBrowserForTab(gBrowser.selectedTab);
77 var badFrame =
newBrowser.contentWindow.frames[1];
79 document.popupNode = badFrame.document.firstChild;
81 var contentAreaContextMenu = document.getElementById(
"contentAreaContextMenu");
82 var contextMenu =
new nsContextMenu(contentAreaContextMenu, gBrowser);
84 test2tab = contextMenu.openFrameInTab();
85 ok(
test2tab instanceof XULElement,
"openFrameInTab() should return an element (non-null)");
86 is(
test2tab.tagName,
"tab",
"openFrameInTab() should return a *tab* element");
95 if(gBrowser.contentDocument.location.href ==
"about:blank")
101 is(gBrowser.contentDocument.location.href,
invalidPage,
"New tab should have page url, not about:neterror");
104 gBrowser.removeCurrentTab();
112 newBrowser = gBrowser.getBrowserForTab(gBrowser.selectedTab);
113 var badFrame =
newBrowser.contentWindow.frames[1];
114 document.popupNode = badFrame.document.firstChild;
116 var contentAreaContextMenu = document.getElementById(
"contentAreaContextMenu");
117 var contextMenu =
new nsContextMenu(contentAreaContextMenu, gBrowser);
120 ok(
test3window instanceof
Window,
"openFrame() should return a window (non-null) ");
127 if(
test3window.content.document.location.href ==
"about:blank")
132 is(
test3window.content.document.location.href,
invalidPage,
"New window should have page url, not about:neterror");
139 gBrowser.removeCurrentTab();
function testShowOnlyThisFrame()
function testOpenFrameInTab()