michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: function test() { michael@0: waitForExplicitFinish(); michael@0: michael@0: window.addEventListener("SSWindowStateBusy", function onBusy() { michael@0: window.removeEventListener("SSWindowStateBusy", onBusy, false); michael@0: michael@0: let state = JSON.parse(ss.getWindowState(window)); michael@0: ok(state.windows[0].busy, "window is busy"); michael@0: michael@0: window.addEventListener("SSWindowStateReady", function onReady() { michael@0: window.removeEventListener("SSWindowStateReady", onReady, false); michael@0: michael@0: let state = JSON.parse(ss.getWindowState(window)); michael@0: ok(!state.windows[0].busy, "window is not busy"); michael@0: michael@0: executeSoon(() => { michael@0: gBrowser.removeTab(gBrowser.tabs[1]); michael@0: finish(); michael@0: }); michael@0: }, false); michael@0: }, false); michael@0: michael@0: // create a new tab michael@0: let tab = gBrowser.addTab("about:mozilla"); michael@0: let browser = tab.linkedBrowser; michael@0: michael@0: // close and restore it michael@0: browser.addEventListener("load", function onLoad() { michael@0: browser.removeEventListener("load", onLoad, true); michael@0: gBrowser.removeTab(tab); michael@0: ss.undoCloseTab(window, 0); michael@0: }, true); michael@0: }