michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: // This test checks that closed private windows can't be restored michael@0: michael@0: function test() { michael@0: waitForExplicitFinish(); michael@0: michael@0: // Purging the list of closed windows michael@0: while(ss.getClosedWindowCount() > 0) michael@0: ss.forgetClosedWindow(0); michael@0: michael@0: // Load a private window, then close it michael@0: // and verify it doesn't get remembered for restoring michael@0: whenNewWindowLoaded({private: true}, function (win) { michael@0: info("The private window got loaded"); michael@0: win.addEventListener("SSWindowClosing", function onclosing() { michael@0: win.removeEventListener("SSWindowClosing", onclosing, false); michael@0: executeSoon(function () { michael@0: is (ss.getClosedWindowCount(), 0, michael@0: "The private window should not have been stored"); michael@0: finish(); michael@0: }); michael@0: }, false); michael@0: win.close(); michael@0: }); michael@0: }