Simplify browser_privatebrowsing_lastpbcontextexited.js and make it not leak, no bug

DONTBUILD since this is NPOTB for global PB builds

--HG--
extra : rebase_source : 6b2c4a18d04c09f707d6724f16b00c8f2e8ce1ff
This commit is contained in:
Ehsan Akhgari 2012-12-07 08:27:39 -05:00
parent 57109bc72d
commit a33baa347e

View File

@ -5,7 +5,7 @@
function test() {
// We need to open a new window for this so that its docshell would get destroyed
// when clearing the PB mode flag.
let newWin = window.openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no");
let newWin = OpenBrowserWindow({private: true});
waitForExplicitFinish();
SimpleTest.waitForFocus(function() {
let expected = false;
@ -14,12 +14,10 @@ function test() {
is(aTopic, "last-pb-context-exited", "Correct topic should be dispatched");
is(expected, true, "notification not expected yet");
Services.obs.removeObserver(observer, "last-pb-context-exited", false);
gPrefService.clearUserPref("browser.privatebrowsing.keep_current_session");
finish();
}
};
Services.obs.addObserver(observer, "last-pb-context-exited", false);
setPrivateWindow(newWin, true);
expected = true;
newWin.close(); // this will cause the docshells to leave PB mode
newWin = null;