зеркало из https://github.com/mozilla/pjs.git
Bug 650280 - Switching from Private Browsing to Normal Browsing keeps search strings while in Panorama; r=ehsan
This commit is contained in:
Родитель
4beb35e1e4
Коммит
3033a134d7
|
@ -520,6 +520,9 @@ function createSearchTabMacher() {
|
|||
}
|
||||
|
||||
function hideSearch(event) {
|
||||
if (!isSearchEnabled())
|
||||
return;
|
||||
|
||||
iQ("#searchbox").val("");
|
||||
iQ("#searchshade").hide();
|
||||
iQ("#search").hide();
|
||||
|
|
|
@ -714,6 +714,7 @@ let UI = {
|
|||
}
|
||||
} else if (topic == "private-browsing-change-granted") {
|
||||
if (data == "enter" || data == "exit") {
|
||||
hideSearch();
|
||||
self._privateBrowsing.transitionMode = data;
|
||||
self.storageBusy();
|
||||
}
|
||||
|
|
|
@ -139,6 +139,7 @@ _BROWSER_FILES = \
|
|||
browser_tabview_bug649006.js \
|
||||
browser_tabview_bug649307.js \
|
||||
browser_tabview_bug649319.js \
|
||||
browser_tabview_bug650280.js \
|
||||
browser_tabview_bug650573.js \
|
||||
browser_tabview_bug651311.js \
|
||||
browser_tabview_bug654721.js \
|
||||
|
|
|
@ -0,0 +1,67 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
let pb = Cc["@mozilla.org/privatebrowsing;1"].
|
||||
getService(Ci.nsIPrivateBrowsingService);
|
||||
|
||||
function test() {
|
||||
let cw;
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
if (cw)
|
||||
cw.hideSearch();
|
||||
|
||||
TabView.hide();
|
||||
pb.privateBrowsingEnabled = false;
|
||||
});
|
||||
|
||||
let enableSearch = function (callback) {
|
||||
if (cw.isSearchEnabled()) {
|
||||
callback();
|
||||
return;
|
||||
}
|
||||
|
||||
cw.addEventListener("tabviewsearchenabled", function onSearchEnabled() {
|
||||
cw.removeEventListener("tabviewsearchenabled", onSearchEnabled, false);
|
||||
executeSoon(callback);
|
||||
}, false);
|
||||
|
||||
cw.ensureSearchShown();
|
||||
};
|
||||
|
||||
let getSearchboxValue = function () {
|
||||
return cw.iQ("#searchbox").val();
|
||||
};
|
||||
|
||||
let prepareSearchbox = function (callback) {
|
||||
ok(!cw.isSearchEnabled(), "search is disabled");
|
||||
|
||||
enableSearch(function () {
|
||||
cw.iQ("#searchbox").val("moz");
|
||||
callback();
|
||||
});
|
||||
};
|
||||
|
||||
let searchAndSwitchPBMode = function (callback) {
|
||||
prepareSearchbox(function () {
|
||||
togglePrivateBrowsing(function () {
|
||||
showTabView(function () {
|
||||
ok(!cw.isSearchEnabled(), "search is disabled");
|
||||
is(getSearchboxValue(), "", "search box is empty");
|
||||
callback();
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
waitForExplicitFinish();
|
||||
|
||||
showTabView(function () {
|
||||
cw = TabView.getContentWindow();
|
||||
searchAndSwitchPBMode(function () {
|
||||
searchAndSwitchPBMode(function () {
|
||||
hideTabView(finish);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
Загрузка…
Ссылка в новой задаче