gecko/browser/base/content/test/browser_customize.js
2008-04-29 12:07:14 -07: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();
}