зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1195054 - The location bar should display 10 autocomplete suggestions without scrollbar instead of 6. r=mak
This commit is contained in:
Родитель
9c769696c2
Коммит
4594ef3ded
|
@ -304,7 +304,7 @@ pref("browser.urlbar.matchBehavior", 1);
|
|||
pref("browser.urlbar.filter.javascript", true);
|
||||
|
||||
// the maximum number of results to show in autocomplete when doing richResults
|
||||
pref("browser.urlbar.maxRichResults", 12);
|
||||
pref("browser.urlbar.maxRichResults", 10);
|
||||
// The amount of time (ms) to wait after the user has stopped typing
|
||||
// before starting to perform autocomplete. 50 is the default set in
|
||||
// autocomplete.xml.
|
||||
|
|
|
@ -698,7 +698,7 @@
|
|||
showcommentcolumn="true"
|
||||
showimagecolumn="true"
|
||||
enablehistory="true"
|
||||
maxrows="6"
|
||||
maxrows="10"
|
||||
newlines="stripsurroundingwhitespace"
|
||||
ontextentered="this.handleCommand(param);"
|
||||
ontextreverted="return this.handleRevert();"
|
||||
|
|
|
@ -16,12 +16,14 @@ add_task(function*() {
|
|||
Services.prefs.setBoolPref("browser.urlbar.unifiedcomplete", ucpref);
|
||||
});
|
||||
|
||||
let maxResults = Services.prefs.getIntPref("browser.urlbar.maxRichResults");
|
||||
|
||||
registerCleanupFunction(function* () {
|
||||
yield PlacesTestUtils.clearHistory();
|
||||
});
|
||||
|
||||
let visits = [];
|
||||
repeat(10, i => {
|
||||
repeat(maxResults, i => {
|
||||
visits.push({
|
||||
uri: makeURI("http://example.com/autocomplete/?" + i),
|
||||
});
|
||||
|
@ -34,20 +36,20 @@ add_task(function*() {
|
|||
|
||||
let popup = gURLBar.popup;
|
||||
let results = popup.richlistbox.children;
|
||||
// 1 extra for the current search engine match
|
||||
is(results.length, 11, "Should get 11 results");
|
||||
is(results.length, maxResults,
|
||||
"Should get maxResults=" + maxResults + " results");
|
||||
is_selected(0);
|
||||
|
||||
info("Key Down to select the next item");
|
||||
EventUtils.synthesizeKey("VK_DOWN", {});
|
||||
is_selected(1);
|
||||
|
||||
info("Key Down 11 times should wrap around all the way around");
|
||||
repeat(11, () => EventUtils.synthesizeKey("VK_DOWN", {}));
|
||||
info("Key Down maxResults times should wrap around all the way around");
|
||||
repeat(maxResults, () => EventUtils.synthesizeKey("VK_DOWN", {}));
|
||||
is_selected(1);
|
||||
|
||||
info("Key Up 11 times should wrap around the other way");
|
||||
repeat(11, () => EventUtils.synthesizeKey("VK_UP", {}));
|
||||
info("Key Up maxResults times should wrap around the other way");
|
||||
repeat(maxResults, () => EventUtils.synthesizeKey("VK_UP", {}));
|
||||
is_selected(1);
|
||||
|
||||
info("Page Up will go up the list, but not wrap");
|
||||
|
@ -56,7 +58,7 @@ add_task(function*() {
|
|||
|
||||
info("Page Up again will wrap around to the end of the list");
|
||||
EventUtils.synthesizeKey("VK_PAGE_UP", {})
|
||||
is_selected(10);
|
||||
is_selected(maxResults - 1);
|
||||
|
||||
EventUtils.synthesizeKey("VK_ESCAPE", {});
|
||||
yield promisePopupHidden(gURLBar.popup);
|
||||
|
|
|
@ -15,6 +15,8 @@ function is_selected(index) {
|
|||
is(gURLBar.popup.richlistbox.selectedIndex, index, `Item ${index + 1} should be selected`);
|
||||
}
|
||||
|
||||
let gMaxResults;
|
||||
|
||||
add_task(function*() {
|
||||
registerCleanupFunction(function* () {
|
||||
yield PlacesTestUtils.clearHistory();
|
||||
|
@ -23,8 +25,10 @@ add_task(function*() {
|
|||
yield PlacesTestUtils.clearHistory();
|
||||
let tabCount = gBrowser.tabs.length;
|
||||
|
||||
gMaxResults = Services.prefs.getIntPref("browser.urlbar.maxRichResults");
|
||||
|
||||
let visits = [];
|
||||
repeat(10, i => {
|
||||
repeat(gMaxResults, i => {
|
||||
visits.push({
|
||||
uri: makeURI("http://example.com/autocomplete/?" + i),
|
||||
});
|
||||
|
@ -44,7 +48,8 @@ function* do_test() {
|
|||
|
||||
let popup = gURLBar.popup;
|
||||
let results = popup.richlistbox.children;
|
||||
is(results.length, 11, "Should get 11 results");
|
||||
is(results.length, gMaxResults,
|
||||
"Should get gMaxResults=" + gMaxResults + " results");
|
||||
|
||||
let initiallySelected = gURLBar.popup.richlistbox.selectedIndex;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче