mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1196032 - Don't show the urlbar search suggestions opt-in in private windows. r=mak
This commit is contained in:
parent
4f82f94e69
commit
68dae01260
@ -130,6 +130,18 @@ add_task(function* enable() {
|
||||
assertSuggestionsPresent(true);
|
||||
});
|
||||
|
||||
add_task(function* privateWindow() {
|
||||
// Since suggestions are disabled in private windows, the notification should
|
||||
// not appear even when suggestions are otherwise enabled.
|
||||
let win = yield BrowserTestUtils.openNewBrowserWindow({ private: true });
|
||||
win.gURLBar.blur();
|
||||
win.gURLBar.focus();
|
||||
yield promiseAutocompleteResultPopup("foo", win);
|
||||
assertVisible(false, win);
|
||||
win.gURLBar.blur();
|
||||
yield BrowserTestUtils.closeWindow(win);
|
||||
});
|
||||
|
||||
function assertSuggestionsPresent(expectedPresent) {
|
||||
let controller = gURLBar.popup.input.controller;
|
||||
let matchCount = controller.matchCount;
|
||||
@ -147,9 +159,9 @@ function assertSuggestionsPresent(expectedPresent) {
|
||||
Assert.equal(actualPresent, expectedPresent);
|
||||
}
|
||||
|
||||
function assertVisible(visible) {
|
||||
function assertVisible(visible, win=window) {
|
||||
let style =
|
||||
window.getComputedStyle(gURLBar.popup.searchSuggestionsNotification);
|
||||
win.getComputedStyle(win.gURLBar.popup.searchSuggestionsNotification);
|
||||
Assert.equal(style.visibility, visible ? "visible" : "collapse");
|
||||
}
|
||||
|
||||
|
@ -932,6 +932,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
<property name="shouldShowSearchSuggestionsNotification" readonly="true">
|
||||
<getter><![CDATA[
|
||||
return !this._userMadeSearchSuggestionsChoice &&
|
||||
!this.inPrivateContext &&
|
||||
// When _urlbarFocused is true, tabbrowser would close the
|
||||
// popup if it's opened here, so don't show the notification.
|
||||
!gBrowser.selectedBrowser._urlbarFocused &&
|
||||
|
Loading…
Reference in New Issue
Block a user