Thu, 15 Jan 2015 15:59:08 +0100
Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
4 function test() {
5 waitForExplicitFinish();
7 window.addEventListener("SSWindowStateBusy", function onBusy() {
8 window.removeEventListener("SSWindowStateBusy", onBusy, false);
10 let state = JSON.parse(ss.getWindowState(window));
11 ok(state.windows[0].busy, "window is busy");
13 window.addEventListener("SSWindowStateReady", function onReady() {
14 window.removeEventListener("SSWindowStateReady", onReady, false);
16 let state = JSON.parse(ss.getWindowState(window));
17 ok(!state.windows[0].busy, "window is not busy");
19 executeSoon(() => {
20 gBrowser.removeTab(gBrowser.tabs[1]);
21 finish();
22 });
23 }, false);
24 }, false);
26 // create a new tab
27 let tab = gBrowser.addTab("about:mozilla");
28 let browser = tab.linkedBrowser;
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 }