mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 695322: fix browser_privatebrowsing_searchbar.js to clean up after itself and succeed when run individually, r=ehsan
This commit is contained in:
parent
6b1a73e5bb
commit
152c5be816
@ -41,15 +41,23 @@
|
||||
function test() {
|
||||
// initialization
|
||||
waitForExplicitFinish();
|
||||
gPrefService.setBoolPref("browser.privatebrowsing.keep_current_session", true);
|
||||
let pb = Cc["@mozilla.org/privatebrowsing;1"].
|
||||
getService(Ci.nsIPrivateBrowsingService);
|
||||
|
||||
// fill in the search bar with something
|
||||
// fill in the search bar with something, twice to populate undo history
|
||||
const kTestSearchString = "privatebrowsing";
|
||||
let searchBar = BrowserSearch.searchBar;
|
||||
searchBar.value = kTestSearchString + "foo";
|
||||
searchBar.value = kTestSearchString;
|
||||
|
||||
gPrefService.setBoolPref("browser.privatebrowsing.keep_current_session", true);
|
||||
|
||||
registerCleanupFunction(function () {
|
||||
searchBar.textbox.reset();
|
||||
|
||||
gPrefService.clearUserPref("browser.privatebrowsing.keep_current_session");
|
||||
});
|
||||
|
||||
// enter private browsing mode
|
||||
pb.privateBrowsingEnabled = true;
|
||||
|
||||
@ -85,8 +93,6 @@ function test() {
|
||||
gBrowser.removeTab(gBrowser.selectedTab);
|
||||
pb.privateBrowsingEnabled = false;
|
||||
|
||||
// cleanup
|
||||
gPrefService.clearUserPref("browser.privatebrowsing.keep_current_session");
|
||||
finish();
|
||||
}, true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user