зеркало из https://github.com/mozilla/gecko-dev.git
Bug 695322: fix browser_privatebrowsing_searchbar.js to clean up after itself and succeed when run individually, r=ehsan
This commit is contained in:
Родитель
63227cf68b
Коммит
16b4f42b4e
|
@ -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);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче