2008-04-29 12:07:14 -07:00
|
|
|
function test()
|
|
|
|
{
|
|
|
|
waitForExplicitFinish();
|
2011-12-02 04:25:03 -08:00
|
|
|
ignoreAllUncaughtExceptions();
|
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
|
|
|
|
2010-05-05 06:28:04 -07:00
|
|
|
if (navigator.platform.indexOf("Mac") == -1) {
|
|
|
|
var menu = document.getElementById("bookmarksMenuPopup");
|
|
|
|
ok("result" in menu, "menu has binding");
|
|
|
|
}
|
2008-04-29 12:07:14 -07:00
|
|
|
|
|
|
|
var framedoc = document.getElementById("customizeToolbarSheetIFrame").contentDocument;
|
|
|
|
|
2010-05-14 03:20:00 -07:00
|
|
|
var panelX = panel.boxObject.screenX;
|
|
|
|
var iconModeList = framedoc.getElementById("modelist");
|
|
|
|
iconModeList.addEventListener("popupshown", function (e) {
|
|
|
|
iconModeList.removeEventListener("popupshown", arguments.callee, false);
|
|
|
|
SimpleTest.executeSoon(function () {
|
|
|
|
is(panel.boxObject.screenX, panelX, "toolbar customization panel shouldn't move when the iconmode menulist is opened");
|
|
|
|
iconModeList.open = false;
|
|
|
|
|
|
|
|
var b = framedoc.getElementById("donebutton");
|
|
|
|
b.focus();
|
|
|
|
b.doCommand();
|
|
|
|
});
|
|
|
|
}, false);
|
|
|
|
iconModeList.open = true;
|
2008-04-29 12:07:14 -07:00
|
|
|
}
|
|
|
|
|
2010-05-14 03:20:00 -07:00
|
|
|
function testCustomizePopupHidden(e)
|
2008-04-29 12:07:14 -07:00
|
|
|
{
|
|
|
|
var panel = document.getElementById("customizeToolbarSheetPopup");
|
2010-05-14 03:20:00 -07:00
|
|
|
if (e.target != panel)
|
|
|
|
return;
|
|
|
|
|
2008-04-29 12:07:14 -07:00
|
|
|
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();
|
|
|
|
}
|