function test() { waitForExplicitFinish(); // XXX This looks a bit odd, but is needed to avoid throwing when removing the // event listeners below. See bug 310955. document.getElementById("sidebar").addEventListener("load", delayedOpenUrl, true); toggleSidebar("viewWebPanelsSidebar", true); } function delayedOpenUrl() { ok(true, "Ran delayedOpenUrl"); setTimeout(openPanelUrl, 100); } function openPanelUrl(event) { ok(!document.getElementById("sidebar-box").hidden, "Sidebar showing"); var sidebar = document.getElementById("sidebar"); var root = sidebar.contentDocument.documentElement; ok(root.nodeName != "parsererror", "Sidebar is well formed"); sidebar.removeEventListener("load", delayedOpenUrl, true); // XXX See comment above sidebar.contentDocument.addEventListener("load", delayedRunTest, true); var url = 'data:text/html,