2008-04-29 12:07:14 -07:00
|
|
|
function test()
|
|
|
|
{
|
|
|
|
waitForExplicitFinish();
|
2008-12-01 20:45:49 -08:00
|
|
|
var frame = document.getElementById("customizeToolbarSheetIFrame");
|
|
|
|
frame.addEventListener("load", testCustomizeFrameLoadedPre, true);
|
|
|
|
|
2008-04-29 12:07:14 -07:00
|
|
|
document.getElementById("cmd_CustomizeToolbars").doCommand();
|
|
|
|
}
|
|
|
|
|
2008-12-01 20:45:49 -08:00
|
|
|
function testCustomizeFrameLoadedPre(){
|
|
|
|
// This load listener can be called before
|
|
|
|
// customizeToolbarSheet.xul's, which would cause the test
|
|
|
|
// to fail. Use executeSoon to delay running the test until
|
|
|
|
// event dispatch is over (all load event listeners have run).
|
|
|
|
executeSoon(testCustomizeFrameLoaded);
|
2008-04-29 12:07:14 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
function testCustomizeFrameLoaded()
|
|
|
|
{
|
2008-12-01 20:45:49 -08:00
|
|
|
var panel = document.getElementById("customizeToolbarSheetPopup");
|
|
|
|
panel.addEventListener("popuphidden", testCustomizePopupHidden, false);
|
|
|
|
|
2008-04-29 12:07:14 -07:00
|
|
|
var frame = document.getElementById("customizeToolbarSheetIFrame");
|
2008-12-01 20:45:49 -08:00
|
|
|
frame.removeEventListener("load", testCustomizeFrameLoadedPre, true);
|
2008-04-29 12:07:14 -07:00
|
|
|
|
|
|
|
var menu = document.getElementById("bookmarksMenuPopup");
|
|
|
|
ok("getResult" in menu, "menu has binding");
|
|
|
|
|
|
|
|
var framedoc = document.getElementById("customizeToolbarSheetIFrame").contentDocument;
|
|
|
|
var b = framedoc.getElementById("donebutton");
|
|
|
|
|
2009-08-27 08:51:41 -07:00
|
|
|
b.focus();
|
2008-04-29 12:07:14 -07:00
|
|
|
framedoc.getElementById("donebutton").doCommand();
|
|
|
|
}
|
|
|
|
|
|
|
|
function testCustomizePopupHidden()
|
|
|
|
{
|
|
|
|
var panel = document.getElementById("customizeToolbarSheetPopup");
|
|
|
|
panel.removeEventListener("popuphidden", testCustomizePopupHidden, false);
|
2009-08-27 08:51:41 -07:00
|
|
|
is(document.activeElement, document.documentElement, "focus after customize done");
|
|
|
|
|
2008-04-29 12:07:14 -07:00
|
|
|
finish();
|
|
|
|
}
|