Mozilla/mozilla/browser/base/content/test/browser_customize.js
enndeakin%sympatico.ca 993bbe1057 Bug 402798, bookmarks missing from menu, r=mano,a=beltzner
git-svn-id: svn://10.0.0.236/trunk@250941 18797224-902f-48f8-a5cc-f745e15eee43
2008-04-29 19:07:15 +00:00

39 lines
1.3 KiB
JavaScript

function test()
{
waitForExplicitFinish();
var panel = document.getElementById("customizeToolbarSheetPopup");
panel.addEventListener("popupshown", testCustomizePopupShown, false);
document.getElementById("cmd_CustomizeToolbars").doCommand();
}
function testCustomizePopupShown()
{
var panel = document.getElementById("customizeToolbarSheetPopup");
panel.removeEventListener("popupshown", testCustomizePopupShown, false);
panel.addEventListener("popuphidden", testCustomizePopupHidden, false);
var frame = document.getElementById("customizeToolbarSheetIFrame").contentDocument;
frame.addEventListener("load", testCustomizeFrameLoaded, true);
}
function testCustomizeFrameLoaded()
{
var frame = document.getElementById("customizeToolbarSheetIFrame");
frame.removeEventListener("load", testCustomizeFrameLoaded, true);
var menu = document.getElementById("bookmarksMenuPopup");
ok("getResult" in menu, "menu has binding");
var framedoc = document.getElementById("customizeToolbarSheetIFrame").contentDocument;
var b = framedoc.getElementById("donebutton");
framedoc.getElementById("donebutton").doCommand();
}
function testCustomizePopupHidden()
{
var panel = document.getElementById("customizeToolbarSheetPopup");
panel.removeEventListener("popuphidden", testCustomizePopupHidden, false);
finish();
}