|
1 /* Any copyright is dedicated to the Public Domain. |
|
2 http://creativecommons.org/publicdomain/zero/1.0/ */ |
|
3 |
|
4 function test() { |
|
5 waitForExplicitFinish(); |
|
6 |
|
7 window.addEventListener("SSWindowStateBusy", function onBusy() { |
|
8 window.removeEventListener("SSWindowStateBusy", onBusy, false); |
|
9 |
|
10 let state = JSON.parse(ss.getWindowState(window)); |
|
11 ok(state.windows[0].busy, "window is busy"); |
|
12 |
|
13 window.addEventListener("SSWindowStateReady", function onReady() { |
|
14 window.removeEventListener("SSWindowStateReady", onReady, false); |
|
15 |
|
16 let state = JSON.parse(ss.getWindowState(window)); |
|
17 ok(!state.windows[0].busy, "window is not busy"); |
|
18 |
|
19 executeSoon(() => { |
|
20 gBrowser.removeTab(gBrowser.tabs[1]); |
|
21 finish(); |
|
22 }); |
|
23 }, false); |
|
24 }, false); |
|
25 |
|
26 // create a new tab |
|
27 let tab = gBrowser.addTab("about:mozilla"); |
|
28 let browser = tab.linkedBrowser; |
|
29 |
|
30 // close and restore it |
|
31 browser.addEventListener("load", function onLoad() { |
|
32 browser.removeEventListener("load", onLoad, true); |
|
33 gBrowser.removeTab(tab); |
|
34 ss.undoCloseTab(window, 0); |
|
35 }, true); |
|
36 } |